From d15e3bb52b278c928ec248a8fc455a2940897820 Mon Sep 17 00:00:00 2001 From: Khushi Rawat <142375893+khushi8112@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:04:27 +0530 Subject: [PATCH 1/6] feat: show Dr/Cr in Supplier ledger summary & Customer ledger summary --- .../customer_ledger_summary/customer_ledger_summary.js | 6 ++++++ .../supplier_ledger_summary/supplier_ledger_summary.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js index 736dbed53d3..c1421a916e3 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js @@ -115,6 +115,12 @@ frappe.query_reports["Customer Ledger Summary"] = { }); }, }, + { + fieldname: "show_dr_cr", + label: __("Closing Balance in Dr/Cr"), + fieldtype: "Check", + default: 0, + }, ], }; diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js index df0a204be8a..e0bfb4910c9 100644 --- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js +++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js @@ -96,6 +96,12 @@ frappe.query_reports["Supplier Ledger Summary"] = { }); }, }, + { + fieldname: "show_dr_cr", + label: __("Closing Balnce in Dr/Cr"), + fieldtype: "Check", + default: 0, + }, ], }; From e7ba420687d5f1a5f3cd40e6d9458fe46c9718b3 Mon Sep 17 00:00:00 2001 From: Khushi Rawat <142375893+khushi8112@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:05:43 +0530 Subject: [PATCH 2/6] feat: added column to show Dr/Cr --- .../customer_ledger_summary/customer_ledger_summary.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index b90f922d82b..8d28ed302d2 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -242,6 +242,8 @@ class PartyLedgerSummaryReport: } ] + if self.filters.show_dr_cr: + columns.append({"label": "Dr/Cr", "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100}) return columns def get_data(self): @@ -300,6 +302,14 @@ class PartyLedgerSummaryReport: for account in self.party_adjustment_accounts: row["adj_" + scrub(account)] = adjustments.get(account, 0) + if self.filters.show_dr_cr: + if self.filters.party_type == "Customer": + balance = row.get("closing_balance", 0) + row["dr_or_cr"] = "Dr" if balance > 0 else "Cr" if balance < 0 else "" + else: + balance = row.get("closing_balance", 0) + row["dr_or_cr"] = "Cr" if balance > 0 else "Dr" if balance < 0 else "" + out.append(row) return out From 22ea62e92f52f528e213f396fcde8ac84dac1ae8 Mon Sep 17 00:00:00 2001 From: Khushi Rawat <142375893+khushi8112@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:06:39 +0530 Subject: [PATCH 3/6] chore: hide currency column --- .../report/customer_ledger_summary/customer_ledger_summary.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 8d28ed302d2..64b174f809c 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -210,6 +210,7 @@ class PartyLedgerSummaryReport: "fieldtype": "Link", "options": "Currency", "width": 50, + "hidden": 1, }, ] From 0dbebe74c1249551ca2e9ad4c0bfd60d44e19c2a Mon Sep 17 00:00:00 2001 From: Khushi Rawat <142375893+khushi8112@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:23:56 +0530 Subject: [PATCH 4/6] chore: update label --- .../report/customer_ledger_summary/customer_ledger_summary.py | 2 +- .../report/supplier_ledger_summary/supplier_ledger_summary.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 64b174f809c..0121d294955 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -244,7 +244,7 @@ class PartyLedgerSummaryReport: ] if self.filters.show_dr_cr: - columns.append({"label": "Dr/Cr", "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100}) + columns.append({"label": "Dr or Cr", "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100}) return columns def get_data(self): diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js index e0bfb4910c9..76cc979de75 100644 --- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js +++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js @@ -98,7 +98,7 @@ frappe.query_reports["Supplier Ledger Summary"] = { }, { fieldname: "show_dr_cr", - label: __("Closing Balnce in Dr/Cr"), + label: __("Closing Balance in Dr/Cr"), fieldtype: "Check", default: 0, }, From ff285307c6e62776275ad47fd56c35d34a5ae96d Mon Sep 17 00:00:00 2001 From: Khushi Rawat <142375893+khushi8112@users.noreply.github.com> Date: Tue, 3 Jun 2025 12:33:46 +0530 Subject: [PATCH 5/6] chore: wrapped text in translate function --- .../report/customer_ledger_summary/customer_ledger_summary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 0121d294955..0c76efbb962 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -244,7 +244,9 @@ class PartyLedgerSummaryReport: ] if self.filters.show_dr_cr: - columns.append({"label": "Dr or Cr", "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100}) + columns.append( + {"label": _("Dr or Cr"), "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100} + ) return columns def get_data(self): From 524ae1d368af680890bc852fcb2494ccb1be0379 Mon Sep 17 00:00:00 2001 From: Khushi Rawat <142375893+khushi8112@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:53:21 +0530 Subject: [PATCH 6/6] fix: removed checkbox --- .../customer_ledger_summary.js | 6 ------ .../customer_ledger_summary.py | 18 +++++++----------- .../supplier_ledger_summary.js | 6 ------ 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js index c1421a916e3..736dbed53d3 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js @@ -115,12 +115,6 @@ frappe.query_reports["Customer Ledger Summary"] = { }); }, }, - { - fieldname: "show_dr_cr", - label: __("Closing Balance in Dr/Cr"), - fieldtype: "Check", - default: 0, - }, ], }; diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 0c76efbb962..c45de28aec5 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -243,10 +243,7 @@ class PartyLedgerSummaryReport: } ] - if self.filters.show_dr_cr: - columns.append( - {"label": _("Dr or Cr"), "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100} - ) + columns.append({"label": _("Dr/Cr"), "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100}) return columns def get_data(self): @@ -305,13 +302,12 @@ class PartyLedgerSummaryReport: for account in self.party_adjustment_accounts: row["adj_" + scrub(account)] = adjustments.get(account, 0) - if self.filters.show_dr_cr: - if self.filters.party_type == "Customer": - balance = row.get("closing_balance", 0) - row["dr_or_cr"] = "Dr" if balance > 0 else "Cr" if balance < 0 else "" - else: - balance = row.get("closing_balance", 0) - row["dr_or_cr"] = "Cr" if balance > 0 else "Dr" if balance < 0 else "" + if self.filters.party_type == "Customer": + balance = row.get("closing_balance", 0) + row["dr_or_cr"] = "Dr" if balance > 0 else "Cr" if balance < 0 else "" + else: + balance = row.get("closing_balance", 0) + row["dr_or_cr"] = "Cr" if balance > 0 else "Dr" if balance < 0 else "" out.append(row) diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js index 76cc979de75..df0a204be8a 100644 --- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js +++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js @@ -96,12 +96,6 @@ frappe.query_reports["Supplier Ledger Summary"] = { }); }, }, - { - fieldname: "show_dr_cr", - label: __("Closing Balance in Dr/Cr"), - fieldtype: "Check", - default: 0, - }, ], };