Error in Purchase Return where journal amounts do not match due to rounding fixed.

This commit is contained in:
Tanshu 2013-05-18 12:13:06 +05:30
parent 867935306d
commit 6e6113436b

View File

@ -50,7 +50,7 @@ def purchase_return_create_journals(inventories, ledgerID):
ledger = Product.by_id(item.product_id).ledger ledger = Product.by_id(item.product_id).ledger
amount += round(item.amount, 2) amount += round(item.amount, 2)
if ledger.id in journals: if ledger.id in journals:
journals[ledger.id].amount += item.amount journals[ledger.id].amount += amount
else: else:
journals[ledger.id] = Journal(debit=-1, cost_center_id=ledger.costcenter_id, ledger_id=ledger.id, journals[ledger.id] = Journal(debit=-1, cost_center_id=ledger.costcenter_id, ledger_id=ledger.id,
amount=item.amount) amount=item.amount)