If there anyway to implement a minimum quantity ordered for a given product?
Can this be done in the product profile?
I am using v14.
Maybe it already exists?
Thanks
If there anyway to implement a minimum quantity ordered for a given product?
Can this be done in the product profile?
I am using v14.
Maybe it already exists?
Thanks
Hi @smokinjo:
Tried with different UOM like Box? For example, define UOM Box for your Item with 20 units as conversion factor. Customize your Sales Order doctype to set UOM and total quantity as read_only, so this way users just can choose number of “boxes” … so, never less than 20 units … Wrong part is that quantities as 25 are not possible …
Other simple approach would be using a custom field (custom_min_qty) for Items and a simple client script for Sales Order, where we will check.
frappe.ui.form.on('Sales Order Item', {
qty: (frm, cdt, cdn) => {
let row = locals[cdt][cdn]
frappe.db.get_value("Item", row.item_code, "custom_min_qty").then(r => {
let min = r.message.custom_min_qty || 0
if (row.qty < min && min > 0) {
frappe.model.set_value(cdt, cdn, 'qty', 0)
frappe.throw("Min qty not reached.")
}
})
}
})
Hope this helps.
There should be a way to set the default uom in sales and purchase at the item master. Set up conversion factors and that should do it.