fix(patch): gst state number in address where number is less than 10

This commit is contained in:
Nabin Hait 2018-09-07 16:14:44 +05:30
parent 431e2e1c6d
commit 562d942a7d
6 changed files with 14 additions and 30 deletions

View File

@ -434,7 +434,7 @@ erpnext.patches.v8_5.update_customer_group_in_POS_profile
erpnext.patches.v8_6.update_timesheet_company_from_PO
erpnext.patches.v8_6.set_write_permission_for_quotation_for_sales_manager
erpnext.patches.v8_5.remove_project_type_property_setter
erpnext.patches.v8_7.add_more_gst_fields #21-09-2017
erpnext.patches.v8_7.sync_india_custom_fields
erpnext.patches.v8_7.fix_purchase_receipt_status
erpnext.patches.v8_6.rename_bom_update_tool
erpnext.patches.v8_7.set_offline_in_pos_settings #11-09-17
@ -486,10 +486,8 @@ erpnext.patches.v10_0.update_reserved_qty_for_purchase_order
erpnext.patches.v10_0.fichier_des_ecritures_comptables_for_france
erpnext.patches.v10_0.update_assessment_plan
erpnext.patches.v10_0.update_assessment_result
erpnext.patches.v10_0.added_extra_gst_custom_field
erpnext.patches.v10_0.set_default_payment_terms_based_on_company
erpnext.patches.v10_0.update_sales_order_link_to_purchase_order
erpnext.patches.v10_0.added_extra_gst_custom_field_in_gstr2 #2018-02-13
erpnext.patches.v10_0.item_barcode_childtable_migrate
erpnext.patches.v10_0.rename_price_to_rate_in_pricing_rule
erpnext.patches.v10_0.set_currency_in_pricing_rule

View File

@ -1,12 +0,0 @@
import frappe
from erpnext.regional.india.setup import make_custom_fields
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration")
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission")
make_custom_fields(update=False)

View File

@ -3,6 +3,7 @@
from __future__ import unicode_literals
import frappe
from erpnext.manufacturing.doctype.work_order.work_order import create_job_card
def execute():
frappe.reload_doc('manufacturing', 'doctype', 'work_order')
@ -14,5 +15,6 @@ def execute():
where (work_order is not null and work_order != '') and docstatus = 0""", as_dict=1):
if d.work_order:
doc = frappe.get_doc('Work Order', d.work_order)
doc.create_job_card()
for row in doc.operations:
create_job_card(doc, row, auto_create=True)
frappe.delete_doc('Timesheet', d.name)

View File

@ -1,11 +0,0 @@
import frappe
from erpnext.regional.india.setup import make_custom_fields
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration')
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission')
make_custom_fields()

View File

@ -6,11 +6,14 @@ def execute():
if not company:
return
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration')
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission')
for doctype in ["Sales Invoice", "Delivery Note", "Purchase Invoice"]:
frappe.db.sql("""delete from `tabCustom Field` where dt = %s
and fieldname in ('port_code', 'shipping_bill_number', 'shipping_bill_date')""", doctype)
make_custom_fields(update=False)
make_custom_fields()
frappe.db.sql("""
update `tabCustom Field`
@ -18,4 +21,8 @@ def execute():
where fieldname = 'reason_for_issuing_document'
""")
frappe.db.sql("""
update tabAddress
set gst_state_number=concat("0", gst_state_number)
where ifnull(gst_state_number, '') != '' and gst_state_number<10
""")

View File

@ -171,7 +171,7 @@ def make_custom_fields(update=True):
dict(fieldname='gst_state', label='GST State', fieldtype='Select',
options='\n'.join(states), insert_after='gstin'),
dict(fieldname='gst_state_number', label='GST State Number',
fieldtype='Int', insert_after='gst_state', read_only=1),
fieldtype='Data', insert_after='gst_state', read_only=1),
],
'Purchase Invoice': invoice_gst_fields + purchase_invoice_gst_fields,
'Sales Invoice': invoice_gst_fields + sales_invoice_gst_fields,