mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 22:48:27 +00:00
Merge pull request #53228 from frappe/mergify/bp/version-15-hotfix/pr-53227
refactor: party type and party filter for comparison report (backport #53227)
This commit is contained in:
@@ -37,6 +37,20 @@ function get_filters() {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldname: "party_type",
|
||||||
|
label: __("Party Type"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Party Type",
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "party",
|
||||||
|
label: __("Party"),
|
||||||
|
fieldtype: "Dynamic Link",
|
||||||
|
options: "party_type",
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "voucher_no",
|
fieldname: "voucher_no",
|
||||||
label: __("Voucher No"),
|
label: __("Voucher No"),
|
||||||
|
|||||||
@@ -68,6 +68,12 @@ class General_Payment_Ledger_Comparison:
|
|||||||
if self.filters.period_end_date:
|
if self.filters.period_end_date:
|
||||||
filter_criterion.append(gle.posting_date.lte(self.filters.period_end_date))
|
filter_criterion.append(gle.posting_date.lte(self.filters.period_end_date))
|
||||||
|
|
||||||
|
if self.filters.party_type:
|
||||||
|
filter_criterion.append(gle.party_type.eq(self.filters.party_type))
|
||||||
|
|
||||||
|
if self.filters.party:
|
||||||
|
filter_criterion.append(gle.party.eq(self.filters.party))
|
||||||
|
|
||||||
if acc_type == "receivable":
|
if acc_type == "receivable":
|
||||||
outstanding = (Sum(gle.debit) - Sum(gle.credit)).as_("outstanding")
|
outstanding = (Sum(gle.debit) - Sum(gle.credit)).as_("outstanding")
|
||||||
else:
|
else:
|
||||||
@@ -111,6 +117,12 @@ class General_Payment_Ledger_Comparison:
|
|||||||
if self.filters.period_end_date:
|
if self.filters.period_end_date:
|
||||||
filter_criterion.append(ple.posting_date.lte(self.filters.period_end_date))
|
filter_criterion.append(ple.posting_date.lte(self.filters.period_end_date))
|
||||||
|
|
||||||
|
if self.filters.party_type:
|
||||||
|
filter_criterion.append(ple.party_type.eq(self.filters.party_type))
|
||||||
|
|
||||||
|
if self.filters.party:
|
||||||
|
filter_criterion.append(ple.party.eq(self.filters.party))
|
||||||
|
|
||||||
self.account_types[acc_type].ple = (
|
self.account_types[acc_type].ple = (
|
||||||
qb.from_(ple)
|
qb.from_(ple)
|
||||||
.select(
|
.select(
|
||||||
|
|||||||
Reference in New Issue
Block a user