Skip to content

Commit

Permalink
fix: apply discount on qty change
Browse files Browse the repository at this point in the history
(cherry picked from commit 352b82b)
  • Loading branch information
DHINESH00 authored and mergify[bot] committed Dec 30, 2024
1 parent 28442f3 commit c19725c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions erpnext/selling/page/point_of_sale/pos_item_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,12 @@ erpnext.PointOfSale.ItemDetails = class {
frappe.model.on("POS Invoice Item", "*", (fieldname, value, item_row) => {
const field_control = this[`${fieldname}_control`];
const item_row_is_being_edited = this.compare_with_current_item(item_row);

if (item_row_is_being_edited && field_control && field_control.get_value() !== value) {
if (
item_row_is_being_edited &&
field_control &&
field_control.get_value() !== value &&
value == item_row[fieldname]
) {
field_control.set_value(value);
cur_pos.update_cart_html(item_row);
}
Expand Down

0 comments on commit c19725c

Please sign in to comment.