From 9974b7c4ae53505e85019a29481693e492cc8b17 Mon Sep 17 00:00:00 2001 From: jabir-elat <44110258+jabir-elat@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:04:30 +0530 Subject: [PATCH] fix: closing amount reset to expected amount on save (#43358) --- .../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", {