brotherton-erpnext/erpnext/patches/v8_1/gst_fixes.py
Nabin Hait 852cb64e4f GST tax invoice print format and more (#9616)
* GST Tax Invoice print format and more. Fixes #9545 #9566 #9608

* Reload gst print format only for Indian users

* Fixes as Codacy
2017-07-05 12:58:19 +05:30

27 lines
951 B
Python

import frappe
def execute():
frappe.db.sql("""update `tabCustom Field` set label = 'HSN/SAC Code'
where fieldname='gst_hsn_code' and label='GST HSN Code'
""")
frappe.db.sql("""update `tabCustom Field` set print_hide = 1
where fieldname in ('customer_gstin', 'supplier_gstin', 'company_gstin')
""")
frappe.db.sql("""update `tabCustom Field` set insert_after = 'address_display'
where fieldname in ('customer_gstin', 'supplier_gstin')
""")
frappe.db.sql("""update `tabCustom Field` set insert_after = 'company_address_display'
where fieldname = 'company_gstin'
""")
frappe.db.sql("""update `tabCustom Field` set insert_after = 'description'
where fieldname='gst_hsn_code' and dt in ('Sales Invoice Item', 'Purchase Invoice Item')
""")
# reload gst print format for Indian users
company = frappe.get_all('Company', filters = {'country': 'India'})
if company:
frappe.reload_doc("regional", "print_format", "gst_tax_invoice")