fix: sales return not working for bundle items

This commit is contained in:
Rohit Waghchaure 2019-04-06 17:34:40 +05:30
parent 4873875c1c
commit 3771db92b8

View File

@ -239,6 +239,10 @@ def make_return_doc(doctype, source_name, target_doc=None):
doc.paid_amount = -1 * source.paid_amount
doc.base_paid_amount = -1 * source.base_paid_amount
if doc.get("is_return") and hasattr(doc, "packed_items"):
for d in doc.get("packed_items"):
d.qty = d.qty * -1
doc.discount_amount = -1 * source.discount_amount
doc.run_method("calculate_taxes_and_totals")