Skip to content

Commit

Permalink
fix: use user defined discount amount or 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket322 committed Jan 20, 2025
1 parent 5fb158a commit 16352d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions erpnext/accounts/doctype/pricing_rule/pricing_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,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,
}
)

Expand Down Expand Up @@ -513,6 +513,8 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
rate=args.get("price_list_rate"),
)

print(item_details)

return item_details


Expand Down
4 changes: 3 additions & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,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
Expand Down

0 comments on commit 16352d3

Please sign in to comment.