brotherton-erpnext/erpnext/regional/report/gstr_1/gstr_1.js
Faris Ansari 9e874af9ba Query report print (#14935)
* QueryReport

- Only print visible columns in report
- Use get_columns_for_print method instead of directly
accessing report.columns

* Query Report

- Replace frappe.query_report_filters_by_name with new API
2018-07-18 09:28:44 +05:30

54 lines
1.3 KiB
JavaScript

// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["GSTR-1"] = {
"filters": [
{
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"reqd": 1,
"default": frappe.defaults.get_user_default("Company")
},
{
"fieldname":"company_address",
"label": __("Address"),
"fieldtype": "Link",
"options": "Address",
"get_query": function() {
var company = frappe.query_report.get_filter_value('company');
if (company) {
return {
"query": 'frappe.contacts.doctype.address.address.address_query',
"filters": { link_doctype: 'Company', link_name: company}
};
}
}
},
{
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
"reqd": 1,
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -3),
"width": "80"
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
"reqd": 1,
"default": frappe.datetime.get_today()
},
{
"fieldname":"type_of_business",
"label": __("Type of Business"),
"fieldtype": "Select",
"reqd": 1,
"options": ["B2B", "B2C Large", "B2C Small","CDNR", "EXPORT"],
"default": "B2B"
}
]
}