fix: limit discount value to 100 in pos cart (backport #44916) (#44932)

fix: limit discount value to 100 in pos cart (#44916)

* fix: limit discount value to 100 in pos cart

* fix: error message on invalid discount

(cherry picked from commit ac26622d6e)

Co-authored-by: Diptanil Saha <50792171+diptanilsaha@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2024-12-30 14:00:08 +05:30
committed by GitHub
parent cc827c8077
commit 28442f3414

View File

@@ -390,6 +390,14 @@ erpnext.PointOfSale.ItemCart = class {
input_class: "input-xs",
onchange: function () {
this.value = flt(this.value);
if (this.value > 100) {
frappe.msgprint({
title: __("Invalid Discount"),
indicator: "red",
message: __("Discount cannot be greater than 100%."),
});
this.value = 0;
}
frappe.model.set_value(
frm.doc.doctype,
frm.doc.name,