Merge pull request #44761 from aerele/pos_discount

fix: apply discount on qty change
This commit is contained in:
ruthra kumar
2024-12-30 14:56:02 +05:30
committed by GitHub

View File

@@ -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);
}