fix: Division by zero error fix in group similar item

This commit is contained in:
deepeshgarg007 2019-06-24 17:46:44 +05:30
parent b8df611160
commit e8d21cd8fa

View File

@ -778,7 +778,12 @@ class AccountsController(TransactionBase):
count += 1
item.qty = group_item_qty[item.item_code]
item.amount = group_item_amount[item.item_code]
item.rate = flt(flt(item.amount) / flt(item.qty), item.precision("rate"))
if item.qty:
item.rate = flt(flt(item.amount) / flt(item.qty), item.precision("rate"))
else:
item.rate = 0
item.idx = count
del group_item_qty[item.item_code]
else: