Address filter in gstr1 report (#14290)
This commit is contained in:
parent
f3a6d95634
commit
c55f774fbf
@ -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"),
|
||||
|
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user