Add view for unpaid invoices
This commit is contained in:
parent
0de7fc0da5
commit
6989e2f4f7
6 changed files with 41 additions and 1 deletions
|
|
@ -4,7 +4,7 @@
|
|||
.span6
|
||||
%h2
|
||||
= t('.unpaid_invoices')
|
||||
%small= link_to t('.show_all'), finance_invoices_path
|
||||
%small= link_to t('.show_all'), unpaid_finance_invoices_path
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
|
|
|
|||
27
app/views/finance/invoices/unpaid.html.haml
Normal file
27
app/views/finance/invoices/unpaid.html.haml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
- title t('.title')
|
||||
|
||||
- for supplier in @suppliers
|
||||
- invoices = supplier.invoices.unpaid
|
||||
- if invoices.any?
|
||||
%h3= supplier.name
|
||||
- invoices_sum = 0
|
||||
- invoices_text = []
|
||||
%p
|
||||
- for invoice in invoices
|
||||
- invoices_sum += invoice.amount
|
||||
- invoices_text << invoice.number
|
||||
= link_to finance_invoice_path(invoice) do
|
||||
= format_date invoice.date
|
||||
= ' ' + invoice.number
|
||||
= ' ' + number_to_currency(invoice.amount)
|
||||
%br/
|
||||
%p
|
||||
- if supplier.iban.present?
|
||||
%b= heading_helper(Supplier, :iban) + ':'
|
||||
= supplier.iban
|
||||
%br/
|
||||
%b= t('.invoices_text') + ':'
|
||||
= invoices_text.join(', ')
|
||||
%br/
|
||||
%b= t('.invoices_sum') + ':'
|
||||
= number_to_currency invoices_sum
|
||||
Loading…
Add table
Add a link
Reference in a new issue