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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user