diff --git a/app/src/internal/admin/controller/systemAdminRole.ts b/app/src/internal/admin/controller/systemAdminRole.ts
index e58867a..51c1b9f 100644
--- a/app/src/internal/admin/controller/systemAdminRole.ts
+++ b/app/src/internal/admin/controller/systemAdminRole.ts
@@ -4,72 +4,77 @@ import { createLogger } from "../../../pkg/logger/logger.js";
import { tryCatch } from "../../../pkg/utils/tryCatch.js";
export const systemAdminRole = async (userId: string) => {
- const log = createLogger({
- module: "admin",
- subModule: "systemAdminSetup",
- });
- const systemAdminRoles = [
- {
- userId: userId,
- module: "users",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "admin",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "ocp",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "siloAdjustments",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "demandManagement",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "logistics",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "production",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "quality",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "eom",
- role: "systemAdmin",
- },
- {
- userId: userId,
- module: "forklifts",
- role: "systemAdmin",
- },
- ];
- const { data, error } = await tryCatch(
- db.insert(userRoles).values(systemAdminRoles).onConflictDoNothing()
- );
+ const log = createLogger({
+ module: "admin",
+ subModule: "systemAdminSetup",
+ });
+ const systemAdminRoles = [
+ {
+ userId: userId,
+ module: "users",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "admin",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "ocp",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "siloAdjustments",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "demandManagement",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "logistics",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "production",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "quality",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "eom",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "forklifts",
+ role: "systemAdmin",
+ },
+ {
+ userId: userId,
+ module: "helperCommands",
+ role: "systemAdmin",
+ },
+ ];
+ const { data, error } = await tryCatch(
+ db.insert(userRoles).values(systemAdminRoles).onConflictDoNothing(),
+ );
- if (error) {
- log.error(
- { stack: { error: error } },
- "There was an error creating the system admin roles"
- );
- }
+ if (error) {
+ log.error(
+ { stack: { error: error } },
+ "There was an error creating the system admin roles",
+ );
+ }
- log.info({ data }, "New system admin roles created");
+ log.info({ data }, "New system admin roles created");
};
diff --git a/app/src/internal/admin/routes/grantRole.ts b/app/src/internal/admin/routes/grantRole.ts
index 797082c..67e6d21 100644
--- a/app/src/internal/admin/routes/grantRole.ts
+++ b/app/src/internal/admin/routes/grantRole.ts
@@ -14,6 +14,7 @@ const roleSchema = z.object({
"siloAdjustments",
"demandManagement",
"logistics",
+ "helperCommands",
"production",
"quality",
"eom",
diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts
index 0bec7d4..d1b588b 100644
--- a/frontend/src/routeTree.gen.ts
+++ b/frontend/src/routeTree.gen.ts
@@ -36,6 +36,7 @@ import { Route as AppAdminLayoutAdminUsersRouteRouteImport } from './routes/_app
import { Route as OldOldocmeCyclecountIndexRouteImport } from './routes/_old/old/(ocme)/cyclecount/index'
import { Route as OldOldlogisticsSiloAdjustmentsIndexRouteImport } from './routes/_old/old/(logistics)/siloAdjustments/index'
import { Route as OldOldlogisticsMaterialHelperIndexRouteImport } from './routes/_old/old/(logistics)/materialHelper/index'
+import { Route as OldOldlogisticsHelperCommandsIndexRouteImport } from './routes/_old/old/(logistics)/helperCommands/index'
import { Route as OldOldlogisticsSiloAdjustmentsHistRouteImport } from './routes/_old/old/(logistics)/siloAdjustments/$hist'
import { Route as AppAdminLayoutAdminUsersUsersRouteImport } from './routes/_app/_adminLayout/admin/_users/users'
import { Route as AppAdminLayoutAdminUsersProdUsersRouteImport } from './routes/_app/_adminLayout/admin/_users/prodUsers'
@@ -184,6 +185,12 @@ const OldOldlogisticsMaterialHelperIndexRoute =
path: '/materialHelper/',
getParentRoute: () => OldOldRouteRoute,
} as any)
+const OldOldlogisticsHelperCommandsIndexRoute =
+ OldOldlogisticsHelperCommandsIndexRouteImport.update({
+ id: '/(logistics)/helperCommands/',
+ path: '/helperCommands/',
+ getParentRoute: () => OldOldRouteRoute,
+ } as any)
const OldOldlogisticsSiloAdjustmentsHistRoute =
OldOldlogisticsSiloAdjustmentsHistRouteImport.update({
id: '/(logistics)/siloAdjustments/$hist',
@@ -238,6 +245,7 @@ export interface FileRoutesByFullPath {
'/admin/prodUsers': typeof AppAdminLayoutAdminUsersProdUsersRoute
'/admin/users': typeof AppAdminLayoutAdminUsersUsersRoute
'/old/siloAdjustments/$hist': typeof OldOldlogisticsSiloAdjustmentsHistRoute
+ '/old/helperCommands': typeof OldOldlogisticsHelperCommandsIndexRoute
'/old/materialHelper': typeof OldOldlogisticsMaterialHelperIndexRoute
'/old/siloAdjustments': typeof OldOldlogisticsSiloAdjustmentsIndexRoute
'/old/cyclecount': typeof OldOldocmeCyclecountIndexRoute
@@ -266,6 +274,7 @@ export interface FileRoutesByTo {
'/admin/prodUsers': typeof AppAdminLayoutAdminUsersProdUsersRoute
'/admin/users': typeof AppAdminLayoutAdminUsersUsersRoute
'/old/siloAdjustments/$hist': typeof OldOldlogisticsSiloAdjustmentsHistRoute
+ '/old/helperCommands': typeof OldOldlogisticsHelperCommandsIndexRoute
'/old/materialHelper': typeof OldOldlogisticsMaterialHelperIndexRoute
'/old/siloAdjustments': typeof OldOldlogisticsSiloAdjustmentsIndexRoute
'/old/cyclecount': typeof OldOldocmeCyclecountIndexRoute
@@ -300,6 +309,7 @@ export interface FileRoutesById {
'/_app/_adminLayout/admin/_users/prodUsers': typeof AppAdminLayoutAdminUsersProdUsersRoute
'/_app/_adminLayout/admin/_users/users': typeof AppAdminLayoutAdminUsersUsersRoute
'/_old/old/(logistics)/siloAdjustments/$hist': typeof OldOldlogisticsSiloAdjustmentsHistRoute
+ '/_old/old/(logistics)/helperCommands/': typeof OldOldlogisticsHelperCommandsIndexRoute
'/_old/old/(logistics)/materialHelper/': typeof OldOldlogisticsMaterialHelperIndexRoute
'/_old/old/(logistics)/siloAdjustments/': typeof OldOldlogisticsSiloAdjustmentsIndexRoute
'/_old/old/(ocme)/cyclecount/': typeof OldOldocmeCyclecountIndexRoute
@@ -331,6 +341,7 @@ export interface FileRouteTypes {
| '/admin/prodUsers'
| '/admin/users'
| '/old/siloAdjustments/$hist'
+ | '/old/helperCommands'
| '/old/materialHelper'
| '/old/siloAdjustments'
| '/old/cyclecount'
@@ -359,6 +370,7 @@ export interface FileRouteTypes {
| '/admin/prodUsers'
| '/admin/users'
| '/old/siloAdjustments/$hist'
+ | '/old/helperCommands'
| '/old/materialHelper'
| '/old/siloAdjustments'
| '/old/cyclecount'
@@ -392,6 +404,7 @@ export interface FileRouteTypes {
| '/_app/_adminLayout/admin/_users/prodUsers'
| '/_app/_adminLayout/admin/_users/users'
| '/_old/old/(logistics)/siloAdjustments/$hist'
+ | '/_old/old/(logistics)/helperCommands/'
| '/_old/old/(logistics)/materialHelper/'
| '/_old/old/(logistics)/siloAdjustments/'
| '/_old/old/(ocme)/cyclecount/'
@@ -589,6 +602,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof OldOldlogisticsMaterialHelperIndexRouteImport
parentRoute: typeof OldOldRouteRoute
}
+ '/_old/old/(logistics)/helperCommands/': {
+ id: '/_old/old/(logistics)/helperCommands/'
+ path: '/helperCommands'
+ fullPath: '/old/helperCommands'
+ preLoaderRoute: typeof OldOldlogisticsHelperCommandsIndexRouteImport
+ parentRoute: typeof OldOldRouteRoute
+ }
'/_old/old/(logistics)/siloAdjustments/$hist': {
id: '/_old/old/(logistics)/siloAdjustments/$hist'
path: '/siloAdjustments/$hist'
@@ -725,6 +745,7 @@ interface OldOldRouteRouteChildren {
OldOldOcpIndexRoute: typeof OldOldOcpIndexRoute
OldOldRfidIndexRoute: typeof OldOldRfidIndexRoute
OldOldlogisticsSiloAdjustmentsHistRoute: typeof OldOldlogisticsSiloAdjustmentsHistRoute
+ OldOldlogisticsHelperCommandsIndexRoute: typeof OldOldlogisticsHelperCommandsIndexRoute
OldOldlogisticsMaterialHelperIndexRoute: typeof OldOldlogisticsMaterialHelperIndexRoute
OldOldlogisticsSiloAdjustmentsIndexRoute: typeof OldOldlogisticsSiloAdjustmentsIndexRoute
OldOldocmeCyclecountIndexRoute: typeof OldOldocmeCyclecountIndexRoute
@@ -738,6 +759,8 @@ const OldOldRouteRouteChildren: OldOldRouteRouteChildren = {
OldOldRfidIndexRoute: OldOldRfidIndexRoute,
OldOldlogisticsSiloAdjustmentsHistRoute:
OldOldlogisticsSiloAdjustmentsHistRoute,
+ OldOldlogisticsHelperCommandsIndexRoute:
+ OldOldlogisticsHelperCommandsIndexRoute,
OldOldlogisticsMaterialHelperIndexRoute:
OldOldlogisticsMaterialHelperIndexRoute,
OldOldlogisticsSiloAdjustmentsIndexRoute:
diff --git a/frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx b/frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx
index 0d4ec5e..9e4bbaf 100644
--- a/frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx
+++ b/frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx
@@ -17,6 +17,7 @@ const modules: string[] = [
"siloAdjustments",
"demandManagement",
"logistics",
+ "helperCommands",
"production",
"quality",
"eom",
diff --git a/frontend/src/routes/_old/old/(logistics)/helperCommands/index.tsx b/frontend/src/routes/_old/old/(logistics)/helperCommands/index.tsx
new file mode 100644
index 0000000..a22bc4c
--- /dev/null
+++ b/frontend/src/routes/_old/old/(logistics)/helperCommands/index.tsx
@@ -0,0 +1,28 @@
+import { createFileRoute } from "@tanstack/react-router";
+import HelperPage from "../../-components/logistics/helperCommands/helperPage";
+
+export const Route = createFileRoute("/_old/old/(logistics)/helperCommands/")({
+ component: RouteComponent,
+ // beforeLoad: async () => {
+ // const auth = localStorage.getItem("auth_token");
+ // if (!auth) {
+ // throw redirect({
+ // to: "/login",
+ // search: {
+ // // Use the current location to power a redirect after login
+ // // (Do not use `router.state.resolvedLocation` as it can
+ // // potentially lag behind the actual current location)
+ // redirect: location.pathname + location.search,
+ // },
+ // });
+ // }
+ // },
+});
+
+function RouteComponent() {
+ return (
+
+
+
+ );
+}
diff --git a/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/Bookin.tsx b/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/Bookin.tsx
new file mode 100644
index 0000000..3760ee0
--- /dev/null
+++ b/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/Bookin.tsx
@@ -0,0 +1,94 @@
+import { useForm } from "@tanstack/react-form";
+import axios from "axios";
+import { useState } from "react";
+import { toast } from "sonner";
+
+import { Button } from "@/components/ui/button";
+import { CardContent, CardHeader } from "@/components/ui/card";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { LstCard } from "../../../extendedUi/LstCard";
+
+export default function Bookin() {
+ const [bookingIn, setBookingIn] = useState(false);
+ const form = useForm({
+ defaultValues: { runningNr: " " },
+ onSubmit: async ({ value }) => {
+ // Do something with form data
+ setBookingIn(true);
+
+ try {
+ const res = await axios.post("/lst/old/api/ocp/bookin", {
+ runningNr: parseInt(value.runningNr),
+ });
+
+ if (res.data.success) {
+ toast.success(res.data.message);
+ form.reset();
+ setBookingIn(false);
+ } else {
+ console.log(res.data.data.errors);
+ toast.error(res.data.data.errors[0]?.message);
+ form.reset();
+ setBookingIn(false);
+ }
+ } catch (error) {
+ console.log(error);
+ toast.error(
+ "There was an error booking in pallet please validate you entered the correct info and try again.",
+ );
+ setBookingIn(false);
+ }
+ },
+ });
+ return (
+
+
+ Book in a pallet by running number
+
+
+
+ );
+}
diff --git a/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/Relocate.tsx b/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/Relocate.tsx
new file mode 100644
index 0000000..f7736d3
--- /dev/null
+++ b/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/Relocate.tsx
@@ -0,0 +1,123 @@
+import { useForm } from "@tanstack/react-form";
+import axios from "axios";
+import { useState } from "react";
+import { toast } from "sonner";
+
+import { Button } from "@/components/ui/button";
+import { CardContent, CardHeader } from "@/components/ui/card";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { LstCard } from "../../../extendedUi/LstCard";
+
+export default function Relocate() {
+ const [bookingIn, setBookingIn] = useState(false);
+ const form = useForm({
+ defaultValues: { runningNr: " ", lane: "" },
+ onSubmit: async ({ value }) => {
+ // Do something with form data
+ setBookingIn(true);
+
+ try {
+ const res = await axios.post("/lst/old/api/ocp/bookin", {
+ runningNr: parseInt(value.runningNr),
+ });
+
+ if (res.data.success) {
+ toast.success(res.data.message);
+ form.reset();
+ setBookingIn(false);
+ } else {
+ console.log(res.data.data.errors);
+ toast.error(res.data.data.errors[0]?.message);
+ form.reset();
+ setBookingIn(false);
+ }
+ } catch (error) {
+ console.log(error);
+ toast.error(
+ "There was an error booking in pallet please validate you entered the correct info and try again.",
+ );
+ setBookingIn(false);
+ }
+ },
+ });
+ return (
+
+
+ Relocate a pallet to another lane
+
+
+
+ );
+}
diff --git a/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/RemoveAsNonReusable.tsx b/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/RemoveAsNonReusable.tsx
new file mode 100644
index 0000000..fa5f36f
--- /dev/null
+++ b/frontend/src/routes/_old/old/-components/logistics/helperCommands/commands/RemoveAsNonReusable.tsx
@@ -0,0 +1,128 @@
+import { useForm } from "@tanstack/react-form";
+import axios from "axios";
+import { useState } from "react";
+import { toast } from "sonner";
+import { Button } from "@/components/ui/button";
+import { CardContent, CardHeader } from "@/components/ui/card";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { Textarea } from "@/components/ui/textarea";
+import { LstCard } from "../../../extendedUi/LstCard";
+
+export default function RemoveAsNonReusable() {
+ const [stockOut, setStockOut] = useState(false);
+ const form = useForm({
+ defaultValues: { runningNr: " ", reason: " " },
+ onSubmit: async ({ value }) => {
+ // Do something with form data
+ setStockOut(true);
+
+ //console.log(value);
+
+ try {
+ const res = await axios.post(
+ "/lst/old/api/logistics/removeasreusable",
+
+ value, // this is basically the data field
+ );
+
+ if (res.data.success) {
+ toast.success(res.data.message);
+ form.reset();
+ setStockOut(false);
+ } else {
+ console.log(res.data);
+ toast.error(res.data?.message);
+ form.reset();
+ setStockOut(false);
+ }
+ } catch (error: any) {
+ console.log(error);
+ toast.error(error.message);
+ setStockOut(false);
+ }
+ },
+ });
+ return (
+
+
+ Remove a pallet as non reusable
+
+
+
+ );
+}
diff --git a/lstV2/frontend/src/components/logistics/helperCommands/helperPage.tsx b/frontend/src/routes/_old/old/-components/logistics/helperCommands/helperPage.tsx
similarity index 100%
rename from lstV2/frontend/src/components/logistics/helperCommands/helperPage.tsx
rename to frontend/src/routes/_old/old/-components/logistics/helperCommands/helperPage.tsx
diff --git a/lstV2/frontend/src/components/logistics/helperCommands/commands/Bookin.tsx b/lstV2/frontend/src/components/logistics/helperCommands/commands/Bookin.tsx
deleted file mode 100644
index ef16deb..0000000
--- a/lstV2/frontend/src/components/logistics/helperCommands/commands/Bookin.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-import { LstCard } from "@/components/extendedUI/LstCard";
-import { Button } from "@/components/ui/button";
-import { CardContent, CardHeader } from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { useForm } from "@tanstack/react-form";
-import axios from "axios";
-import { useState } from "react";
-import { toast } from "sonner";
-
-export default function Bookin() {
- const [bookingIn, setBookingIn] = useState(false);
- const form = useForm({
- defaultValues: { runningNr: " " },
- onSubmit: async ({ value }) => {
- // Do something with form data
- setBookingIn(true);
-
- try {
- const res = await axios.post("/api/ocp/bookin", {
- runningNr: parseInt(value.runningNr),
- });
-
- if (res.data.success) {
- toast.success(res.data.message);
- form.reset();
- setBookingIn(false);
- } else {
- console.log(res.data.data.errors);
- toast.error(res.data.data.errors[0]?.message);
- form.reset();
- setBookingIn(false);
- }
- } catch (error) {
- console.log(error);
- toast.error(
- "There was an error booking in pallet please validate you entered the correct info and try again."
- );
- setBookingIn(false);
- }
- },
- });
- return (
-
-
- Book in a pallet by running number
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/components/logistics/helperCommands/commands/Relocate.tsx b/lstV2/frontend/src/components/logistics/helperCommands/commands/Relocate.tsx
deleted file mode 100644
index e3116ad..0000000
--- a/lstV2/frontend/src/components/logistics/helperCommands/commands/Relocate.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-import { LstCard } from "@/components/extendedUI/LstCard";
-import { Button } from "@/components/ui/button";
-import { CardContent, CardHeader } from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { useForm } from "@tanstack/react-form";
-import axios from "axios";
-import { useState } from "react";
-import { toast } from "sonner";
-
-export default function Relocate() {
- const [bookingIn, setBookingIn] = useState(false);
- const form = useForm({
- defaultValues: { runningNr: " ", lane: "" },
- onSubmit: async ({ value }) => {
- // Do something with form data
- setBookingIn(true);
-
- try {
- const res = await axios.post("/api/ocp/bookin", {
- runningNr: parseInt(value.runningNr),
- });
-
- if (res.data.success) {
- toast.success(res.data.message);
- form.reset();
- setBookingIn(false);
- } else {
- console.log(res.data.data.errors);
- toast.error(res.data.data.errors[0]?.message);
- form.reset();
- setBookingIn(false);
- }
- } catch (error) {
- console.log(error);
- toast.error(
- "There was an error booking in pallet please validate you entered the correct info and try again."
- );
- setBookingIn(false);
- }
- },
- });
- return (
-
-
- Relocate a pallet to another lane
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/components/logistics/helperCommands/commands/RemoveAsNonReusable.tsx b/lstV2/frontend/src/components/logistics/helperCommands/commands/RemoveAsNonReusable.tsx
deleted file mode 100644
index 67a825f..0000000
--- a/lstV2/frontend/src/components/logistics/helperCommands/commands/RemoveAsNonReusable.tsx
+++ /dev/null
@@ -1,138 +0,0 @@
-import { LstCard } from "@/components/extendedUI/LstCard";
-import { Button } from "@/components/ui/button";
-import { CardContent, CardHeader } from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Textarea } from "@/components/ui/textarea";
-import { useForm } from "@tanstack/react-form";
-import axios from "axios";
-import { useState } from "react";
-import { toast } from "sonner";
-
-export default function RemoveAsNonReusable() {
- const [stockOut, setStockOut] = useState(false);
- const form = useForm({
- defaultValues: { runningNr: " ", reason: " " },
- onSubmit: async ({ value }) => {
- // Do something with form data
- setStockOut(true);
-
- //console.log(value);
-
- try {
- const res = await axios.post(
- "/api/logistics/removeasreusable",
-
- value // this is basically the data field
- );
-
- if (res.data.success) {
- toast.success(res.data.message);
- form.reset();
- setStockOut(false);
- } else {
- console.log(res.data);
- toast.error(res.data?.message);
- form.reset();
- setStockOut(false);
- }
- } catch (error: any) {
- console.log(error);
- toast.error(error.message);
- setStockOut(false);
- }
- },
- });
- return (
-
-
- Remove a pallet as non reusable
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx b/lstV2/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx
deleted file mode 100644
index 3c7a5da..0000000
--- a/lstV2/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import { LstCard } from "@/components/extendedUI/LstCard";
-import { Button } from "@/components/ui/button";
-import { CardHeader } from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-
-import axios from "axios";
-import { useState } from "react";
-
-import { useForm } from "react-hook-form";
-import { toast } from "sonner";
-
-export default function ConsumeMaterial() {
- const {
- register: register1,
- handleSubmit: handleSubmit1,
- reset,
- } = useForm();
- const [submitting, setSubmitting] = useState(false);
-
- const handleConsume = async (data: any) => {
- setSubmitting(true);
- try {
- // const result = await axios.post(`/api/logistics/consume`, data, {
- // headers: {Authorization: `Bearer ${token}`},
- // });
- const result = await axios.post(`/api/logistics/consume`, data);
- if (result.data.success) {
- toast.success(result.data.message);
- setSubmitting(false);
- reset();
- }
- if (!result.data.success) {
- //console.log(result.data);
- setSubmitting(false);
-
- toast.error(result.data.message);
- }
- } catch (error: any) {
- console.log(error);
- setSubmitting(false);
- if (error.status === 401) {
- toast.error("Unauthorized to do this task.");
- } else {
- toast.error(
- "Unexpected error if this continues please constact an admin."
- );
- }
- }
- };
- return (
-
-
-
- Consuming Material.
-
-
-
-
-
-
-
- -
- 1. Enter the running number of the
- material you would like to consume
-
- -
- 2. Enter the lot number you will be
- consuming to
-
- - 3. Press consume material
-
-
- *This process is only for barcoded material,
- if it is set to auto consume you will
- encounter and error.
-
-
-
-
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/components/logistics/materialHelper/consumption/MaterialReturn.tsx b/lstV2/frontend/src/components/logistics/materialHelper/consumption/MaterialReturn.tsx
deleted file mode 100644
index 9853e3a..0000000
--- a/lstV2/frontend/src/components/logistics/materialHelper/consumption/MaterialReturn.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-import { LstCard } from "@/components/extendedUI/LstCard";
-import { Button } from "@/components/ui/button";
-import { CardHeader } from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { useSessionStore } from "@/lib/store/sessionStore";
-import axios from "axios";
-import { useState } from "react";
-
-import { useForm } from "react-hook-form";
-import { toast } from "sonner";
-
-export default function PreformReturn() {
- const {
- register: register1,
- handleSubmit: handleSubmit1,
- reset,
- } = useForm();
- const [submitting, setSubmitting] = useState(false);
- const { token } = useSessionStore();
-
- const handleConsume = async (data: any) => {
- setSubmitting(true);
- try {
- const result = await axios.post(`/api/logistics/consume`, data, {
- headers: { Authorization: `Bearer ${token}` },
- });
- if (result.data.success) {
- toast.success(result.data.message);
- setSubmitting(false);
- reset();
- }
- if (!result.data.success) {
- //console.log(result.data);
- setSubmitting(false);
-
- toast.error(result.data.message);
- }
- } catch (error: any) {
- //console.log(error);
- setSubmitting(false);
- if (error.status === 401) {
- toast.error("Unauthorized to do this task.");
- } else {
- toast.error(
- "Unexpected error if this continues please constact an admin."
- );
- }
- }
- };
- return (
-
-
-
- Preform Return.
-
-
-
-
-
-
-
- -
- 1. Enter the running number of the
- preform cage you would like to return
-
- -
- 2. Enter the new weight of the gaylord
-
- -
- 3. Select the printer you would like to
- print to
-
-
-
- *As soon as you press preform return it will
- print a new label and return to the staging
- location.
-
-
-
-
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/components/logistics/materialHelper/consumption/TransferToNextLot.tsx b/lstV2/frontend/src/components/logistics/materialHelper/consumption/TransferToNextLot.tsx
deleted file mode 100644
index c16ec5e..0000000
--- a/lstV2/frontend/src/components/logistics/materialHelper/consumption/TransferToNextLot.tsx
+++ /dev/null
@@ -1,478 +0,0 @@
-import { LstCard } from "@/components/extendedUI/LstCard";
-import { Button } from "@/components/ui/button";
-import { CardContent, CardHeader } from "@/components/ui/card";
-import { Input } from "@/components/ui/input";
-import { Switch } from "@/components/ui/switch";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { useAppForm } from "@/utils/formStuff";
-import axios from "axios";
-import { useState } from "react";
-import { toast } from "sonner";
-import { Info } from "lucide-react";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { useSettingStore } from "@/lib/store/useSettings";
-
-export default function TransferToNextLot() {
- const [gaylordFilled, setGaylordFilled] = useState([0]);
- const [actualAmount, setActualAmount] = useState(0);
- const [tab, setTab] = useState("esitmate");
- const [typeSwitch, setTypeSwitch] = useState(false);
- const { settings } = useSettingStore();
-
- const server = settings.filter((n: any) => n.name === "plantToken");
- const form = useAppForm({
- defaultValues: {
- runningNumber: "",
- lotNumber: "",
- originalAmount: "",
- amount: "",
- },
- onSubmit: async ({ value }) => {
- //console.log(transferData);
- //toast.success("603468: qty: 361, was transfered to lot:24897");
- try {
- const res = await axios.post("/api/ocp/materiallottransfer", {
- runningNumber: Number(value.runningNumber),
- lotNumber: Number(value.lotNumber),
- originalAmount: Number(value.originalAmount),
- level: Number(
- gaylordFilled.length === 1
- ? 0.25
- : gaylordFilled.length === 2
- ? 0.5
- : gaylordFilled.length === 3
- ? 0.75
- : gaylordFilled.length === 4 && 0.95
- ),
- amount: actualAmount,
- type: typeSwitch ? "eom" : "lot",
- });
-
- if (res.data.success) {
- toast.success(`${res.data.message}`);
- form.reset();
- setGaylordFilled([0]);
- setActualAmount(0);
- }
- //console.log(res.data);
-
- if (!res.data.success) {
- toast.error(res.data.message);
- }
- } catch (error) {
- if (error) {
- console.log(error);
- //toast.error(error)
- }
- }
- },
- });
- return (
-
-
-
-
- Material Transfer to Next lot
-
-
-
-
-
-
-
-
-
-
- Estimate Amount
-
-
- Actual Amount
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Enter the total amount of
- the cage/gaylord
-
-
-
-
- setActualAmount(
- Number(
- e.target.value
- )
- )
- }
- />
-
-
-
-
-
-
-
-
- (
-
- )}
- />
-
-
-
(
-
- )}
- />
- {tab !== "actual" && (
-
-
(
-
- )}
- />
-
- )}
-
-
-
-
-
- {typeSwitch ? (
-
-
- "EOM
- Transfer"
-
-
-
-
-
-
-
- Click
- the
- toggle
- if
- you
- will
- be
- transfering
- at
- EOM,
- NOTE:
- This
- will
- trigger
- the
- delayed
- transfer.
-
-
-
-
- ) : (
-
-
- "Lot
- Transfer"
-
-
-
-
-
-
-
- Click
- the
- toggle
- if
- you
- will
- be
- transferring
- at
- EOM,
- NOTE:
- This
- will
- trigger
- the
- delayed
- transfer.
-
-
-
-
- )}
-
-
-
-
-
- Transfer To Lot
-
-
-
-
-
-
-
-
-
-
-
-
- Moving material to the next lot.
-
-
- {tab !== "actual" ? (
-
-
- -
- 1. Grab the gaylord running
- number from the gaylord at the
- line/next to the tschritter
-
- -
- 2. Grab the next lot number you
- are going to be running (or the
- one that state no Main material
- prepared)
-
- -
- 3. Enter the total gaylord
- weight (this is how much the
- gaylord weighed when it came in
- from the supplier.)
-
- -
- 4. *Click the level of the
- gaylord (this is just an
- estimate to move to the next
- lot.)
-
- -
- 5. type in running number on the
- gaylord.
-
- -
- 6. Type in the new lot number.
-
- - 7. Press "Transfer To Lot"
-
-
-
- * to reduce the time needed to get
- the lot going we will use an
- estimate of how full the gaylord is.
-
-
- NOTE: This is not the return
- process, this process will just get
- the gaylord to the next lot.
-
-
- {settings.length > 0 && (
-
- For more in depth instructions
- please{" "}
-
- CLICK HERE
-
-
- )}
-
- ) : (
-
-
- -
- 1. Grab the gaylord running
- number from the gaylord at the
- line/next to the tschritter
-
- -
- 2. Grab the next lot number you
- are going to be running (or the
- one that state no Main material
- prepared)
-
- -
- 3. Take the gaylord to the scale
- and weight it
-
- -
- 4. Enter the weight of the
- gaylord minus the tar weight.
-
- -
- 5. type in running number on the
- gaylord.
-
- -
- 6. Type in the new lot number.
-
- - 7. Press "Transfer To Lot"
-
-
-
-
- NOTE: This is not the return
- process, this process will just get
- the gaylord to the next lot.
-
-
- {settings.length > 0 && (
-
- For more in depth instructions
- please{" "}
-
- CLICK HERE
-
-
- )}
-
- )}
-
-
-
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/components/logistics/materialHelper/materialHelperPage.tsx b/lstV2/frontend/src/components/logistics/materialHelper/materialHelperPage.tsx
deleted file mode 100644
index b837002..0000000
--- a/lstV2/frontend/src/components/logistics/materialHelper/materialHelperPage.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function MaterialHelperPage() {
- return materialHelperPage
;
-}
diff --git a/lstV2/frontend/src/routes/(logistics)/helperCommands/index.tsx b/lstV2/frontend/src/routes/(logistics)/helperCommands/index.tsx
deleted file mode 100644
index 5c78597..0000000
--- a/lstV2/frontend/src/routes/(logistics)/helperCommands/index.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import HelperPage from "@/components/logistics/helperCommands/helperPage";
-import { createFileRoute } from "@tanstack/react-router";
-
-export const Route = createFileRoute("/(logistics)/helperCommands/")({
- component: RouteComponent,
- // beforeLoad: async () => {
- // const auth = localStorage.getItem("auth_token");
- // if (!auth) {
- // throw redirect({
- // to: "/login",
- // search: {
- // // Use the current location to power a redirect after login
- // // (Do not use `router.state.resolvedLocation` as it can
- // // potentially lag behind the actual current location)
- // redirect: location.pathname + location.search,
- // },
- // });
- // }
- // },
-});
-
-function RouteComponent() {
- return (
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/routes/(logistics)/materialHelper/consumption/index.tsx b/lstV2/frontend/src/routes/(logistics)/materialHelper/consumption/index.tsx
deleted file mode 100644
index ae1e45b..0000000
--- a/lstV2/frontend/src/routes/(logistics)/materialHelper/consumption/index.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import ConsumeMaterial from "@/components/logistics/materialHelper/consumption/ConsumeMaterial";
-import PreformReturn from "@/components/logistics/materialHelper/consumption/MaterialReturn";
-import TransferToNextLot from "@/components/logistics/materialHelper/consumption/TransferToNextLot";
-import { createFileRoute } from "@tanstack/react-router";
-
-export const Route = createFileRoute(
- "/(logistics)/materialHelper/consumption/"
-)({
- component: RouteComponent,
- head: () => ({
- meta: [
- {
- name: "description",
- content: "My App is a web application",
- },
- {
- title: "LST - Logistics",
- },
- ],
- }),
-});
-
-function RouteComponent() {
- const url: string = window.location.host.split(":")[0];
- const auth = localStorage.getItem("auth_token");
- return (
-
- {auth ? (
- <>
-
- {url === "localhost" &&
}
-
- >
- ) : (
- <>
-
-
- >
- )}
-
- );
-}
diff --git a/lstV2/frontend/src/routes/(logistics)/materialHelper/index.tsx b/lstV2/frontend/src/routes/(logistics)/materialHelper/index.tsx
deleted file mode 100644
index 42cfc7f..0000000
--- a/lstV2/frontend/src/routes/(logistics)/materialHelper/index.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import MaterialHelperPage from "@/components/logistics/materialHelper/materialHelperPage";
-import { createFileRoute } from "@tanstack/react-router";
-
-export const Route = createFileRoute("/(logistics)/materialHelper/")({
- component: RouteComponent,
- head: () => ({
- meta: [
- {
- name: "description",
- content: "My App is a web application",
- },
- {
- title: "LST - Logistics",
- },
- ],
- }),
-});
-
-function RouteComponent() {
- return (
-
-
-
- );
-}
diff --git a/lstV2/frontend/src/routes/(logistics)/materialHelper/siloLink/index.tsx b/lstV2/frontend/src/routes/(logistics)/materialHelper/siloLink/index.tsx
deleted file mode 100644
index 96b1a8a..0000000
--- a/lstV2/frontend/src/routes/(logistics)/materialHelper/siloLink/index.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-
-export const Route = createFileRoute('/(logistics)/materialHelper/siloLink/')({
- component: RouteComponent,
-})
-
-function RouteComponent() {
- return Hello "/(logistics)/materialHelper/siloLink/"!
-}
diff --git a/lstV2/server/services/server/utils/subModuleCheck.ts b/lstV2/server/services/server/utils/subModuleCheck.ts
index 81a593e..b4895a4 100644
--- a/lstV2/server/services/server/utils/subModuleCheck.ts
+++ b/lstV2/server/services/server/utils/subModuleCheck.ts
@@ -118,7 +118,7 @@ const newSubModules = [
subSubModule: [],
},
{
- name: "Helper Commands",
+ name: "helperCommands",
moduleName: "logistics",
description: "Commands to assist when a scanner is not avalible",
link: "/lst/app/old/helpercommands",