fix: Allocate advance taxes only for payment entry
This commit is contained in:
@@ -903,6 +903,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
def allocate_advance_taxes(self, gl_entries):
|
def allocate_advance_taxes(self, gl_entries):
|
||||||
tax_map = self.get_tax_map()
|
tax_map = self.get_tax_map()
|
||||||
for pe in self.get('advances'):
|
for pe in self.get('advances'):
|
||||||
|
if pe.reference_type == 'Payment Entry':
|
||||||
pe = frappe.get_doc('Payment Entry', pe.reference_name)
|
pe = frappe.get_doc('Payment Entry', pe.reference_name)
|
||||||
for tax in pe.get('taxes'):
|
for tax in pe.get('taxes'):
|
||||||
account_currency = get_account_currency(tax.account_head)
|
account_currency = get_account_currency(tax.account_head)
|
||||||
|
|||||||
@@ -916,6 +916,7 @@ class SalesInvoice(SellingController):
|
|||||||
def allocate_advance_taxes(self, gl_entries):
|
def allocate_advance_taxes(self, gl_entries):
|
||||||
tax_map = self.get_tax_map()
|
tax_map = self.get_tax_map()
|
||||||
for pe in self.get('advances'):
|
for pe in self.get('advances'):
|
||||||
|
if pe.reference_type == 'Payment Entry':
|
||||||
pe = frappe.get_doc('Payment Entry', pe.reference_name)
|
pe = frappe.get_doc('Payment Entry', pe.reference_name)
|
||||||
for tax in pe.get('taxes'):
|
for tax in pe.get('taxes'):
|
||||||
account_currency = get_account_currency(tax.account_head)
|
account_currency = get_account_currency(tax.account_head)
|
||||||
|
|||||||
@@ -726,6 +726,7 @@ class AccountsController(TransactionBase):
|
|||||||
tax_map = self.get_tax_map()
|
tax_map = self.get_tax_map()
|
||||||
|
|
||||||
for pe in self.get('advances'):
|
for pe in self.get('advances'):
|
||||||
|
if pe.reference_type == 'Payment Entry':
|
||||||
pe = frappe.get_doc('Payment Entry', pe.reference_name)
|
pe = frappe.get_doc('Payment Entry', pe.reference_name)
|
||||||
for tax in pe.get('taxes'):
|
for tax in pe.get('taxes'):
|
||||||
allocated_amount = tax_map.get(tax.account_head) - allocated_tax_map.get(tax.account_head)
|
allocated_amount = tax_map.get(tax.account_head) - allocated_tax_map.get(tax.account_head)
|
||||||
|
|||||||
Reference in New Issue
Block a user