diff --git a/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx b/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx index 5cd6198..7a01600 100644 --- a/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx +++ b/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx @@ -24,16 +24,12 @@ import NewCreateItem from "./newcreatitem"; import AssignAndRelease from "./AssignAndRelease"; import AssignTo from "./assignTo"; import { fetchAllItemsInClient, ItemCombo } from "@/app/api/settings/item/actions"; -import { fetchPickOrderClient, autoAssignAndReleasePickOrder, autoAssignAndReleasePickOrderByStore, FGPickOrderResponse, fetchFGPickOrders } from "@/app/api/pickOrder/actions"; +import { fetchPickOrderClient, autoAssignAndReleasePickOrder, autoAssignAndReleasePickOrderByStore } from "@/app/api/pickOrder/actions"; import Jobcreatitem from "./Jobcreatitem"; import { useSession } from "next-auth/react"; import { SessionWithTokens } from "@/config/authConfig"; import PickExecutionDetail from "./GoodPickExecutiondetail"; import GoodPickExecutionRecord from "./GoodPickExecutionRecord"; -import Swal from "sweetalert2"; -import { PrintDeliveryNoteRequest, printDN } from "@/app/api/do/actions"; - - interface Props { pickOrders: PickOrderResult[]; } @@ -69,9 +65,6 @@ const PickOrderSearch: React.FC = ({ pickOrders }) => { window.addEventListener('pickOrderAssigned', onAssigned); return () => window.removeEventListener('pickOrderAssigned', onAssigned); }, []); - - const [fgPickOrdersData, setFgPickOrdersData] = useState([]); - const handleAssignByStore = async (storeId: "2/F" | "4/F") => { if (!currentUserId) { console.error("Missing user id in session"); @@ -129,101 +122,6 @@ const PickOrderSearch: React.FC = ({ pickOrders }) => { setIsOpenCreateModal(false) }, []) - const handleDN = useCallback(async () =>{ - const askNumofCarton = await Swal.fire({ - title: t("Enter the number of cartons: "), - input: "number", - inputPlaceholder: t("Number of cartons"), - inputAttributes:{ - min: "1", - step: "1" - }, - inputValidator: (value) => { - if(!value){ - return t("You need to enter a number") - } - if(parseInt(value) < 1){ - return t("Number must be at least 1"); - } - return null - }, - showCancelButton: true, - confirmButtonText: t("Confirm"), - cancelButtonText: t("Cancel"), - showLoaderOnConfirm: true, - allowOutsideClick: () => !Swal.isLoading() - }); - - if (askNumofCarton.isConfirmed) { - const numOfCartons = askNumofCarton.value; - console.log(numOfCartons) - } - },[t]); - - const handleDNandLabel = useCallback(async () =>{ - const askNumofCarton = await Swal.fire({ - title: t("Enter the number of cartons: "), - input: "number", - inputPlaceholder: t("Number of cartons"), - inputAttributes:{ - min: "1", - step: "1" - }, - inputValidator: (value) => { - if(!value){ - return t("You need to enter a number") - } - if(parseInt(value) < 1){ - return t("Number must be at least 1"); - } - return null - }, - showCancelButton: true, - confirmButtonText: t("Confirm"), - cancelButtonText: t("Cancel"), - showLoaderOnConfirm: true, - allowOutsideClick: () => !Swal.isLoading() - }); - - if (askNumofCarton.isConfirmed) { - const numOfCartons = askNumofCarton.value; - } - },[t]); - - const handleLabel = useCallback(async () =>{ - const askNumofCarton = await Swal.fire({ - title: t("Enter the number of cartons: "), - input: "number", - inputPlaceholder: t("Number of cartons"), - inputAttributes:{ - min: "1", - step: "1" - }, - inputValidator: (value) => { - if(!value){ - return t("You need to enter a number") - } - if(parseInt(value) < 1){ - return t("Number must be at least 1"); - } - return null - }, - showCancelButton: true, - confirmButtonText: t("Confirm"), - cancelButtonText: t("Cancel"), - showLoaderOnConfirm: true, - allowOutsideClick: () => !Swal.isLoading() - }); - - if (askNumofCarton.isConfirmed) { - const numOfCartons = askNumofCarton.value; - } - },[t]); - - const handleDraft = useCallback(async () =>{ - - },[t]); - useEffect(() => { @@ -417,18 +315,6 @@ const PickOrderSearch: React.FC = ({ pickOrders }) => { - - - - {/* First 4 buttons aligned left */} - - - - - - - - {/* Last 2 buttons aligned right */}