fix: carry bank/cash account and cost center into Payment Reconciliation

This commit is contained in:
Nabin Hait
2026-07-03 14:16:46 +05:30
parent 974571aba7
commit c9960b4d51
2 changed files with 5 additions and 6 deletions

View File

@@ -106,6 +106,8 @@ def get_pr_instance(doc: str):
"party",
"receivable_payable_account",
"default_advance_account",
"bank_cash_account",
"cost_center",
"from_invoice_date",
"to_invoice_date",
"from_payment_date",

View File

@@ -63,14 +63,11 @@ class TestProcessPaymentReconciliation(ERPNextTestSuite):
self.assertEqual(pr.invoice_limit, 1000)
self.assertEqual(pr.payment_limit, 1000)
def test_get_pr_instance_drops_bank_cash_and_cost_center_filters(self):
# SUSPECTED BUG: get_pr_instance's field list omits bank_cash_account and
# cost_center, so those filters are silently lost when the tool run is built.
# Locking the current (wrong) behaviour.
def test_get_pr_instance_copies_bank_cash_and_cost_center(self):
doc = self.make_ppr(bank_cash_account="Cash - _TC")
doc.cost_center = "_Test Cost Center - _TC"
doc.insert()
pr = get_pr_instance(doc.name)
self.assertFalse(pr.get("bank_cash_account"))
self.assertFalse(pr.get("cost_center"))
self.assertEqual(pr.bank_cash_account, "Cash - _TC")
self.assertEqual(pr.cost_center, "_Test Cost Center - _TC")