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