mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 14:08:29 +00:00
Merge pull request #47863 from khushi8112/closing-balance-in-dr-cr
feat: show Dr/Cr in Supplier ledger summary & Customer ledger summary
This commit is contained in:
@@ -210,6 +210,7 @@ class PartyLedgerSummaryReport:
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Currency",
|
"options": "Currency",
|
||||||
"width": 50,
|
"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
|
return columns
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
@@ -300,6 +302,13 @@ class PartyLedgerSummaryReport:
|
|||||||
for account in self.party_adjustment_accounts:
|
for account in self.party_adjustment_accounts:
|
||||||
row["adj_" + scrub(account)] = adjustments.get(account, 0)
|
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)
|
out.append(row)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|||||||
Reference in New Issue
Block a user