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
This commit is contained in:
Diptanil Saha
2024-12-26 18:15:53 +05:30
committed by GitHub
parent 1319ce4bc1
commit ac26622d6e

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,