mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 05:04:52 +01:00
fix: re-calculate taxes and totals after resetting bundle item rate (#53342)
This commit is contained in:
@@ -354,11 +354,19 @@ def update_product_bundle_rate(parent_items_price, pi_row, item_row):
|
||||
|
||||
def set_product_bundle_rate_amount(doc, parent_items_price):
|
||||
"Set cumulative rate and amount in bundle item."
|
||||
rate_updated = False
|
||||
for item in doc.get("items"):
|
||||
bundle_rate = parent_items_price.get((item.item_code, item.name))
|
||||
if bundle_rate and bundle_rate != item.rate:
|
||||
item.rate = bundle_rate
|
||||
item.amount = flt(bundle_rate * item.qty)
|
||||
item.margin_rate_or_amount = 0
|
||||
item.discount_percentage = 0
|
||||
item.discount_amount = 0
|
||||
rate_updated = True
|
||||
if rate_updated:
|
||||
doc.calculate_taxes_and_totals()
|
||||
doc.set_total_in_words()
|
||||
|
||||
|
||||
def on_doctype_update():
|
||||
|
||||
Reference in New Issue
Block a user