mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
refactor: fetch rate once tax category is set
This commit is contained in:
@@ -63,16 +63,14 @@ def get_result(
|
|||||||
tax_amount += entry.credit - entry.debit
|
tax_amount += entry.credit - entry.debit
|
||||||
# infer tax withholding category from the account if it's the single account for this category
|
# infer tax withholding category from the account if it's the single account for this category
|
||||||
tax_withholding_category = tds_accounts.get(entry.account)
|
tax_withholding_category = tds_accounts.get(entry.account)
|
||||||
rate = tax_rate_map.get(tax_withholding_category)
|
|
||||||
# or else the consolidated value from the voucher document
|
# or else the consolidated value from the voucher document
|
||||||
if not tax_withholding_category:
|
if not tax_withholding_category:
|
||||||
# or else from the party default
|
|
||||||
tax_withholding_category = tax_category_map.get(name)
|
tax_withholding_category = tax_category_map.get(name)
|
||||||
rate = tax_rate_map.get(tax_withholding_category)
|
# or else from the party default
|
||||||
if not tax_withholding_category:
|
if not tax_withholding_category:
|
||||||
tax_withholding_category = party_map.get(party, {}).get("tax_withholding_category")
|
tax_withholding_category = party_map.get(party, {}).get("tax_withholding_category")
|
||||||
rate = tax_rate_map.get(tax_withholding_category)
|
|
||||||
|
|
||||||
|
rate = tax_rate_map.get(tax_withholding_category)
|
||||||
if net_total_map.get(name):
|
if net_total_map.get(name):
|
||||||
if voucher_type == "Journal Entry" and tax_amount and rate:
|
if voucher_type == "Journal Entry" and tax_amount and rate:
|
||||||
# back calcalute total amount from rate and tax_amount
|
# back calcalute total amount from rate and tax_amount
|
||||||
|
|||||||
Reference in New Issue
Block a user