Address filter in gstr1 report (#14290)

This commit is contained in:
Shreya Shah 2018-05-31 09:33:36 +05:30 committed by Nabin Hait
parent f3a6d95634
commit c55f774fbf
2 changed files with 17 additions and 1 deletions

View File

@ -11,6 +11,21 @@ frappe.query_reports["GSTR-1"] = {
"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_filters_by_name.company.get_value();
if (company) {
return {
"query": 'frappe.contacts.doctype.address.address.address_query',
"filters": { link_doctype: 'Company', link_name: company}
};
}
}
},
{
"fieldname":"from_date",
"label": __("From Date"),

View File

@ -102,7 +102,8 @@ class Gstr1Report(object):
for opts in (("company", " and company=%(company)s"),
("from_date", " and posting_date>=%(from_date)s"),
("to_date", " and posting_date<=%(to_date)s")):
("to_date", " and posting_date<=%(to_date)s"),
("company_address", " and company_address=%(company_address)s")):
if self.filters.get(opts[0]):
conditions += opts[1]