mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 23:22:52 +00:00
feat: item wise tds calculation
This commit is contained in:
@@ -67,13 +67,15 @@ class calculate_taxes_and_totals(object):
|
||||
|
||||
def calculate_tax_withholding_net_total(self):
|
||||
if hasattr(self.doc, "tax_withholding_net_total"):
|
||||
|
||||
sum_net_amount = 0
|
||||
sum_base_net_amount = 0
|
||||
for item in self.doc.get("items"):
|
||||
if hasattr(item, "apply_tds") and item.apply_tds:
|
||||
sum_net_amount += item.net_amount
|
||||
|
||||
sum_base_net_amount += item.base_net_amount
|
||||
|
||||
self.doc.tax_withholding_net_total = sum_net_amount
|
||||
self.doc.base_tax_withholding_net_total = sum_base_net_amount
|
||||
|
||||
def validate_item_tax_template(self):
|
||||
for item in self.doc.get("items"):
|
||||
@@ -1076,4 +1078,4 @@ class init_landed_taxes_and_totals(object):
|
||||
def set_amounts_in_company_currency(self):
|
||||
for d in self.doc.get(self.tax_field):
|
||||
d.amount = flt(d.amount, d.precision("amount"))
|
||||
d.base_amount = flt(d.amount * flt(d.exchange_rate), d.precision("base_amount"))
|
||||
d.base_amount = flt(d.amount * flt(d.exchange_rate), d.precision("base_amount"))
|
||||
Reference in New Issue
Block a user