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 === "dbServer"); 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 ) ) } />
{ e.preventDefault(); form.handleSubmit(); }} >
( )} />
( )} /> {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 transfering at EOM, NOTE: This will trigger the delayed transfer.

)}
Transfer To Lot

Moving material to the next lot.

{tab !== "actual" ? (
  1. 1. Grab the gaylord running number from the gaylord at the line/next to the tschritter
  2. 2. Grab the next lot number you are going to be running (or the one that state no Main material prepared)
  3. 3. Enter the total gaylord weight (this is how much the gaylord weighed when it came in from the supplier.)
  4. 4. *Click the level of the gaylord (this is just an estimate to move to the next lot.)
  5. 5. type in running number on the gaylord.
  6. 6. Type in the new lot number.
  7. 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. 1. Grab the gaylord running number from the gaylord at the line/next to the tschritter
  2. 2. Grab the next lot number you are going to be running (or the one that state no Main material prepared)
  3. 3. Take the gaylord to the scale and weight it
  4. 4. Enter the weight of the gaylord minus the tar weight.
  5. 5. type in running number on the gaylord.
  6. 6. Type in the new lot number.
  7. 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

)}
)}
); }