Xero invoices report: Preserve form fields on submit, do not show rows with no cost

This commit is contained in:
Rohan Mitchell
2015-05-15 15:27:46 +10:00
parent 3640a71ab8
commit 3d4a0f8407
3 changed files with 8 additions and 6 deletions

View File

@@ -36,10 +36,12 @@ module OpenFoodNetwork
summary_row(order, 'Total untaxable fees (no tax)', total_untaxable_fees(order), invoice_number, 'GST Free Income', opts),
summary_row(order, 'Total taxable fees (tax inclusive)', total_taxable_fees(order), invoice_number, 'GST on Income', opts),
summary_row(order, 'Delivery Shipping Cost (tax inclusive)', total_shipping(order), invoice_number, tax_on_shipping_s(order), opts)
]
].compact
end
def summary_row(order, description, amount, invoice_number, tax_type, opts={})
return nil if amount == 0
[order.bill_address.full_name,
order.email,
order.bill_address.address1,