fix: closing amount reset to expected amount on save (backport #43358) (#43368)

fix: closing amount reset to expected amount on save (#43358)

(cherry picked from commit 9974b7c4ae)

Co-authored-by: jabir-elat <44110258+jabir-elat@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2024-09-24 20:49:42 +05:30
committed by GitHub
parent cfea2de131
commit 0722aa5a3f

View File

@@ -194,7 +194,9 @@ function refresh_payments(d, frm) {
}
if (payment) {
payment.expected_amount += flt(p.amount);
payment.closing_amount = payment.expected_amount;
if (payment.closing_amount === 0) {
payment.closing_amount = payment.expected_amount;
}
payment.difference = payment.closing_amount - payment.expected_amount;
} else {
frm.add_child("payment_reconciliation", {