brotherton-erpnext/erpnext/patches/v8_7/sync_india_custom_fields.py
Anurag Mishra 289c82243f
feat: New Payroll module (#21990)
* feat: Moved Document to Payroll Module

* feat: Moved Reports to Payroll Module

* feat: Moved Print fromat With Patch

* feat: Moved Notifiction to Payroll Module and patches

* feat: added dashboard and desk page to Payroll

* feat: Payroll Dashboard

* feat: Module onboarding

* feat: Income tax Deductions Report

* feat: Ecs Checklist Report

* feat: Provident Fund Report

* feat: Professional Fund report and commonified Code

* feat: Total Payments Based On Payment Mode Report

* fix: refactor and added chart Total Payments Based On Payment Mode

* feat: Payroll Settings

* fix: Bank remittance Report

* feat(Payroll based on): Considered unmarked days

* feat: Added Help for condition an formula in Salary structure

* fix: requested changes

* fix: rename report Ecs checklist to salary_payments_via_ecs

* fix: renamed report report/total_payments_based_on_payment_mode

* fix: added role via setup.py for regional report

* feat: added All reports to desk page

* fix: frappe.reload doc in all patches

* fix: codacy

* fix: frappe.reload_doctype for patches

* patch: is_income_tax_component and component_type for salary component

* fix: uncommented code

* test: fixture

* fix: test

* test: test_payment_days_based_on_attendance
2020-06-19 19:17:57 +05:30

35 lines
1.2 KiB
Python

from __future__ import unicode_literals
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('Payroll', 'doctype', 'payroll_period')
frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_declaration')
frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_proof_submission')
frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_declaration_category')
frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_proof_submission_detail')
frappe.reload_doc('accounts', 'doctype', 'tax_category')
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()
frappe.db.sql("""
update `tabCustom Field`
set reqd = 0, `default` = ''
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
""")