fix nil when not separate_deposits
This commit is contained in:
parent
c3d56cdf3b
commit
f979face11
2 changed files with 13 additions and 10 deletions
|
@ -252,6 +252,8 @@ class GroupOrderInvoicePdf < RenderPdf
|
||||||
tmp_sum << number_to_currency(tax_hash_fc[key])
|
tmp_sum << number_to_currency(tax_hash_fc[key])
|
||||||
sum << tmp_sum
|
sum << tmp_sum
|
||||||
|
|
||||||
|
|
||||||
|
if separate_deposits
|
||||||
tmp_sum = [nil, "Pfand mit #{key}%", number_to_currency(tax_hash_deposit_net[key])]
|
tmp_sum = [nil, "Pfand mit #{key}%", number_to_currency(tax_hash_deposit_net[key])]
|
||||||
if marge <= 0
|
if marge <= 0
|
||||||
tmp_sum.unshift(nil)
|
tmp_sum.unshift(nil)
|
||||||
|
@ -263,6 +265,7 @@ class GroupOrderInvoicePdf < RenderPdf
|
||||||
tmp_sum << number_to_currency(tax_hash_deposit_fc[key])
|
tmp_sum << number_to_currency(tax_hash_deposit_fc[key])
|
||||||
sum << tmp_sum
|
sum << tmp_sum
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
total_deposit_gross ||= 0
|
total_deposit_gross ||= 0
|
||||||
sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay_gross'), number_to_currency(total_gross + total_deposit_gross)]
|
sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay_gross'), number_to_currency(total_gross + total_deposit_gross)]
|
||||||
|
|
|
@ -34,7 +34,7 @@ nkn_supplier = Supplier.create!(
|
||||||
name: "Naturgut Süd",
|
name: "Naturgut Süd",
|
||||||
address: "Somewhere in Hamburg, maybe St. Pauli?",
|
address: "Somewhere in Hamburg, maybe St. Pauli?",
|
||||||
phone: "0123434789",
|
phone: "0123434789",
|
||||||
email: "foodsoft@local-it.org",
|
email: "foodsoft@test.org",
|
||||||
supplier_category: supplier_category
|
supplier_category: supplier_category
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue