|
|
@@ -20,8 +20,8 @@ import { useTranslation } from "react-i18next"; |
|
|
|
import StockInForm from "./StockInForm"; |
|
|
|
import StockInFormVer2 from "./StockInFormVer2"; |
|
|
|
import QcComponent from "./QcComponent"; |
|
|
|
import { dummyPutawayLine, dummyQCData } from "./dummyQcTemplate"; |
|
|
|
import QcFormVer2 from "./QcFormVer2"; |
|
|
|
import { dummyPutAwayLine, dummyQCData } from "./dummyQcTemplate"; |
|
|
|
// import QcFormVer2 from "./QcFormVer2"; |
|
|
|
import PutAwayForm from "./PutAwayForm"; |
|
|
|
import { useGridApiRef } from "@mui/x-data-grid"; |
|
|
|
import {submitDialogWithWarning} from "../Swal/CustomAlerts"; |
|
|
@@ -103,7 +103,7 @@ const defaultNewValue = useMemo(() => { |
|
|
|
dnDate: arrayToInputDateString(itemDetail.dnDate)?? dayjsToInputDateString(dayjs()), |
|
|
|
// putAwayLines: dummyPutAwayLine, |
|
|
|
// putAwayLines: itemDetail.putAwayLines.map((line) => (return {...line, printQty: 1})) ?? [], |
|
|
|
putAwayLines: itemDetail.putAwayLines?.map((line) => ({...line, printQty: 1})) ?? [], |
|
|
|
putAwayLines: itemDetail.putAwayLines?.map((line) => ({...line, printQty: 1, _isNew: false})) ?? [], |
|
|
|
qcResult: (itemDetail.qcResult && itemDetail.qcResult?.length > 0) ? itemDetail.qcResult : [],//[...dummyQCData], |
|
|
|
escResult: (itemDetail.escResult && itemDetail.escResult?.length > 0) ? itemDetail.escResult : [], |
|
|
|
receiptDate: itemDetail.receiptDate ?? dayjs().add(0, "month").format(INPUT_DATE_FORMAT), |
|
|
@@ -141,7 +141,7 @@ const [qcItems, setQcItems] = useState(dummyQCData) |
|
|
|
...itemDetail, |
|
|
|
dnDate: dayjsToInputDateString(dayjs()), |
|
|
|
// putAwayLines: dummyPutAwayLine, |
|
|
|
putAwayLines: itemDetail.putAwayLines?.map((line) => ({...line, printQty: 1})) ?? [], |
|
|
|
putAwayLines: itemDetail.putAwayLines?.map((line) => ({...line, printQty: 1, _isNew: false})) ?? [], |
|
|
|
}) |
|
|
|
setOpenPutaway(isPutaway); |
|
|
|
|
|
|
@@ -362,6 +362,8 @@ const [qcItems, setQcItems] = useState(dummyQCData) |
|
|
|
const onSubmitPutaway = useCallback<SubmitHandler<ModalFormInput>>( |
|
|
|
async (data, event) => { |
|
|
|
console.log("Putaway Submission:", event!.nativeEvent); |
|
|
|
console.log(data.putAwayLines) |
|
|
|
console.log(data.putAwayLines?.filter((line) => line._isNew !== false)) |
|
|
|
// Extract only putaway related fields |
|
|
|
const putawayData = { |
|
|
|
// putawayLine: data.putawayLine, |
|
|
@@ -378,7 +380,7 @@ const [qcItems, setQcItems] = useState(dummyQCData) |
|
|
|
receiptDate : arrayToInputDateString(data.receiptDate), |
|
|
|
|
|
|
|
// for putaway data |
|
|
|
inventoryLotLines: data.putAwayLines?.filter((line) => Boolean(line._isNew)) |
|
|
|
inventoryLotLines: data.putAwayLines?.filter((line) => line._isNew !== false) |
|
|
|
|
|
|
|
// Add other putaway specific fields |
|
|
|
} as ModalFormInput; |
|
|
|