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..c45de28aec5 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, }, ] @@ -242,6 +243,7 @@ class PartyLedgerSummaryReport: } ] + columns.append({"label": _("Dr/Cr"), "fieldname": "dr_or_cr", "fieldtype": "Data", "width": 100}) return columns def get_data(self): @@ -300,6 +302,13 @@ class PartyLedgerSummaryReport: for account in self.party_adjustment_accounts: row["adj_" + scrub(account)] = adjustments.get(account, 0) + 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