foodsoft/app/views/finance/invoices/show.html.haml

68 lines
2 KiB
Text
Raw Normal View History

- title t('.title', number: @invoice.number)
2009-01-18 17:42:51 +01:00
- total = 0
2016-02-17 16:11:01 +01:00
%p
%b= heading_helper(Invoice, :created_at) + ':'
= format_time(@invoice.created_at)
%p
%b= heading_helper(Invoice, :created_by) + ':'
= show_user(@invoice.created_by)
2009-01-18 17:42:51 +01:00
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :supplier) + ':'
2012-04-20 18:33:47 +02:00
= @invoice.supplier.name
2013-06-21 14:24:05 +02:00
2016-03-04 17:39:06 +01:00
- if @invoice.deliveries.any?
2009-01-18 17:42:51 +01:00
%p
%b= heading_helper(Invoice, :deliveries) + ':'
%span><
- @invoice.deliveries.order(:delivered_on).each_with_index do |delivery, index|
- sum = delivery.sum
- total += sum
= ', ' if index > 0
= link_to format_date(delivery.delivered_on), [delivery.supplier,delivery]
= ' (' + number_to_currency(sum) + ')'
2016-03-04 17:39:06 +01:00
- if @invoice.orders.any?
2013-06-21 14:24:05 +02:00
%p
%b= heading_helper(Invoice, :orders) + ':'
%span><
- @invoice.orders.order(:ends).each_with_index do |order, index|
- sum = order.sum
- total += sum
= ', ' if index > 0
= link_to format_date(order.ends), new_finance_order_path(order_id: order)
= ' (' + number_to_currency(sum) + ')'
2013-06-21 14:24:05 +02:00
2009-01-18 17:42:51 +01:00
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :number) + ':'
2012-04-20 18:33:47 +02:00
= @invoice.number
2009-01-18 17:42:51 +01:00
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :date) + ':'
2012-04-20 18:33:47 +02:00
= @invoice.date
2009-01-18 17:42:51 +01:00
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :paid_on) + ':'
2012-04-20 18:33:47 +02:00
= @invoice.paid_on
2009-01-18 17:42:51 +01:00
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :amount) + ':'
2012-04-20 18:33:47 +02:00
= number_to_currency @invoice.amount
2009-01-18 17:42:51 +01:00
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :deposit) + ':'
2012-04-20 18:33:47 +02:00
= number_to_currency @invoice.deposit
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :deposit_credit) + ':'
2012-04-20 18:33:47 +02:00
= number_to_currency @invoice.deposit_credit
%p
%b= heading_helper(Invoice, :net_amount) + ':'
= number_to_currency @invoice.net_amount
- if @invoice.deliveries.any? || @invoice.orders.any?
%p
%b= heading_helper(Invoice, :total) + ':'
= number_to_currency total
%p
2013-10-09 23:37:08 +02:00
%b= heading_helper(Invoice, :note) + ':'
2009-01-18 17:42:51 +01:00
=h @invoice.note
- if @invoice.user_can_edit?(current_user)
= link_to t('ui.edit'), edit_finance_invoice_path(@invoice), class: 'btn'
2015-06-06 20:20:07 +02:00
= link_to t('ui.or_cancel'), finance_invoices_path