From 0c2e9480cb8e4f42a2d90fd6b51e0479be20bb14 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 26 Jul 2024 08:00:13 +0530 Subject: [PATCH] fix: incorrect cost_center on AR/AP report (cherry picked from commit 3e19041fa3ede2e151cd137c8e94bb49c6efe621) --- .../accounts/report/accounts_receivable/accounts_receivable.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 30775c7fa66..f8511d2f497 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -139,6 +139,7 @@ class ReceivablePayableReport: paid_in_account_currency=0.0, credit_note_in_account_currency=0.0, outstanding_in_account_currency=0.0, + cost_center=ple.cost_center, ) self.get_invoices(ple) @@ -253,7 +254,7 @@ class ReceivablePayableReport: row.paid -= amount row.paid_in_account_currency -= amount_in_account_currency - if ple.cost_center: + if not row.cost_center and ple.cost_center: row.cost_center = str(ple.cost_center) def update_sub_total_row(self, row, party):