diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index 6ea77373..24f862d7 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -1078,14 +1078,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { if ((type as 'add' | 'edit' | 'detail') === 'detail') return null; const stock = formik.values.stocks?.[stockIdx]; if (!stock || !stock.product_warehouse_id) return null; - const availableStock = getAvailableStock(stock.product_warehouse_id); - const requestedUsage = Number(stock.qty) || 0; - if (requestedUsage > availableStock) { - return `Jumlah pakai melebihi stok tersedia! Maksimal: ${formatNumber(availableStock)}`; - } return null; }, - [formik.values.stocks, getAvailableStock, type] + [formik.values.stocks, type] ); const getStockUsageAdornment = useCallback( @@ -1099,7 +1094,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { if (requestedUsage > 0) { return ( - (sisa: {formatNumber(remainingStock)}) + (tersedia: {formatNumber(availableStock)} | pakai:{' '} + {formatNumber(requestedUsage)} | sisa:{' '} + {formatNumber(Math.max(remainingStock, 0))} | dipinjam:{' '} + {formatNumber(Math.max(-remainingStock, 0))}) ); }