| @@ -90,12 +90,13 @@ const PutAwayCamScan: React.FC<Props> = ({ warehouse }) => { | |||||
| [scannedSilId, scannedWareHouseId], | [scannedSilId, scannedWareHouseId], | ||||
| ); | ); | ||||
| // Open modal only after both stock-in-line and location (warehouse) are scanned | |||||
| useEffect(() => { | useEffect(() => { | ||||
| if (scannedSilId > 0) { | |||||
| if (scannedSilId > 0 && scannedWareHouseId > 0) { | |||||
| setOpenPutAwayModal(true); | setOpenPutAwayModal(true); | ||||
| setScanStatus("pending"); | setScanStatus("pending"); | ||||
| } | } | ||||
| }, [scannedSilId]); | |||||
| }, [scannedSilId, scannedWareHouseId]); | |||||
| const closeModal = () => { | const closeModal = () => { | ||||
| setScannedSilId(0); | setScannedSilId(0); | ||||
| @@ -108,11 +109,14 @@ const PutAwayCamScan: React.FC<Props> = ({ warehouse }) => { | |||||
| if (scanStatus === "scanning") { | if (scanStatus === "scanning") { | ||||
| return t("Scanning"); | return t("Scanning"); | ||||
| } | } | ||||
| if (scannedSilId > 0) { | |||||
| if (scannedSilId > 0 && scannedWareHouseId > 0) { | |||||
| return t("Scanned, opening detail"); | return t("Scanned, opening detail"); | ||||
| } | } | ||||
| if (scannedSilId > 0) { | |||||
| return t("Please scan warehouse qr code"); | |||||
| } | |||||
| return t("Pending scan"); | return t("Pending scan"); | ||||
| }, [scanStatus, scannedSilId, t]); | |||||
| }, [scanStatus, scannedSilId, scannedWareHouseId, t]); | |||||
| const scannerConfig: ScannerConfig = { | const scannerConfig: ScannerConfig = { | ||||
| ...defaultScannerConfig, | ...defaultScannerConfig, | ||||