2022-06-06 03:20:54 +00:00
|
|
|
// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
|
|
|
|
// For license information, please see license.txt
|
2023-07-14 13:23:02 +00:00
|
|
|
|
2022-06-06 03:20:54 +00:00
|
|
|
|
|
|
|
function get_filters() {
|
|
|
|
let filters = [
|
|
|
|
{
|
|
|
|
"fieldname":"company",
|
|
|
|
"label": __("Company"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"options": "Company",
|
|
|
|
"default": frappe.defaults.get_user_default("Company"),
|
|
|
|
"reqd": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"period_start_date",
|
|
|
|
"label": __("Start Date"),
|
|
|
|
"fieldtype": "Date",
|
|
|
|
"reqd": 1,
|
|
|
|
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"period_end_date",
|
|
|
|
"label": __("End Date"),
|
|
|
|
"fieldtype": "Date",
|
|
|
|
"reqd": 1,
|
|
|
|
"default": frappe.datetime.get_today()
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"account",
|
|
|
|
"label": __("Account"),
|
|
|
|
"fieldtype": "MultiSelectList",
|
|
|
|
"options": "Account",
|
|
|
|
get_data: function(txt) {
|
|
|
|
return frappe.db.get_link_options('Account', txt, {
|
|
|
|
company: frappe.query_report.get_filter_value("company")
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
2023-03-24 06:55:03 +00:00
|
|
|
{
|
|
|
|
"fieldname":"party_type",
|
|
|
|
"label": __("Party Type"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"options": "Party Type",
|
|
|
|
"default": "",
|
|
|
|
on_change: function() {
|
|
|
|
frappe.query_report.set_filter_value('party', "");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"party",
|
|
|
|
"label": __("Party"),
|
|
|
|
"fieldtype": "MultiSelectList",
|
|
|
|
get_data: function(txt) {
|
|
|
|
if (!frappe.query_report.filters) return;
|
|
|
|
|
|
|
|
let party_type = frappe.query_report.get_filter_value('party_type');
|
|
|
|
if (!party_type) return;
|
|
|
|
|
|
|
|
return frappe.db.get_link_options(party_type, txt);
|
|
|
|
},
|
|
|
|
},
|
2022-06-06 03:20:54 +00:00
|
|
|
{
|
|
|
|
"fieldname":"voucher_no",
|
|
|
|
"label": __("Voucher No"),
|
|
|
|
"fieldtype": "Data",
|
|
|
|
"width": 100,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"against_voucher_no",
|
|
|
|
"label": __("Against Voucher No"),
|
|
|
|
"fieldtype": "Data",
|
|
|
|
"width": 100,
|
|
|
|
},
|
2023-03-24 06:55:03 +00:00
|
|
|
{
|
|
|
|
"fieldname":"include_account_currency",
|
|
|
|
"label": __("Include Account Currency"),
|
|
|
|
"fieldtype": "Check",
|
|
|
|
"width": 100,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"group_party",
|
|
|
|
"label": __("Group by Party"),
|
|
|
|
"fieldtype": "Check",
|
|
|
|
"width": 100,
|
|
|
|
},
|
|
|
|
|
|
|
|
|
2022-06-06 03:20:54 +00:00
|
|
|
|
|
|
|
]
|
|
|
|
return filters;
|
|
|
|
}
|
|
|
|
|
|
|
|
frappe.query_reports["Payment Ledger"] = {
|
|
|
|
"filters": get_filters()
|
|
|
|
};
|