From 3c204122cd423ad47aeea926d35afffe67635a3a Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 16 May 2018 14:03:41 +0530 Subject: [PATCH] [fix] calculate withholding only on invoice --- .../doctype/payment_entry/payment_entry.py | 15 --- .../purchase_invoice/purchase_invoice.json | 2 +- .../purchase_invoice/purchase_invoice.py | 4 - .../tax_withholding_category.json | 95 +------------------ 4 files changed, 2 insertions(+), 114 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 8539c36c43..41ae0cd050 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -43,7 +43,6 @@ class PaymentEntry(AccountsController): def validate(self): self.setup_party_account_field() - self.set_tax_withholding() self.set_missing_values() self.validate_payment_type() self.validate_party_details() @@ -511,20 +510,6 @@ class PaymentEntry(AccountsController): def on_recurring(self, reference_doc, auto_repeat_doc): self.reference_no = reference_doc.name self.reference_date = nowdate() - - def set_tax_withholding(self): - if self.party_type != 'Supplier': - return - - self.supplier = self.party - tax_withholding_details = get_patry_tax_withholding_details(self) - - for tax_details in tax_withholding_details: - if self.deductions: - if tax_details['tax']['account_head'] not in [deduction.account for deduction in self.deductions]: - self.append('deductions', self.calculate_deductions(tax_details)) - else: - self.append('deductions', self.calculate_deductions(tax_details)) def calculate_deductions(self, tax_details): return { diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index a8fa9f7529..cf40728121 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -4231,7 +4231,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-04-19 15:48:29.457594", + "modified": "2018-05-16 15:48:29.457594", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 61b6edf864..2788a82619 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -751,10 +751,6 @@ class PurchaseInvoice(BuyingController): self.db_set('release_date', None) def set_tax_withholding(self): - """ - 1. Get TDS Configurations against Supplier - """ - tax_withholding_details = get_patry_tax_withholding_details(self) for tax_details in tax_withholding_details: if flt(self.get("rounded_total") or self.grand_total) >= flt(tax_details['threshold']): diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.json b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.json index a590776e68..8edaf0187e 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.json +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.json @@ -13,68 +13,6 @@ "editable_grid": 1, "engine": "InnoDB", "fields": [ - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "is_default", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Default", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "enabled", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Enabled", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -198,37 +136,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "book_on_advance", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Book on Advance", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -333,7 +240,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-05-11 14:25:07.474461", + "modified": "2018-05-16 13:57:52.489773", "modified_by": "Administrator", "module": "Accounts", "name": "Tax Withholding Category",