diff --git a/erpnext/regional/report/gstr_1/gstr_1.js b/erpnext/regional/report/gstr_1/gstr_1.js index 3a635277e4..b2c8aed6e3 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.js +++ b/erpnext/regional/report/gstr_1/gstr_1.js @@ -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"), diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 2c128e73ae..690fbbcb3a 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -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]