fix: Item Rate within Update Items in Sales order (#19172)
Blocked negative discount percentage, which affected the item rate every time Update Items action was taken
This commit is contained in:
parent
132323462c
commit
23d7b09389
@ -1195,8 +1195,10 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
|
||||
child_item.rate = flt(d.get("rate"))
|
||||
|
||||
if flt(child_item.price_list_rate):
|
||||
child_item.discount_percentage = flt((1 - flt(child_item.rate) / flt(child_item.price_list_rate)) * 100.0, \
|
||||
discount = flt((1 - flt(child_item.rate) / flt(child_item.price_list_rate)) * 100.0,
|
||||
child_item.precision("discount_percentage"))
|
||||
if discount > 0:
|
||||
child_item.discount_percentage = discount
|
||||
|
||||
child_item.flags.ignore_validate_update_after_submit = True
|
||||
if new_child_flag:
|
||||
@ -1220,7 +1222,6 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
|
||||
parent.update_status_updater()
|
||||
else:
|
||||
parent.check_credit_limit()
|
||||
|
||||
parent.save()
|
||||
|
||||
if parent_doctype == 'Purchase Order':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user