2013-02-27 12:31:01 +01:00
|
|
|
- title t('.title', number: @invoice.number)
|
2009-01-18 17:42:51 +01:00
|
|
|
|
2016-03-04 22:26:55 +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
|
2016-02-25 12:56:34 +01:00
|
|
|
%b= heading_helper(Invoice, :deliveries) + ':'
|
|
|
|
%span><
|
|
|
|
- @invoice.deliveries.order(:delivered_on).each_with_index do |delivery, index|
|
2016-03-04 22:26:55 +01:00
|
|
|
- sum = delivery.sum
|
|
|
|
- total += sum
|
2016-02-25 12:56:34 +01:00
|
|
|
= ', ' if index > 0
|
|
|
|
= link_to format_date(delivery.delivered_on), [delivery.supplier,delivery]
|
2016-03-04 22:26:55 +01:00
|
|
|
= ' (' + 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
|
2016-02-25 12:56:34 +01:00
|
|
|
%b= heading_helper(Invoice, :orders) + ':'
|
|
|
|
%span><
|
|
|
|
- @invoice.orders.order(:ends).each_with_index do |order, index|
|
2016-03-04 22:26:55 +01:00
|
|
|
- sum = order.sum
|
|
|
|
- total += sum
|
2016-02-25 12:56:34 +01:00
|
|
|
= ', ' if index > 0
|
|
|
|
= link_to format_date(order.ends), new_finance_order_path(order_id: order)
|
2016-03-04 22:26:55 +01:00
|
|
|
= ' (' + 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
|
2009-02-11 18:09:04 +01:00
|
|
|
%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
|
2016-03-04 22:26:55 +01:00
|
|
|
%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
|
2009-02-11 18:09:04 +01:00
|
|
|
%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
|
|
|
|
|
2016-02-17 21:07:35 +01:00
|
|
|
- if @invoice.user_can_edit?(current_user)
|
2016-02-18 23:20:32 +01:00
|
|
|
= 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
|