[Add] GSTIN filters in hsn wise summary and itemised reports

This commit is contained in:
Prasann Shah
2019-06-06 12:08:09 +05:30
parent 6179130a54
commit 829172c267
6 changed files with 87 additions and 7 deletions

View File

@@ -261,3 +261,19 @@ def calculate_hra_exemption_for_period(doc):
exemptions["monthly_house_rent"] = monthly_rent
exemptions["total_eligible_hra_exemption"] = eligible_hra
return exemptions
@frappe.whitelist()
def get_gstins_for_company(company):
company_gstins =[]
if company:
company_gstins = frappe.db.sql("""select
distinct `tabAddress`.gstin
from
`tabAddress`, `tabDynamic Link`
where
`tabDynamic Link`.parent = `tabAddress`.name and
`tabDynamic Link`.parenttype = 'Address' and
`tabDynamic Link`.link_doctype = 'Company' and
`tabDynamic Link`.link_name = '{0}'""".format(company))
return company_gstins