@@ -1,13 +1,52 @@
|
|||||||
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
function get_filters() {
|
||||||
|
let filters = [
|
||||||
|
{
|
||||||
|
fieldname: "company",
|
||||||
|
label: __("Company"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Company",
|
||||||
|
default: frappe.defaults.get_user_default("Company"),
|
||||||
|
reqd: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "from_date",
|
||||||
|
label: __("Start Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
reqd: 1,
|
||||||
|
default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "to_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"),
|
||||||
|
account_type: ["in", ["Receivable", "Payable"]],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "voucher_no",
|
||||||
|
label: __("Voucher No"),
|
||||||
|
fieldtype: "Data",
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
frappe.query_reports["Invalid Ledger Entries"] = {
|
frappe.query_reports["Invalid Ledger Entries"] = {
|
||||||
filters: [
|
filters: get_filters(),
|
||||||
// {
|
|
||||||
// "fieldname": "my_filter",
|
|
||||||
// "label": __("My Filter"),
|
|
||||||
// "fieldtype": "Data",
|
|
||||||
// "reqd": 1,
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user