Skip to content

Commit 698d5be

Browse files
ljain112mergify[bot]
authored andcommitted
fix: update outstanding with precision
(cherry picked from commit aadda9f)
1 parent 59e46e2 commit 698d5be

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

erpnext/accounts/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,14 +1788,17 @@ def update_voucher_outstanding(voucher_type, voucher_no, account, party_type, pa
17881788
):
17891789
outstanding = voucher_outstanding[0]
17901790
ref_doc = frappe.get_doc(voucher_type, voucher_no)
1791+
outstanding_amount = flt(
1792+
outstanding["outstanding_in_account_currency"], ref_doc.precision("outstanding_amount")
1793+
)
17911794

17921795
# Didn't use db_set for optimisation purpose
1793-
ref_doc.outstanding_amount = outstanding["outstanding_in_account_currency"] or 0.0
1796+
ref_doc.outstanding_amount = outstanding_amount
17941797
frappe.db.set_value(
17951798
voucher_type,
17961799
voucher_no,
17971800
"outstanding_amount",
1798-
outstanding["outstanding_in_account_currency"] or 0.0,
1801+
outstanding_amount,
17991802
)
18001803

18011804
ref_doc.set_status(update=True)

0 commit comments

Comments
 (0)