mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 07:15:44 +00:00
refactor(FE-208,213): enhance PurchaseOrderDetail and PurchaseOrderStaffApprovalForm components with initialValues prop and clean up unused code
This commit is contained in:
@@ -170,7 +170,7 @@ const PurchaseOrderStaffApprovalForm = ({
|
||||
if (initialValues?.items) {
|
||||
return initialValues.items.map((item) => ({
|
||||
value: item.id,
|
||||
label: `${item.product.name} (${item.quantity} ${item.product.uom?.name || 'unit'})`,
|
||||
label: `${item.product.name} ${item.quantity}`,
|
||||
id: item.id,
|
||||
quantity: item.quantity,
|
||||
product: {
|
||||
@@ -184,57 +184,8 @@ const PurchaseOrderStaffApprovalForm = ({
|
||||
}));
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
value: 1,
|
||||
label: 'SEALYTE SPARK 1 x 87 gr (14 SACHET)',
|
||||
id: 1,
|
||||
quantity: 14,
|
||||
product: {
|
||||
name: 'SEALYTE SPARK 1 x 87 gr',
|
||||
product_category: 'Bahan Baku',
|
||||
uom: {
|
||||
name: 'SACHET',
|
||||
},
|
||||
},
|
||||
warehouse: {
|
||||
name: 'GUDANG CIANGSANA 1 (ARCA P15)',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: 'CID-2000 @ 5 KG (2 KILOGRAM)',
|
||||
id: 2,
|
||||
quantity: 2,
|
||||
product: {
|
||||
name: 'CID-2000 @ 5 KG',
|
||||
product_category: 'Bahan Baku',
|
||||
uom: {
|
||||
name: 'Kilogram',
|
||||
},
|
||||
},
|
||||
warehouse: {
|
||||
name: 'GUDANG CIANGSANA 2 (ARCA P15)',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: 'VITAMIN AYAM (10 DOSIS)',
|
||||
id: 3,
|
||||
quantity: 10,
|
||||
product: {
|
||||
name: 'VITAMIN AYAM',
|
||||
product_category: 'Bahan Baku',
|
||||
uom: {
|
||||
name: 'DOSIS',
|
||||
},
|
||||
},
|
||||
warehouse: {
|
||||
name: 'GUDANG CIANGSANA 3 (ARCA P15)',
|
||||
},
|
||||
},
|
||||
];
|
||||
}, [initialValues?.items, searchParams]);
|
||||
return [];
|
||||
}, [initialValues?.items]);
|
||||
|
||||
const getPurchaseItemOptions = useCallback(() => {
|
||||
return purchaseItems;
|
||||
|
||||
Reference in New Issue
Block a user