2015-03-03 14:55:30 +05:30
|
|
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
|
2014-10-10 18:02:23 +05:30
|
|
|
// For license information, please see license.txt
|
2013-08-05 14:59:54 +05:30
|
|
|
|
2014-10-10 18:02:23 +05:30
|
|
|
frappe.query_reports["Stock Balance"] = {
|
2013-06-05 11:36:24 +05:30
|
|
|
"filters": [
|
2020-05-01 00:01:37 +05:30
|
|
|
{
|
|
|
|
"fieldname": "company",
|
|
|
|
"label": __("Company"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"width": "80",
|
|
|
|
"options": "Company",
|
|
|
|
"default": frappe.defaults.get_default("company")
|
|
|
|
},
|
2013-06-05 11:36:24 +05:30
|
|
|
{
|
|
|
|
"fieldname":"from_date",
|
2014-04-14 16:25:30 +05:30
|
|
|
"label": __("From Date"),
|
2013-06-05 11:36:24 +05:30
|
|
|
"fieldtype": "Date",
|
|
|
|
"width": "80",
|
2016-11-16 11:16:44 +05:30
|
|
|
"reqd": 1,
|
2018-04-12 13:25:03 +05:30
|
|
|
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
2013-06-05 11:36:24 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"to_date",
|
2014-04-14 16:25:30 +05:30
|
|
|
"label": __("To Date"),
|
2013-06-05 11:36:24 +05:30
|
|
|
"fieldtype": "Date",
|
|
|
|
"width": "80",
|
2016-11-16 11:16:44 +05:30
|
|
|
"reqd": 1,
|
2014-02-14 15:47:51 +05:30
|
|
|
"default": frappe.datetime.get_today()
|
2015-02-18 19:51:48 +05:30
|
|
|
},
|
2018-06-20 14:11:29 +02:00
|
|
|
{
|
2020-04-30 13:56:49 +05:30
|
|
|
"fieldname": "item_group",
|
|
|
|
"label": __("Item Group"),
|
2018-06-20 14:11:29 +02:00
|
|
|
"fieldtype": "Link",
|
2020-04-30 13:56:49 +05:30
|
|
|
"width": "80",
|
|
|
|
"options": "Item Group"
|
2018-06-20 14:11:29 +02:00
|
|
|
},
|
2015-02-18 19:51:48 +05:30
|
|
|
{
|
|
|
|
"fieldname": "item_code",
|
|
|
|
"label": __("Item"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"width": "80",
|
2018-04-12 13:25:03 +05:30
|
|
|
"options": "Item",
|
|
|
|
"get_query": function() {
|
|
|
|
return {
|
2019-06-12 19:09:51 +05:30
|
|
|
query: "erpnext.controllers.queries.item_query",
|
2019-09-16 19:57:04 +05:30
|
|
|
};
|
2018-04-12 13:25:03 +05:30
|
|
|
}
|
2016-03-07 13:11:59 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname": "warehouse",
|
|
|
|
"label": __("Warehouse"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"width": "80",
|
2019-05-22 11:29:01 +05:30
|
|
|
"options": "Warehouse",
|
|
|
|
get_query: () => {
|
|
|
|
var warehouse_type = frappe.query_report.get_filter_value('warehouse_type');
|
2019-05-23 14:31:22 +05:30
|
|
|
if(warehouse_type){
|
|
|
|
return {
|
|
|
|
filters: {
|
|
|
|
'warehouse_type': warehouse_type
|
|
|
|
}
|
2019-09-16 19:57:04 +05:30
|
|
|
};
|
2019-05-22 11:29:01 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname": "warehouse_type",
|
|
|
|
"label": __("Warehouse Type"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"width": "80",
|
|
|
|
"options": "Warehouse Type"
|
2016-03-07 13:11:59 +05:30
|
|
|
},
|
2018-10-18 17:29:47 +05:00
|
|
|
{
|
|
|
|
"fieldname":"include_uom",
|
|
|
|
"label": __("Include UOM"),
|
|
|
|
"fieldtype": "Link",
|
|
|
|
"options": "UOM"
|
|
|
|
},
|
2017-10-22 22:58:44 +01:00
|
|
|
{
|
2017-11-15 14:43:06 +05:30
|
|
|
"fieldname": "show_variant_attributes",
|
|
|
|
"label": __("Show Variant Attributes"),
|
2017-10-22 22:58:44 +01:00
|
|
|
"fieldtype": "Check"
|
|
|
|
},
|
2019-09-16 19:57:04 +05:30
|
|
|
{
|
|
|
|
"fieldname": 'show_stock_ageing_data',
|
|
|
|
"label": __('Show Stock Ageing Data'),
|
|
|
|
"fieldtype": 'Check'
|
|
|
|
},
|
2020-04-30 13:56:49 +05:30
|
|
|
],
|
|
|
|
|
|
|
|
"formatter": function (value, row, column, data, default_formatter) {
|
|
|
|
value = default_formatter(value, row, column, data);
|
|
|
|
|
|
|
|
if (column.fieldname == "out_qty" && data && data.out_qty > 0) {
|
|
|
|
value = "<span style='color:red'>" + value + "</span>";
|
|
|
|
}
|
|
|
|
else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
|
|
|
|
value = "<span style='color:green'>" + value + "</span>";
|
|
|
|
}
|
|
|
|
|
|
|
|
return value;
|
|
|
|
}
|
2019-09-16 19:57:04 +05:30
|
|
|
};
|