fix(India): Add GST state code for Ladakh
This commit is contained in:
parent
b1997da488
commit
3248da9089
@ -751,3 +751,4 @@ erpnext.patches.v13_0.convert_qi_parameter_to_link_field
|
|||||||
erpnext.patches.v13_0.setup_patient_history_settings_for_standard_doctypes
|
erpnext.patches.v13_0.setup_patient_history_settings_for_standard_doctypes
|
||||||
erpnext.patches.v13_0.add_naming_series_to_old_projects # 1-02-2021
|
erpnext.patches.v13_0.add_naming_series_to_old_projects # 1-02-2021
|
||||||
erpnext.patches.v13_0.item_reposting_for_incorrect_sl_and_gl
|
erpnext.patches.v13_0.item_reposting_for_incorrect_sl_and_gl
|
||||||
|
erpnext.patches.v12_0.add_state_code_for_ladakh
|
||||||
|
16
erpnext/patches/v12_0/add_state_code_for_ladakh.py
Normal file
16
erpnext/patches/v12_0/add_state_code_for_ladakh.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import frappe
|
||||||
|
from erpnext.regional.india import states
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
|
||||||
|
company = frappe.get_all('Company', filters = {'country': 'India'})
|
||||||
|
if not company:
|
||||||
|
return
|
||||||
|
|
||||||
|
custom_fields = ['Address-gst_state', 'Tax Category-gst_state']
|
||||||
|
|
||||||
|
# Update options in gst_state custom fields
|
||||||
|
for field in custom_fields:
|
||||||
|
gst_state_field = frappe.get_doc('Custom Field', field)
|
||||||
|
gst_state_field.options = '\n'.join(states)
|
||||||
|
gst_state_field.save()
|
@ -20,6 +20,7 @@ states = [
|
|||||||
'Jharkhand',
|
'Jharkhand',
|
||||||
'Karnataka',
|
'Karnataka',
|
||||||
'Kerala',
|
'Kerala',
|
||||||
|
'Ladakh',
|
||||||
'Lakshadweep Islands',
|
'Lakshadweep Islands',
|
||||||
'Madhya Pradesh',
|
'Madhya Pradesh',
|
||||||
'Maharashtra',
|
'Maharashtra',
|
||||||
@ -59,6 +60,7 @@ state_numbers = {
|
|||||||
"Jharkhand": "20",
|
"Jharkhand": "20",
|
||||||
"Karnataka": "29",
|
"Karnataka": "29",
|
||||||
"Kerala": "32",
|
"Kerala": "32",
|
||||||
|
"Ladakh": "38",
|
||||||
"Lakshadweep Islands": "31",
|
"Lakshadweep Islands": "31",
|
||||||
"Madhya Pradesh": "23",
|
"Madhya Pradesh": "23",
|
||||||
"Maharashtra": "27",
|
"Maharashtra": "27",
|
||||||
|
@ -168,5 +168,10 @@
|
|||||||
"state_number": "37",
|
"state_number": "37",
|
||||||
"state_code": "AD",
|
"state_code": "AD",
|
||||||
"state_name": "Andhra Pradesh (New)"
|
"state_name": "Andhra Pradesh (New)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"state_number": "38",
|
||||||
|
"state_code": "LA",
|
||||||
|
"state_name": "Ladakh"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user