mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-21 07:52:13 +00:00
fix(Bank Transaction): precision for (un)allocated_amount
(cherry picked from commit 8a702a6338)
This commit is contained in:
@@ -94,10 +94,13 @@ class BankTransaction(Document):
|
|||||||
pe.append(reference)
|
pe.append(reference)
|
||||||
|
|
||||||
def update_allocated_amount(self):
|
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
|
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):
|
def before_submit(self):
|
||||||
self.allocate_payment_entries()
|
self.allocate_payment_entries()
|
||||||
|
|||||||
Reference in New Issue
Block a user