fix: use user defined discount amount or default

(cherry picked from commit e2a32b7257)
This commit is contained in:
Sanket322
2025-01-20 18:01:31 +05:30
committed by Mergify
parent 4d2352af00
commit 914f4bffea
2 changed files with 5 additions and 3 deletions

View File

@@ -328,8 +328,8 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
"parent": args.parent,
"parenttype": args.parenttype,
"child_docname": args.get("child_docname"),
"discount_percentage": 0.0,
"discount_amount": 0,
"discount_percentage": args.get("discount_percentage") or 0.0,
"discount_amount": args.get("discount_amount") or 0.0,
}
)

View File

@@ -1527,7 +1527,9 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
"serial_no": d.serial_no,
"batch_no": d.batch_no,
"price_list_rate": d.price_list_rate,
"conversion_factor": d.conversion_factor || 1.0
"conversion_factor": d.conversion_factor || 1.0,
"discount_percentage" : d.discount_percentage,
"discount_amount" : d.discount_amount,
});
// if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list