mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 11:55:11 +00:00
feat: consider process less when calculating pending qty in work order
(cherry picked from commit 74c4ca68e5)
This commit is contained in:
@@ -419,7 +419,7 @@ frappe.ui.form.on("Work Order", {
|
|||||||
frm.doc.material_transferred_for_manufacturing -
|
frm.doc.material_transferred_for_manufacturing -
|
||||||
frm.doc.produced_qty -
|
frm.doc.produced_qty -
|
||||||
frm.doc.process_loss_qty;
|
frm.doc.process_loss_qty;
|
||||||
if (pending_complete) {
|
if (pending_complete > 0) {
|
||||||
var width = (pending_complete / frm.doc.qty) * 100 - added_min;
|
var width = (pending_complete / frm.doc.qty) * 100 - added_min;
|
||||||
title = __("{0} items in progress", [pending_complete]);
|
title = __("{0} items in progress", [pending_complete]);
|
||||||
bars.push({
|
bars.push({
|
||||||
@@ -829,6 +829,19 @@ erpnext.work_order = {
|
|||||||
description: __("Max: {0}", [max]),
|
description: __("Max: {0}", [max]),
|
||||||
default: max,
|
default: max,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldtype: "Check",
|
||||||
|
label: __("Consider Process Loss"),
|
||||||
|
fieldname: "consider_process_loss",
|
||||||
|
default: 0,
|
||||||
|
onchange: function () {
|
||||||
|
if (this.value) {
|
||||||
|
frm.qty_prompt.set_value("qty", max - frm.doc.process_loss_qty);
|
||||||
|
} else {
|
||||||
|
frm.qty_prompt.set_value("qty", max);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (purpose === "Disassemble") {
|
if (purpose === "Disassemble") {
|
||||||
@@ -850,7 +863,7 @@ erpnext.work_order = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
frappe.prompt(
|
frm.qty_prompt = frappe.prompt(
|
||||||
fields,
|
fields,
|
||||||
(data) => {
|
(data) => {
|
||||||
max += (frm.doc.qty * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;
|
max += (frm.doc.qty * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;
|
||||||
|
|||||||
Reference in New Issue
Block a user