fix(Quotation): calculate row values for alternative items (#43054)

This commit is contained in:
Raffael Meyer
2024-10-03 21:33:58 +01:00
committed by GitHub
parent 4912288433
commit 9872645d3e
3 changed files with 47 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ class calculate_taxes_and_totals:
return items
def calculate(self):
if not len(self._items):
if not len(self.doc.items):
return
self.discount_amount_applied = False
@@ -96,7 +96,7 @@ class calculate_taxes_and_totals:
if self.doc.get("is_return") and self.doc.get("return_against"):
return
for item in self._items:
for item in self.doc.items:
if item.item_code and item.get("item_tax_template"):
item_doc = frappe.get_cached_doc("Item", item.item_code)
args = {
@@ -155,7 +155,7 @@ class calculate_taxes_and_totals:
return
if not self.discount_amount_applied:
for item in self._items:
for item in self.doc.items:
self.doc.round_floats_in(item)
if item.discount_percentage == 100:
@@ -259,7 +259,7 @@ class calculate_taxes_and_totals:
if not any(cint(tax.included_in_print_rate) for tax in self.doc.get("taxes")):
return
for item in self._items:
for item in self.doc.items:
item_tax_map = self._load_item_tax_rate(item.item_tax_rate)
cumulated_tax_fraction = 0
total_inclusive_tax_amount_per_qty = 0