mirror of
https://github.com/hanzoai/erp.git
synced 2026-10-30 14:51:17 +00:00
* fix: age range in one field * fix: patch for custom reports * refactor: stock ageing and account payable report * fix: fixing the test cases * fix: common patch for reports with ageing * refactor: rename variable and minor refactor * fix: fixing the test case
70 lines
1.5 KiB
JavaScript
70 lines
1.5 KiB
JavaScript
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
// License: GNU General Public License v3. See license.txt
|
|
|
|
frappe.query_reports["Stock Ageing"] = {
|
|
filters: [
|
|
{
|
|
fieldname: "company",
|
|
label: __("Company"),
|
|
fieldtype: "Link",
|
|
options: "Company",
|
|
default: frappe.defaults.get_user_default("Company"),
|
|
reqd: 1,
|
|
},
|
|
{
|
|
fieldname: "to_date",
|
|
label: __("As On Date"),
|
|
fieldtype: "Date",
|
|
default: frappe.datetime.get_today(),
|
|
reqd: 1,
|
|
},
|
|
{
|
|
fieldname: "warehouse_type",
|
|
label: __("Warehouse Type"),
|
|
fieldtype: "Link",
|
|
width: "80",
|
|
options: "Warehouse Type",
|
|
},
|
|
{
|
|
fieldname: "warehouse",
|
|
label: __("Warehouse"),
|
|
fieldtype: "Link",
|
|
options: "Warehouse",
|
|
get_query: () => {
|
|
let warehouse_type = frappe.query_report.get_filter_value("warehouse_type");
|
|
let company = frappe.query_report.get_filter_value("company");
|
|
return {
|
|
filters: {
|
|
...(warehouse_type && { warehouse_type }),
|
|
...(company && { company }),
|
|
},
|
|
};
|
|
},
|
|
},
|
|
{
|
|
fieldname: "item_code",
|
|
label: __("Item"),
|
|
fieldtype: "Link",
|
|
options: "Item",
|
|
},
|
|
{
|
|
fieldname: "brand",
|
|
label: __("Brand"),
|
|
fieldtype: "Link",
|
|
options: "Brand",
|
|
},
|
|
{
|
|
fieldname: "range",
|
|
label: __("Ageing Range"),
|
|
fieldtype: "Data",
|
|
default: "30, 60, 90",
|
|
},
|
|
{
|
|
fieldname: "show_warehouse_wise_stock",
|
|
label: __("Show Warehouse-wise Stock"),
|
|
fieldtype: "Check",
|
|
default: 0,
|
|
},
|
|
],
|
|
};
|