Skip to content

Commit

Permalink
Merge pull request #39926 from barredterra/bt-precision
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra authored Feb 15, 2024
2 parents 8360339 + 8a702a6 commit f3bd531
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ def validate_duplicate_references(self):
pe.append(reference)

def update_allocated_amount(self):
self.allocated_amount = (
allocated_amount = (
sum(p.allocated_amount for p in self.payment_entries) if self.payment_entries else 0.0
)
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) - self.allocated_amount
unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) - allocated_amount

self.allocated_amount = flt(allocated_amount, self.precision("allocated_amount"))
self.unallocated_amount = flt(unallocated_amount, self.precision("unallocated_amount"))

def before_submit(self):
self.allocate_payment_entries()
Expand Down

0 comments on commit f3bd531

Please sign in to comment.