Conflicts: erpnext/accounts/page/accounts_browser/accounts_browser.css erpnext/controllers/buying_controller.py erpnext/manufacturing/doctype/production_order/production_order.py erpnext/patches/patch_list.py erpnext/selling/doctype/customer/customer.txt erpnext/selling/doctype/sales_order/sales_order.py erpnext/selling/doctype/sales_order/test_sales_order.py erpnext/setup/doctype/features_setup/features_setup.txt erpnext/stock/doctype/stock_entry/test_stock_entry.py erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py startup/query_handlers.py
42 lines
1.6 KiB
Python
42 lines
1.6 KiB
Python
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
def execute():
|
|
import webnotes
|
|
from webnotes.model.code import get_obj
|
|
from webnotes.model.doc import addchild
|
|
|
|
# delete doctypes and tables
|
|
for dt in ["TDS Payment", "TDS Return Acknowledgement", "Form 16A",
|
|
"TDS Rate Chart", "TDS Category", "TDS Control", "TDS Detail",
|
|
"TDS Payment Detail", "TDS Rate Detail", "TDS Category Account",
|
|
"Form 16A Ack Detail", "Form 16A Tax Detail"]:
|
|
webnotes.delete_doc("DocType", dt)
|
|
|
|
webnotes.conn.commit()
|
|
webnotes.conn.sql("drop table if exists `tab%s`" % dt)
|
|
webnotes.conn.begin()
|
|
|
|
# Add tds entry in tax table for purchase invoice
|
|
pi_list = webnotes.conn.sql("""select name from `tabPurchase Invoice`
|
|
where ifnull(tax_code, '')!='' and ifnull(ded_amount, 0)!=0""")
|
|
for pi in pi_list:
|
|
piobj = get_obj("Purchase Invoice", pi[0], with_children=1)
|
|
ch = addchild(piobj.doc, 'taxes_and_charges', 'Purchase Taxes and Charges')
|
|
ch.charge_type = "Actual"
|
|
ch.account_head = piobj.doc.tax_code
|
|
ch.description = piobj.doc.tax_code
|
|
ch.rate = -1*piobj.doc.ded_amount
|
|
ch.tax_amount = -1*piobj.doc.ded_amount
|
|
ch.category = "Total"
|
|
ch.save(1)
|
|
|
|
# Add tds entry in entries table for journal voucher
|
|
jv_list = webnotes.conn.sql("""select name from `tabJournal Voucher`
|
|
where ifnull(tax_code, '')!='' and ifnull(ded_amount, 0)!=0""")
|
|
for jv in jv_list:
|
|
jvobj = get_obj("Journal Voucher", jv[0], with_children=1)
|
|
ch = addchild(jvobj.doc, 'entries', 'Journal Voucher Detail')
|
|
ch.account = jvobj.doc.tax_code
|
|
ch.credit = jvobj.doc.ded_amount
|
|
ch.save(1) |