) => {
const value = parseInt(e.target.value.replace(/[^\d.-]/g, '')) || 0;
@@ -920,6 +992,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
`stocks.${idx}.product_warehouse_id`,
option?.value || 0
);
+
// Auto-populate notes with product name by finding it in stockProducts data
if (option?.value && isResponseSuccess(stockProducts)) {
const selectedProduct = stockProducts.data.find(
@@ -957,6 +1030,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
/>
|
+
{
decimalSeparator=''
isError={
isRepeaterInputError('stocks', 'usage_amount', idx)
- .isError
+ .isError || Boolean(getStockUsageError(idx))
}
errorMessage={
isRepeaterInputError('stocks', 'usage_amount', idx)
- .errorMessage
+ .errorMessage ||
+ getStockUsageError(idx) ||
+ undefined
}
readOnly={type === 'detail'}
className={{
wrapper: 'w-full min-w-24',
}}
- placeholder='Jumlah Pakai'
+ placeholder="Jumlah Pakai"
/>
+ {type !== 'detail' && getStockUsageAdornment(idx)}
+
|
{type !== 'detail' && (
@@ -1226,6 +1304,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
: undefined
}
onDelete={deleteRecordingClickHandler}
+ disableSubmit={hasExceededStock}
/>
{recordingFormErrorMessage && (
|