brotherton-erpnext/erpnext/stock/report/stock_balance/stock_balance.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

111 lines
2.6 KiB
JavaScript
Raw Normal View History

// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
// For license information, please see license.txt
frappe.query_reports["Stock Balance"] = {
2013-06-05 06:06:24 +00:00
"filters": [
2020-04-30 18:31:37 +00:00
{
"fieldname": "company",
"label": __("Company"),
"fieldtype": "Link",
"width": "80",
"options": "Company",
"default": frappe.defaults.get_default("company")
},
2013-06-05 06:06:24 +00:00
{
"fieldname":"from_date",
2014-04-14 10:55:30 +00:00
"label": __("From Date"),
2013-06-05 06:06:24 +00:00
"fieldtype": "Date",
"width": "80",
"reqd": 1,
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
2013-06-05 06:06:24 +00:00
},
{
"fieldname":"to_date",
2014-04-14 10:55:30 +00:00
"label": __("To Date"),
2013-06-05 06:06:24 +00:00
"fieldtype": "Date",
"width": "80",
"reqd": 1,
2014-02-14 10:17:51 +00:00
"default": frappe.datetime.get_today()
},
{
"fieldname": "item_group",
"label": __("Item Group"),
"fieldtype": "Link",
"width": "80",
"options": "Item Group"
},
{
"fieldname": "item_code",
"label": __("Item"),
"fieldtype": "Link",
"width": "80",
"options": "Item",
"get_query": function() {
return {
query: "erpnext.controllers.queries.item_query",
};
}
},
{
"fieldname": "warehouse",
"label": __("Warehouse"),
"fieldtype": "Link",
"width": "80",
2019-05-22 05:59:01 +00:00
"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}
}
2019-05-22 05:59:01 +00:00
}
}
},
{
"fieldname": "warehouse_type",
"label": __("Warehouse Type"),
"fieldtype": "Link",
"width": "80",
"options": "Warehouse Type"
},
{
"fieldname":"include_uom",
"label": __("Include UOM"),
"fieldtype": "Link",
"options": "UOM"
},
{
"fieldname": "show_variant_attributes",
"label": __("Show Variant Attributes"),
"fieldtype": "Check"
},
{
"fieldname": 'show_stock_ageing_data',
"label": __('Show Stock Ageing Data'),
"fieldtype": 'Check'
},
2023-05-17 18:22:03 +00:00
{
"fieldname": 'ignore_closing_balance',
"label": __('Ignore Closing Balance'),
"fieldtype": 'Check'
},
],
"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;
}
};
2022-06-22 06:54:08 +00:00
erpnext.utils.add_inventory_dimensions('Stock Balance', 8);