fix(main material check): corrections to properly ignore pkg during color checks

This commit is contained in:
2025-09-01 11:08:16 -05:00
parent 1f8b8a7248
commit 6910550de7

View File

@@ -64,7 +64,7 @@ export const isMainMatStaged = async (lot: any) => {
const mainMateiral = res.filter((n: any) => n.IsMainMaterial);
if (mainMateiral[0]?.noMaterialShortage === "no") {
if (mainMateiral[0]?.noMaterialShortage === "noMM") {
isStaged = {
message: `Main material: ${mainMateiral[0].MaterialHumanReadableId} - ${mainMateiral[0].MaterialDescription}: is not staged for ${lot.lot} `,
success: false,
@@ -77,7 +77,11 @@ export const isMainMatStaged = async (lot: any) => {
if (checkColorSetting[0].value === "1") {
const autoConsumeColor = res.filter(
(n: any) => !n.IsMainMaterial && !n.isManual
(n: any) =>
!n.IsMainMaterial &&
!n.isManual &&
n.noPKGShortage !== "pkgGood" &&
n.noPKGShortage !== "noPkg"
);
if (
autoConsumeColor.some(
@@ -100,7 +104,11 @@ export const isMainMatStaged = async (lot: any) => {
// // for manual consume color
const manualConsumeColor = res.filter(
(n: any) => !n.IsMainMaterial && n.isManual
(n: any) =>
!n.IsMainMaterial &&
n.isManual &&
n.noPKGShortage !== "pkgGood" &&
n.noPKGShortage !== "noPkg"
);
if (
manualConsumeColor.some(