mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
Removed default taxes and charges from customer and supplier master. Added patch to create tax rules against customer/supplier
This commit is contained in:
committed by
Saurabh
parent
810bd35609
commit
1a2d121073
27
erpnext/patches/v5_8/tax_rule.py
Normal file
27
erpnext/patches/v5_8/tax_rule.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
customers = frappe.db.sql("""select name, default_taxes_and_charges from tabCustomer where
|
||||
ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
|
||||
|
||||
for d in customers:
|
||||
tr = frappe.new_doc("Tax Rule")
|
||||
tr.tax_type = "Sales"
|
||||
tr.customer = d.name
|
||||
tr.sales_tax_template = d.default_taxes_and_charges
|
||||
tr.save()
|
||||
|
||||
|
||||
suppliers = frappe.db.sql("""select name, default_taxes_and_charges from tabSupplier where
|
||||
ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
|
||||
|
||||
for d in suppliers:
|
||||
tr = frappe.new_doc("Tax Rule")
|
||||
tr.tax_type = "Purchase"
|
||||
tr.supplier = d.name
|
||||
tr.purchase_tax_template = d.default_taxes_and_charges
|
||||
tr.save()
|
||||
Reference in New Issue
Block a user