mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-23 00:28:30 +00:00
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",
|
input_class: "input-xs",
|
||||||
onchange: function () {
|
onchange: function () {
|
||||||
this.value = flt(this.value);
|
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(
|
frappe.model.set_value(
|
||||||
frm.doc.doctype,
|
frm.doc.doctype,
|
||||||
frm.doc.name,
|
frm.doc.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user