From 0722aa5a3f5c318110933fadd38303d690d0db32 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 20:49:42 +0530 Subject: [PATCH] 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 9974b7c4ae53505e85019a29481693e492cc8b17) Co-authored-by: jabir-elat <44110258+jabir-elat@users.noreply.github.com> --- .../accounts/doctype/pos_closing_entry/pos_closing_entry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js index 68a85f7ee96..c171713dc61 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js +++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js @@ -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", {