Skip to content

Commit

Permalink
fix(Bank Transaction): precision for (un)allocated_amount
Browse files Browse the repository at this point in the history
Manual Backport of #39926
  • Loading branch information
barredterra committed Feb 15, 2024
1 parent 51dc3f5 commit cea0e1f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ def update_allocations(self):
else:
allocated_amount = 0.0

amount = abs(flt(self.withdrawal) - flt(self.deposit))
self.db_set("allocated_amount", flt(allocated_amount))
self.db_set("unallocated_amount", amount - flt(allocated_amount))
unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) - allocated_amount

self.db_set("allocated_amount", flt(allocated_amount, self.precision("allocated_amount")))
self.db_set("unallocated_amount", flt(unallocated_amount, self.precision("unallocated_amount")))
self.reload()
self.set_status(update=True)

Expand Down

0 comments on commit cea0e1f

Please sign in to comment.