Files
openfoodnetwork/app/views/admin/account/show.html.haml
Pau Perez 5845f80af0 Remove commented out code
Because git keeps it for you.
2018-12-05 10:05:39 +01:00

48 lines
1.7 KiB
Plaintext

- content_for :page_title do
= t(:account)
- if @invoices.empty?
%h4= t(:no_invoices_to_display)
- @invoices.order('year DESC, month DESC').each do |invoice|
.row.invoice_title
.two.columns.alpha
%h4= invoice_description_for(invoice)
.two.columns.text-right
%h5
- if invoice.order.andand.complete?
%a{ href: print_admin_order_url(invoice.order), :target => "_blank"}
%i.icon-print
= t(:print)
- else
 
.ten.columns
 
.two.columns.omega.text-right
%h4.balance= invoice_total_for(invoice)
%table.invoice_summary
%col{ width: '25%' }
%col{ width: '62.5%' }
%col{ width: '12.5%' }
%thead
%th= t('admin.date')
%th= t(:description)
%th= t(:charge)
- if order = invoice.order
- invoice.billable_periods.select{ |bp| bp.adjustment.andand.amount.andand > 0}.each do |billable_period|
%tr
%td.text-center= "#{billable_period.begins_at.strftime("%d/%m/%Y")}"
%td= billable_period.label
-# Using amount from the actual adjustment on the order here so that we avoid recalculating the bill
-# at a future date with different settings to those used at the time the invoice was finalized
%td.text-right= billable_period.adjustment.display_amount
- order.adjustments.where('source_type <> (?)', "BillablePeriod").reject{ |a| a.amount == 0 }.each do |adjustment|
%tr
%td.text-center &nbsp;
%td= adjustment.label
%td.text-right= adjustment.display_amount
%tr.total
%td.text-center &nbsp;
%td= t(:total).upcase
%td.text-right= invoice_total_for(invoice)