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,16 +252,19 @@ class GroupOrderInvoicePdf < RenderPdf
|
|||
tmp_sum << number_to_currency(tax_hash_fc[key])
|
||||
sum << tmp_sum
|
||||
|
||||
tmp_sum = [nil, "Pfand mit #{key}%", number_to_currency(tax_hash_deposit_net[key])]
|
||||
if marge <= 0
|
||||
tmp_sum.unshift(nil)
|
||||
|
||||
if separate_deposits
|
||||
tmp_sum = [nil, "Pfand mit #{key}%", number_to_currency(tax_hash_deposit_net[key])]
|
||||
if marge <= 0
|
||||
tmp_sum.unshift(nil)
|
||||
end
|
||||
tmp_sum << number_to_currency(tax_hash_deposit_gross[key] - tax_hash_deposit_net[key])
|
||||
if marge > 0
|
||||
tmp_sum << number_to_currency(tax_hash_deposit_fc[key] - tax_hash_deposit_gross[key])
|
||||
end
|
||||
tmp_sum << number_to_currency(tax_hash_deposit_fc[key])
|
||||
sum << tmp_sum
|
||||
end
|
||||
tmp_sum << number_to_currency(tax_hash_deposit_gross[key] - tax_hash_deposit_net[key])
|
||||
if marge > 0
|
||||
tmp_sum << number_to_currency(tax_hash_deposit_fc[key] - tax_hash_deposit_gross[key])
|
||||
end
|
||||
tmp_sum << number_to_currency(tax_hash_deposit_fc[key])
|
||||
sum << tmp_sum
|
||||
end
|
||||
|
||||
total_deposit_gross ||= 0
|
||||
|
|
|
@ -34,7 +34,7 @@ nkn_supplier = Supplier.create!(
|
|||
name: "Naturgut Süd",
|
||||
address: "Somewhere in Hamburg, maybe St. Pauli?",
|
||||
phone: "0123434789",
|
||||
email: "foodsoft@local-it.org",
|
||||
email: "foodsoft@test.org",
|
||||
supplier_category: supplier_category
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue