Item qty based tax (CESS) calculation support (#15456)
* fix conflicts
* added test case for qty cess
* use company specified in document to get region
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 6985c80..684e239 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -270,6 +270,8 @@
elif tax.charge_type == "On Previous Row Total":
current_tax_amount = (tax_rate / 100.0) * \
self.doc.get("taxes")[cint(tax.row_id) - 1].grand_total_for_current_item
+ elif tax.charge_type == "On Item Quantity":
+ current_tax_amount = tax_rate * item.stock_qty
self.set_item_wise_tax(item, tax, tax_rate, current_tax_amount)
@@ -646,4 +648,4 @@
# Rounding based on tax_amount precision
for taxes in itemised_tax.values():
for tax_account in taxes:
- taxes[tax_account]["tax_amount"] = flt(taxes[tax_account]["tax_amount"], precision)
\ No newline at end of file
+ taxes[tax_account]["tax_amount"] = flt(taxes[tax_account]["tax_amount"], precision)