fix: Work order dialog box 'Select Quantity' on clicking 'Finish' (#19136)

The dialog box fetched 0 as Quantity to Manufacture and Max Quantity on finishing a Work Order
This commit is contained in:
Marica 2019-09-30 15:36:33 +05:30 committed by Nabin Hait
parent 8d889ef80e
commit de15cc1387

View File

@ -545,11 +545,14 @@ erpnext.work_order = {
get_max_transferable_qty: (frm, purpose) => {
let max = 0;
if (frm.doc.skip_transfer) return max;
if (purpose === 'Manufacture') {
max = flt(frm.doc.material_transferred_for_manufacturing) - flt(frm.doc.produced_qty);
if (frm.doc.skip_transfer) {
max = flt(frm.doc.qty) - flt(frm.doc.produced_qty);
} else {
max = flt(frm.doc.qty) - flt(frm.doc.material_transferred_for_manufacturing);
if (purpose === 'Manufacture') {
max = flt(frm.doc.material_transferred_for_manufacturing) - flt(frm.doc.produced_qty);
} else {
max = flt(frm.doc.qty) - flt(frm.doc.material_transferred_for_manufacturing);
}
}
return flt(max, precision('qty'));
},