fix: Allocate advance taxes only for payment entry

This commit is contained in:
Deepesh Garg
2021-05-17 20:58:50 +05:30
parent 25b3507809
commit e6be20a94d
3 changed files with 76 additions and 73 deletions

View File

@@ -903,6 +903,7 @@ class PurchaseInvoice(BuyingController):
def allocate_advance_taxes(self, gl_entries):
tax_map = self.get_tax_map()
for pe in self.get('advances'):
if pe.reference_type == 'Payment Entry':
pe = frappe.get_doc('Payment Entry', pe.reference_name)
for tax in pe.get('taxes'):
account_currency = get_account_currency(tax.account_head)

View File

@@ -900,6 +900,7 @@ class SalesInvoice(SellingController):
def allocate_advance_taxes(self, gl_entries):
tax_map = self.get_tax_map()
for pe in self.get('advances'):
if pe.reference_type == 'Payment Entry':
pe = frappe.get_doc('Payment Entry', pe.reference_name)
for tax in pe.get('taxes'):
account_currency = get_account_currency(tax.account_head)

View File

@@ -721,6 +721,7 @@ class AccountsController(TransactionBase):
tax_map = self.get_tax_map()
for pe in self.get('advances'):
if pe.reference_type == 'Payment Entry':
pe = frappe.get_doc('Payment Entry', pe.reference_name)
for tax in pe.get('taxes'):
allocated_amount = tax_map.get(tax.account_head) - allocated_tax_map.get(tax.account_head)