Skip to content

Commit 7342b25

Browse files
ervishnucsmergify[bot]
authored andcommitted
fix: check the payment ledger entry has the dimension (#51823)
* fix: check the payment ledger entry has the dimension * fix: add project in payment ledger entry (cherry picked from commit efa3973)
1 parent 6115f8f commit 7342b25

4 files changed

Lines changed: 9 additions & 1 deletion

File tree

erpnext/accounts/doctype/payment_ledger_entry/payment_ledger_entry.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@
132132
"fieldtype": "Link",
133133
"label": "Cost Center",
134134
"options": "Cost Center"
135+
},
136+
{
137+
"fieldname": "project",
138+
"fieldtype": "Link",
139+
"label": "Project",
140+
"options": "Project"
135141
},
136142
{
137143
"fieldname": "due_date",

erpnext/accounts/doctype/payment_ledger_entry/payment_ledger_entry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class PaymentLedgerEntry(Document):
3838
amount_in_account_currency: DF.Currency
3939
company: DF.Link | None
4040
cost_center: DF.Link | None
41+
project: DF.Link | None
4142
delinked: DF.Check
4243
due_date: DF.Date | None
4344
finance_book: DF.Link | None

erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ def build_dimensions_filter_conditions(self):
746746
ple = qb.DocType("Payment Ledger Entry")
747747
for x in self.dimensions:
748748
dimension = x.fieldname
749-
if self.get(dimension):
749+
if self.get(dimension) and frappe.db.has_column("Payment Ledger Entry", dimension):
750750
self.accounting_dimension_filter_conditions.append(ple[dimension] == self.get(dimension))
751751

752752
def build_qb_filter_conditions(self, get_invoices=False, get_return_invoices=False):

erpnext/accounts/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,7 @@ def get_account_type(account):
19471947
account=gle.account,
19481948
party_type=gle.party_type,
19491949
party=gle.party,
1950+
project=gle.project,
19501951
cost_center=gle.cost_center,
19511952
finance_book=gle.finance_book,
19521953
due_date=gle.due_date,

0 commit comments

Comments
 (0)