fix: Unallocated amount for inclusive charges
This commit is contained in:
parent
30f771b26c
commit
4a2e4748ac
@ -436,6 +436,7 @@ class PaymentEntry(AccountsController):
|
|||||||
return
|
return
|
||||||
|
|
||||||
tax_withholding_details.update({
|
tax_withholding_details.update({
|
||||||
|
'add_deduct_tax': 'Add',
|
||||||
'cost_center': self.cost_center or erpnext.get_default_cost_center(self.company)
|
'cost_center': self.cost_center or erpnext.get_default_cost_center(self.company)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -742,16 +743,18 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
payment_or_advance_account = self.get_party_account_for_taxes()
|
payment_or_advance_account = self.get_party_account_for_taxes()
|
||||||
tax_amount = d.tax_amount
|
tax_amount = d.tax_amount
|
||||||
|
base_tax_amount = d.base_tax_amount
|
||||||
|
|
||||||
if self.advance_tax_account:
|
if self.advance_tax_account:
|
||||||
tax_amount = -1* tax_amount
|
tax_amount = -1 * tax_amount
|
||||||
|
base_tax_amount = -1 * base_tax_amount
|
||||||
|
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": d.account_head,
|
"account": d.account_head,
|
||||||
"against": against,
|
"against": against,
|
||||||
dr_or_cr: d.base_tax_amount,
|
dr_or_cr: tax_amount,
|
||||||
dr_or_cr + "_in_account_currency": d.base_tax_amount
|
dr_or_cr + "_in_account_currency": base_tax_amount
|
||||||
if account_currency==self.company_currency
|
if account_currency==self.company_currency
|
||||||
else d.tax_amount,
|
else d.tax_amount,
|
||||||
"cost_center": d.cost_center
|
"cost_center": d.cost_center
|
||||||
@ -763,8 +766,8 @@ class PaymentEntry(AccountsController):
|
|||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": payment_or_advance_account,
|
"account": payment_or_advance_account,
|
||||||
"against": against,
|
"against": against,
|
||||||
dr_or_cr: -1 * d.base_tax_amount,
|
dr_or_cr: -1 * tax_amount,
|
||||||
dr_or_cr + "_in_account_currency": -1*d.base_tax_amount
|
dr_or_cr + "_in_account_currency": -1 * base_tax_amount
|
||||||
if account_currency==self.company_currency
|
if account_currency==self.company_currency
|
||||||
else d.tax_amount,
|
else d.tax_amount,
|
||||||
"cost_center": self.cost_center,
|
"cost_center": self.cost_center,
|
||||||
|
@ -818,11 +818,11 @@ class AccountsController(TransactionBase):
|
|||||||
account_currency = get_account_currency(tax.account_head)
|
account_currency = get_account_currency(tax.account_head)
|
||||||
|
|
||||||
if self.doctype == "Purchase Invoice":
|
if self.doctype == "Purchase Invoice":
|
||||||
dr_or_cr = "credit" if tax.add_deduct_tax == "Add" else "debit"
|
|
||||||
rev_dr_cr = "debit" if tax.add_deduct_tax == "Add" else "credit"
|
|
||||||
else:
|
|
||||||
dr_or_cr = "debit" if tax.add_deduct_tax == "Add" else "credit"
|
dr_or_cr = "debit" if tax.add_deduct_tax == "Add" else "credit"
|
||||||
rev_dr_cr = "credit" if tax.add_deduct_tax == "Add" else "debit"
|
rev_dr_cr = "credit" if tax.add_deduct_tax == "Add" else "debit"
|
||||||
|
else:
|
||||||
|
dr_or_cr = "credit" if tax.add_deduct_tax == "Add" else "debit"
|
||||||
|
rev_dr_cr = "debit" if tax.add_deduct_tax == "Add" else "credit"
|
||||||
|
|
||||||
party = self.supplier if self.doctype == "Purchase Invoice" else self.customer
|
party = self.supplier if self.doctype == "Purchase Invoice" else self.customer
|
||||||
unallocated_amount = tax.tax_amount - tax.allocated_amount
|
unallocated_amount = tax.tax_amount - tax.allocated_amount
|
||||||
|
Loading…
x
Reference in New Issue
Block a user