fix: ZeroDivisionError on creating e-invoice for credit note (#26915)
This commit is contained in:
parent
54c31ed33c
commit
88f13fef81
@ -190,8 +190,10 @@ def get_item_list(invoice):
|
||||
item.description = sanitize_for_json(d.item_name)
|
||||
|
||||
item.qty = abs(item.qty)
|
||||
|
||||
item.unit_rate = abs(item.taxable_value / item.qty)
|
||||
if flt(item.qty) != 0.0:
|
||||
item.unit_rate = abs(item.taxable_value / item.qty)
|
||||
else:
|
||||
item.unit_rate = abs(item.taxable_value)
|
||||
item.gross_amount = abs(item.taxable_value)
|
||||
item.taxable_value = abs(item.taxable_value)
|
||||
item.discount_amount = 0
|
||||
|
Loading…
Reference in New Issue
Block a user