fix(ocme): cycle count typos
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
import type {User} from "../../../types/users.js";
|
||||
import {alplaStockInv} from "./cycleCount/alplaStockInventory.js";
|
||||
import {emptyCount} from "./cycleCount/emptyCycleCount.js";
|
||||
import {fullLaneCount} from "./cycleCount/fullLaneCycleCount.js";
|
||||
import {ocmeInv} from "./cycleCount/ocmeInventory.js";
|
||||
import type { User } from "../../../types/users.js";
|
||||
import { alplaStockInv } from "./cycleCount/alplaStockInventory.js";
|
||||
import { emptyCount } from "./cycleCount/emptyCycleCount.js";
|
||||
import { fullLaneCount } from "./cycleCount/fullLaneCycleCount.js";
|
||||
import { ocmeInv } from "./cycleCount/ocmeInventory.js";
|
||||
|
||||
export const prepareLane = "https://usday1prod.alpla.net/application/public/v1.1/Warehousing/PrepareLaneForInventory";
|
||||
export const openLane = "https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryOpen";
|
||||
export const closeLane = "https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryClose";
|
||||
export const releaseLane = "https://usday1prod.alpla.net/application/public/v1.1/Warehousing/ReleaseLaneFromInventory";
|
||||
export const prepareLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.1/Warehousing/PrepareLaneForInventory";
|
||||
export const openLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryOpen";
|
||||
export const closeLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryClose";
|
||||
export const releaseLane =
|
||||
"https://usday1prod.alpla.net/application/public/v1.1/Warehousing/ReleaseLaneFromInventory";
|
||||
export const scannerID = 500;
|
||||
export const cycleCount = async (lane: any, user: User) => {
|
||||
/**
|
||||
@@ -24,29 +28,39 @@ export const cycleCount = async (lane: any, user: User) => {
|
||||
// create a new array that has the merge happen.
|
||||
const mergeOcmeData = ocme.map((d: any) => {
|
||||
// check if its in the ocme array we add it
|
||||
const inStock = alplaStock.filter((r: any) => r.runningNumber === d.runningNumber);
|
||||
const inStock = alplaStock.filter(
|
||||
(r: any) => r.runningNumber === d.runningNumber
|
||||
);
|
||||
//console.log(inStock);
|
||||
if (inStock.length != 0) {
|
||||
//console.log(`${d.runningNumber} is good`);
|
||||
return {...d, ocme: "Yes", stock: "Yes", info: "Good"};
|
||||
return { ...d, ocme: "Yes", stock: "Yes", info: "Good" };
|
||||
} else {
|
||||
//console.log(`${d.runningNumber} is bad`);
|
||||
return {...d, ocme: "Yes", stock: "No", info: "Quality Check Required"};
|
||||
return {
|
||||
...d,
|
||||
ocme: "Yes",
|
||||
stock: "No",
|
||||
info: "Validate pallet is ok. ",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const mergeStockData = alplaStock
|
||||
.filter((r: any) => !ocme.some((d: any) => d.runningNumber === r.runningNumber))
|
||||
.map((r: any) => {
|
||||
return {
|
||||
...r,
|
||||
ocme_laneLevelID: "",
|
||||
sscc: "",
|
||||
ocme: "No",
|
||||
stock: "Yes",
|
||||
info: "Sent to Inv",
|
||||
};
|
||||
});
|
||||
.filter(
|
||||
(r: any) =>
|
||||
!ocme.some((d: any) => d.runningNumber === r.runningNumber)
|
||||
)
|
||||
.map((r: any) => {
|
||||
return {
|
||||
...r,
|
||||
ocme_laneLevelID: "",
|
||||
sscc: "",
|
||||
ocme: "No",
|
||||
stock: "Yes",
|
||||
info: "Sent to Inv",
|
||||
};
|
||||
});
|
||||
|
||||
const combineBoth = [...mergeOcmeData, ...mergeStockData];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user