feat: Added filters and columns for inactive items report

This commit is contained in:
deepeshgarg007 2019-04-16 17:07:13 +05:30
parent bc02ee23e0
commit 508e815db0
4 changed files with 130 additions and 0 deletions

View File

@ -0,0 +1,39 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Inactive Items"] = {
"filters": [
{
fieldname: "territory",
label: __("Territory"),
fieldtype: "Link",
options: "Territory"
},
{
fieldname: "customer",
label: __("Customer"),
fieldtype: "Link",
options: "Customer"
},
{
fieldname: "item",
label: __("Item"),
fieldtype: "Link",
options: "Item"
},
{
fieldname: "item_group",
label: __("Item Group"),
fieldtype: "Link",
options: "Item Group"
},
{
fieldname: "days",
label: __("Days Since Last order"),
fieldtype: "Select",
options: [30, 60, 90],
default: 30
},
]
}

View File

@ -0,0 +1,31 @@
{
"add_total_row": 0,
"creation": "2019-04-16 16:05:00.647308",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"letter_head": "Test Letter Head 1",
"modified": "2019-04-16 16:06:33.630043",
"modified_by": "Administrator",
"module": "Stock",
"name": "Inactive Items",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Sales Invoice",
"report_name": "Inactive Items",
"report_type": "Script Report",
"roles": [
{
"role": "Accounts User"
},
{
"role": "Accounts Manager"
},
{
"role": "Auditor"
}
]
}

View File

@ -0,0 +1,60 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
def execute(filters=None):
columns, data = [], []
return columns, data
def get_columns():
columns = [
{
"fieldname": "territory",
"fieldtype": "Link",
"label": _("Territory"),
"options": "Territory",
"width": 100
},
{
"fieldname": "item_group",
"fieldtype": "Link",
"label": _("Item Group"),
"options": "Item Group",
"width": 100
},
{
"fieldname": "item",
"fieldtype": "Link",
"label": _("Item"),
"options": "Item",
"width": 100
},
{
"fieldname": "customer",
"fieldtype": "Link",
"label": _("Customer"),
"options": "Customer",
"width": 100
},
{
"fieldname": "last_order_date",
"fieldtype": "Date",
"label": _("Last Order Date"),
"width": 100
},
{
"fieldname": "qty",
"fieldtype": "Float",
"label": _("Quantity"),
"width": 100
},
{
"fieldname": "days_since_last_order",
"fieldtype": "Int",
"label": _("Days Since Last Order"),
"width": 100
},
]