feat(FE-208,212): simplify PurchaseOrder forms by removing unused fields and updating user names

This commit is contained in:
rstubryan
2025-11-12 10:51:57 +07:00
parent 45f12cad4f
commit bc53b9073c
2 changed files with 9 additions and 92 deletions
@@ -5,7 +5,6 @@ import { useFormik } from 'formik';
import { Icon } from '@iconify/react';
import { toast } from 'react-hot-toast';
import { useSearchParams } from 'next/navigation';
import Link from 'next/link';
import Button from '@/components/Button';
import TextInput from '@/components/input/TextInput';
import NumberInput from '@/components/input/NumberInput';
@@ -406,11 +405,6 @@ const PurchaseOrderAcceptApprovalForm = ({
Item
<span className='text-error'>*</span>
</th>
<th>Gudang</th>
<th>Produk</th>
<th>Jenis Produk</th>
<th>Jumlah</th>
<th>Satuan</th>
<th>
Tanggal Diterima
<span className='text-error'>*</span>
@@ -477,83 +471,6 @@ const PurchaseOrderAcceptApprovalForm = ({
}}
/>
</td>
<td>
<TextInput
name={`items.${idx}.warehouse`}
type='text'
value={selectedPurchaseItem?.warehouse?.name || ''}
readOnly={true}
placeholder='Pilih item terlebih dahulu'
className={{
wrapper: 'min-w-32',
}}
disabled={true}
/>
</td>
<td>
<TextInput
name={`items.${idx}.product_name`}
type='text'
value={selectedPurchaseItem?.product?.name || ''}
readOnly={true}
placeholder='Pilih item terlebih dahulu'
className={{
wrapper: 'min-w-48',
}}
disabled={true}
/>
</td>
<td>
<TextInput
name={`items.${idx}.product_category`}
type='text'
value={
typeof selectedPurchaseItem?.product
?.product_category === 'string'
? selectedPurchaseItem.product.product_category
: selectedPurchaseItem?.product?.product_category
?.name || ''
}
readOnly={true}
placeholder='Pilih item terlebih dahulu'
className={{
wrapper: 'min-w-32',
}}
disabled={true}
/>
</td>
<td>
<TextInput
name={`items.${idx}.quantity`}
type='text'
value={
selectedPurchaseItem?.quantity
? selectedPurchaseItem.quantity.toLocaleString(
'id-ID'
)
: ''
}
readOnly={true}
placeholder='Pilih item terlebih dahulu'
className={{
wrapper: 'min-w-24',
}}
disabled={true}
/>
</td>
<td>
<TextInput
name={`items.${idx}.uom`}
type='text'
value={selectedPurchaseItem?.product?.uom?.name || ''}
readOnly={true}
placeholder='Pilih item terlebih dahulu'
className={{
wrapper: 'min-w-24',
}}
disabled={true}
/>
</td>
<td>
<TextInput
required