mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-13 15:27:12 +00:00
Merge pull request #33376 from frappe/mergify/bp/version-14-hotfix/pr-33341
fix: Cost Center for tax withholding invoices (backport #33341)
This commit is contained in:
@@ -121,12 +121,24 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
|
||||
else:
|
||||
tax_row = get_tax_row_for_tcs(inv, tax_details, tax_amount, tax_deducted)
|
||||
|
||||
cost_center = get_cost_center(inv)
|
||||
tax_row.update({"cost_center": cost_center})
|
||||
|
||||
if inv.doctype == "Purchase Invoice":
|
||||
return tax_row, tax_deducted_on_advances, voucher_wise_amount
|
||||
else:
|
||||
return tax_row
|
||||
|
||||
|
||||
def get_cost_center(inv):
|
||||
cost_center = frappe.get_cached_value("Company", inv.company, "cost_center")
|
||||
|
||||
if len(inv.get("taxes", [])) > 0:
|
||||
cost_center = inv.get("taxes")[0].cost_center
|
||||
|
||||
return cost_center
|
||||
|
||||
|
||||
def get_tax_withholding_details(tax_withholding_category, posting_date, company):
|
||||
tax_withholding = frappe.get_doc("Tax Withholding Category", tax_withholding_category)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user