fix(labelprocessing): some strange lot issues to catch
This commit is contained in:
@@ -62,7 +62,7 @@ export const labelingProcess = async ({
|
||||
(l: any) => l.MachineID === macId[0]?.HumanReadableId
|
||||
);
|
||||
|
||||
if (filteredLot.length === 0) {
|
||||
if (filteredLot?.length === 0) {
|
||||
createLog(
|
||||
"error",
|
||||
"labeling",
|
||||
@@ -85,7 +85,7 @@ export const labelingProcess = async ({
|
||||
(l: any) => l.MachineID === macId[0]?.HumanReadableId
|
||||
);
|
||||
|
||||
if (!filteredLot || filteredLot.length === 0) {
|
||||
if (!filteredLot || filteredLot?.length === 0) {
|
||||
createLog(
|
||||
"error",
|
||||
"labeling",
|
||||
@@ -138,7 +138,7 @@ export const labelingProcess = async ({
|
||||
let dualPrinting = settingData.filter((d) => d.name === "dualPrinting")[0]
|
||||
?.value;
|
||||
|
||||
if (filteredLot.length > 1 && dualPrinting === "0") {
|
||||
if (filteredLot?.length > 1 && dualPrinting === "0") {
|
||||
createLog(
|
||||
"error",
|
||||
"labeling",
|
||||
@@ -151,7 +151,7 @@ export const labelingProcess = async ({
|
||||
};
|
||||
}
|
||||
|
||||
if (filteredLot.length > 1 && dualPrinting === "1") {
|
||||
if (filteredLot?.length > 1 && dualPrinting === "1") {
|
||||
// send over for dual printing processing
|
||||
createLog(
|
||||
"info",
|
||||
@@ -193,7 +193,7 @@ export const labelingProcess = async ({
|
||||
}
|
||||
|
||||
// check if we actaully have a lot passed over so we do not error out again.
|
||||
if (filteredLot.length === 0) {
|
||||
if (filteredLot?.length === 0) {
|
||||
createLog(
|
||||
"error",
|
||||
"labeling",
|
||||
@@ -234,8 +234,8 @@ export const labelingProcess = async ({
|
||||
|
||||
// do we want to over run
|
||||
if (
|
||||
filteredLot[0].overPrinting === "no" &&
|
||||
filteredLot[0].Remaining <= 0
|
||||
filteredLot[0]?.overPrinting === "no" &&
|
||||
filteredLot[0]?.Remaining <= 0
|
||||
) {
|
||||
createLog(
|
||||
"error",
|
||||
|
||||
Reference in New Issue
Block a user