fix: Patch incorrect GST category in invoices (#20084)
* fix: Patch to set GST category for unregistered invoice * fix: Move patch up in line
This commit is contained in:
parent
4d806033af
commit
467dba1954
@ -586,6 +586,7 @@ erpnext.patches.v11_0.add_permissions_in_gst_settings
|
||||
erpnext.patches.v11_1.setup_guardian_role
|
||||
execute:frappe.delete_doc('DocType', 'Notification Control')
|
||||
erpnext.patches.v12_0.set_gst_category
|
||||
erpnext.patches.v12_0.update_gst_category
|
||||
erpnext.patches.v11_0.remove_barcodes_field_from_copy_fields_to_variants
|
||||
erpnext.patches.v12_0.set_task_status
|
||||
erpnext.patches.v11_0.make_italian_localization_fields # 26-03-2019
|
||||
|
19
erpnext/patches/v12_0/update_gst_category.py
Normal file
19
erpnext/patches/v12_0/update_gst_category.py
Normal file
@ -0,0 +1,19 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
|
||||
company = frappe.get_all('Company', filters = {'country': 'India'})
|
||||
if not company:
|
||||
return
|
||||
|
||||
frappe.db.sql(""" UPDATE `tabSales Invoice` set gst_category = 'Unregistered'
|
||||
where gst_category = 'Registered Regular'
|
||||
and ifnull(customer_gstin, '')=''
|
||||
and ifnull(billing_address_gstin,'')=''
|
||||
""")
|
||||
|
||||
frappe.db.sql(""" UPDATE `tabPurchase Invoice` set gst_category = 'Unregistered'
|
||||
where gst_category = 'Registered Regular'
|
||||
and ifnull(supplier_gstin, '')=''
|
||||
""")
|
Loading…
x
Reference in New Issue
Block a user