mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-30 20:18:27 +00:00
fix: Material Consumption option in case of Skip Transfer to WIP in WO
(cherry picked from commit 8ea6983734)
This commit is contained in:
@@ -589,13 +589,10 @@ erpnext.work_order = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!frm.doc.skip_transfer){
|
if (frm.doc.status != 'Stopped') {
|
||||||
// If "Material Consumption is check in Manufacturing Settings, allow Material Consumption
|
// If "Material Consumption is check in Manufacturing Settings, allow Material Consumption
|
||||||
if (flt(doc.material_transferred_for_manufacturing) > 0 && frm.doc.status != 'Stopped') {
|
|
||||||
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))) {
|
|
||||||
frm.has_finish_btn = true;
|
|
||||||
|
|
||||||
if (frm.doc.__onload && frm.doc.__onload.material_consumption == 1) {
|
if (frm.doc.__onload && frm.doc.__onload.material_consumption == 1) {
|
||||||
|
if (flt(doc.material_transferred_for_manufacturing) > 0 || frm.doc.skip_transfer) {
|
||||||
// Only show "Material Consumption" when required_qty > consumed_qty
|
// Only show "Material Consumption" when required_qty > consumed_qty
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
var tbl = frm.doc.required_items || [];
|
var tbl = frm.doc.required_items || [];
|
||||||
@@ -614,6 +611,12 @@ erpnext.work_order = {
|
|||||||
consumption_btn.addClass('btn-primary');
|
consumption_btn.addClass('btn-primary');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!frm.doc.skip_transfer){
|
||||||
|
if (flt(doc.material_transferred_for_manufacturing) > 0) {
|
||||||
|
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))) {
|
||||||
|
frm.has_finish_btn = true;
|
||||||
|
|
||||||
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
||||||
erpnext.work_order.make_se(frm, 'Manufacture');
|
erpnext.work_order.make_se(frm, 'Manufacture');
|
||||||
@@ -640,7 +643,7 @@ erpnext.work_order = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
if ((flt(doc.produced_qty) < flt(doc.qty))) {
|
||||||
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
var finish_btn = frm.add_custom_button(__('Finish'), function() {
|
||||||
erpnext.work_order.make_se(frm, 'Manufacture');
|
erpnext.work_order.make_se(frm, 'Manufacture');
|
||||||
});
|
});
|
||||||
@@ -648,7 +651,7 @@ erpnext.work_order = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
calculate_cost: function(doc) {
|
calculate_cost: function(doc) {
|
||||||
if (doc.operations){
|
if (doc.operations){
|
||||||
|
|||||||
Reference in New Issue
Block a user