mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 11:25:09 +00:00
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com> fix: validate if quantity greater than 0 in item dashboard (#53846)
This commit is contained in:
@@ -281,8 +281,13 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, stoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
dialog.set_primary_action(__("Create Stock Entry"), function () {
|
dialog.set_primary_action(__("Create Stock Entry"), function () {
|
||||||
if (source && (dialog.get_value("qty") == 0 || dialog.get_value("qty") > actual_qty)) {
|
if (flt(dialog.get_value("qty")) <= 0) {
|
||||||
frappe.msgprint(__("Quantity must be greater than zero, and less or equal to {0}", [actual_qty]));
|
frappe.msgprint(__("Quantity must be greater than zero"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source && dialog.get_value("qty") > actual_qty) {
|
||||||
|
frappe.msgprint(__("Quantity must be less than or equal to {0}", [actual_qty]));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user