From 190f77abffeca7bbc5983806caebce656a040035 Mon Sep 17 00:00:00 2001 From: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com> Date: Sun, 26 Nov 2023 18:56:34 +0530 Subject: [PATCH] fix: precision for invoice outstandings (#38323) fix: precision while setting inv outstanding --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 8a3f9341182..fb2f001cf12 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -358,6 +358,7 @@ def update_outstanding_amt( if against_voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]: ref_doc = frappe.get_doc(against_voucher_type, against_voucher) + bal = flt(bal, frappe.get_precision(against_voucher_type, "outstanding_amount")) # Didn't use db_set for optimization purpose ref_doc.outstanding_amount = bal frappe.db.set_value(against_voucher_type, against_voucher, "outstanding_amount", bal)