mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Address filter in gstr1 report (#14290)
This commit is contained in:
@@ -11,6 +11,21 @@ frappe.query_reports["GSTR-1"] = {
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"default": frappe.defaults.get_user_default("Company")
|
"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",
|
"fieldname":"from_date",
|
||||||
"label": __("From Date"),
|
"label": __("From Date"),
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ class Gstr1Report(object):
|
|||||||
|
|
||||||
for opts in (("company", " and company=%(company)s"),
|
for opts in (("company", " and company=%(company)s"),
|
||||||
("from_date", " and posting_date>=%(from_date)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]):
|
if self.filters.get(opts[0]):
|
||||||
conditions += opts[1]
|
conditions += opts[1]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user