|
|
@@ -106,14 +106,14 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { |
|
|
|
console.log(checkRes); |
|
|
|
const newPo = await fetchPoInClient(purchaseOrder.id); |
|
|
|
setPurchaseOrder(newPo); |
|
|
|
}, [checkPolAndCompletePo, fetchPoInClient]); |
|
|
|
}, [purchaseOrder.id]); |
|
|
|
|
|
|
|
const handleStartPo = useCallback(async () => { |
|
|
|
const startRes = await startPo(purchaseOrder.id); |
|
|
|
console.log(startRes); |
|
|
|
const newPo = await fetchPoInClient(purchaseOrder.id); |
|
|
|
setPurchaseOrder(newPo); |
|
|
|
}, [startPo, fetchPoInClient]); |
|
|
|
}, [purchaseOrder.id]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setRows(purchaseOrder.pol || []); |
|
|
@@ -127,11 +127,11 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { |
|
|
|
const [stockInLine, setStockInLine] = useState(row.stockInLine); |
|
|
|
const totalWeight = useMemo( |
|
|
|
() => calculateWeight(row.qty, row.uom), |
|
|
|
[calculateWeight], |
|
|
|
[row.qty, row.uom], |
|
|
|
); |
|
|
|
const weightUnit = useMemo( |
|
|
|
() => returnWeightUnit(row.uom), |
|
|
|
[returnWeightUnit], |
|
|
|
[row.uom], |
|
|
|
); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@@ -142,7 +142,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => { |
|
|
|
} else { |
|
|
|
setCurrStatus("pending".toUpperCase()); |
|
|
|
} |
|
|
|
}, [processedQty]); |
|
|
|
}, [processedQty, row.qty]); |
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
|