From 197b13eb8762e4be0d035621f6e9897b86e38e62 Mon Sep 17 00:00:00 2001 From: vishakhdesai Date: Fri, 20 Dec 2024 18:03:42 +0530 Subject: [PATCH 1/2] fix: update correct cost center in Accounts Receivable Report (cherry picked from commit 09776e9a5ab6221329b3f6e8e3ad94aee0e43d5d) --- .../accounts/report/accounts_receivable/accounts_receivable.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index f488b1a5832..974e14b7352 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -145,6 +145,9 @@ class ReceivablePayableReport: if key not in self.voucher_balance: self.voucher_balance[key] = self.build_voucher_dict(ple) + if ple.voucher_type == ple.against_voucher_type and ple.voucher_no == ple.against_voucher_no: + self.voucher_balance[key].cost_center = ple.cost_center + self.get_invoices(ple) if self.filters.get("group_by_party"): From 97d5d18041547b2a1d5b7e49480de62065cdb519 Mon Sep 17 00:00:00 2001 From: vishakhdesai Date: Fri, 20 Dec 2024 18:41:51 +0530 Subject: [PATCH 2/2] fix: do not set cost_center update_voucher_balance as it is set in init_voucher_balance (cherry picked from commit 3b36ce560c1faeeff93c428a589522138ab364d2) --- .../report/accounts_receivable/accounts_receivable.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 974e14b7352..eeff456291a 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -129,7 +129,6 @@ 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, ) def init_voucher_balance(self): @@ -273,9 +272,6 @@ class ReceivablePayableReport: row.paid -= amount row.paid_in_account_currency -= amount_in_account_currency - if not row.cost_center and ple.cost_center: - row.cost_center = str(ple.cost_center) - def update_sub_total_row(self, row, party): total_row = self.total_row_map.get(party)