Compare commits
6 Commits
eb0a5d6311
...
b74a197778
| Author | SHA1 | Date | |
|---|---|---|---|
| b74a197778 | |||
| 2bc9e88588 | |||
| 63b59fe5ac | |||
| 3dc14e4097 | |||
| 9bee452446 | |||
| 67ded802bf |
@@ -3,11 +3,24 @@ import { useSettingStore } from "@/lib/store/useSettings";
|
||||
|
||||
export default function DMButtons() {
|
||||
const { settings } = useSettingStore();
|
||||
|
||||
const testServers = ["test1", "test2", "test3"];
|
||||
const plantToken = settings.filter((n) => n.name === "plantToken");
|
||||
//console.log(plantToken);
|
||||
return (
|
||||
<div className="flex flex-row-reverse gap-1">
|
||||
{/* dev and testserver sees all */}
|
||||
{testServers.includes(plantToken[0]?.value) && (
|
||||
<div className="flex flex-row gap-2">
|
||||
<OrderImport
|
||||
fileType={"abbott"}
|
||||
name={"Abbott truck list"}
|
||||
/>
|
||||
<OrderImport
|
||||
fileType={"energizer"}
|
||||
name={"Energizer Truck List"}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{plantToken[0]?.value === "usday1" && (
|
||||
<div className="flex flex-row gap-2">
|
||||
<OrderImport
|
||||
@@ -20,6 +33,12 @@ export default function DMButtons() {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{plantToken[0]?.value === "usflo1" && (
|
||||
<div className="flex flex-row gap-2"></div>
|
||||
)}
|
||||
{plantToken[0]?.value === "usstp1" && (
|
||||
<div className="flex flex-row gap-2"></div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,12 @@ export default function OcmeCycleCount() {
|
||||
formState: { errors },
|
||||
reset,
|
||||
control,
|
||||
} = useForm();
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
lane: "",
|
||||
laneType: "name",
|
||||
},
|
||||
});
|
||||
|
||||
const onSubmit = async (data: any) => {
|
||||
setData([]);
|
||||
@@ -99,7 +104,6 @@ export default function OcmeCycleCount() {
|
||||
<Controller
|
||||
control={control}
|
||||
name="laneType"
|
||||
defaultValue={""}
|
||||
render={({
|
||||
field: { onChange },
|
||||
fieldState: {},
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
},
|
||||
"admConfig": {
|
||||
"build": 303,
|
||||
"build": 305,
|
||||
"oldBuild": "backend-0.1.3.zip"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -90,6 +90,7 @@ export const abbottOrders = async (data: any, user: any) => {
|
||||
orders: [],
|
||||
};
|
||||
const oOrders: any = openOrders;
|
||||
|
||||
let correctedOrders: any = orderData
|
||||
.filter(
|
||||
(o: any) =>
|
||||
@@ -121,12 +122,29 @@ export const abbottOrders = async (data: any, user: any) => {
|
||||
});
|
||||
|
||||
// last map to remove orders that have already been started
|
||||
correctedOrders = correctedOrders.filter((oo: any) =>
|
||||
oOrders.some((o: any) => o.CustomerOrderNumber === oo.po)
|
||||
);
|
||||
// correctedOrders = correctedOrders.filter((oo: any) =>
|
||||
// oOrders.some((o: any) => o.CustomerOrderNumber === oo.po)
|
||||
// );
|
||||
let postedOrders: any = [];
|
||||
const filterOrders: any = correctedOrders;
|
||||
filterOrders.forEach((oo: any) => {
|
||||
const isMatch = openOrders.some(
|
||||
(o: any) =>
|
||||
String(o.CustomerOrderNumber).trim() ===
|
||||
String(oo.CustomerOrderNumber).trim()
|
||||
);
|
||||
if (!isMatch) {
|
||||
console.log(`ok to update: ${oo.CustomerOrderNumber}`);
|
||||
|
||||
postedOrders.push(oo);
|
||||
} else {
|
||||
console.log(`Not valid order to update: ${oo.CustomerOrderNumber}`);
|
||||
//console.log(oo)
|
||||
}
|
||||
});
|
||||
|
||||
// Map Excel data to predefinedObject format
|
||||
const orders = correctedOrders.map((o: any) => {
|
||||
const orders = filterOrders.map((o: any) => {
|
||||
return {
|
||||
customerId: customerID,
|
||||
invoiceAddressId: invoiceID,
|
||||
|
||||
@@ -30,7 +30,7 @@ app.openapi(
|
||||
// "Provided a running number and lot number you can consume material.",
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
async (c: any) => {
|
||||
//apiHit(c, { endpoint: "api/sqlProd/close" });
|
||||
|
||||
const { data: ppoo, error } = await tryCatch(getPPOO());
|
||||
|
||||
@@ -20,7 +20,7 @@ app.openapi(
|
||||
// "Creates a silo adjustment for the silo if and stores the stock numbers.",
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
async (c: any) => {
|
||||
//apiHit(c, { endpoint: "api/sqlProd/close" });
|
||||
|
||||
try {
|
||||
@@ -29,9 +29,9 @@ app.openapi(
|
||||
const silo = await getStockSiloData();
|
||||
return c.json(
|
||||
{
|
||||
success: silo.success,
|
||||
message: silo.message,
|
||||
data: silo.data,
|
||||
success: silo?.success ?? false,
|
||||
message: silo?.message ?? "Failed to get silo data",
|
||||
data: silo?.data ?? [],
|
||||
},
|
||||
200
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user