diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index 38bbe94a..0d4a761b 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -1509,6 +1509,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { const { pendingQty } = getStockPendingInfo( stock.product_warehouse_id.value ); + const totalPrice = initialValues?.stocks?.[stockIdx].total_price; + const showTotalPrice = + type === 'detail' && typeof totalPrice === 'number'; if (isDetail) { if (pendingQty > 0) { @@ -1516,7 +1519,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { (tersedia: {formatNumber(availableStock)} | pending:{' '} {formatNumber(pendingQty)} | - pakai: {formatNumber(requestedUsage)}) + pakai: {formatNumber(requestedUsage)} + {showTotalPrice && <> | total harga: {totalPrice}}) ); } @@ -1529,13 +1533,15 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { (tersedia: {formatNumber(availableStock)} | pakai:{' '} {formatNumber(requestedUsage)} | sisa:{' '} {formatNumber(Math.max(remainingStock, 0))} | dipinjam:{' '} - {formatNumber(Math.max(-remainingStock, 0))}) + {formatNumber(Math.max(-remainingStock, 0))} + {showTotalPrice && <> | total harga: {totalPrice}}) ); } return ( - (tersedia: {formatNumber(availableStock)}) + (tersedia: {formatNumber(availableStock)} + {showTotalPrice && <> | total harga: {totalPrice}}) ); }, diff --git a/src/types/api/production/recording.d.ts b/src/types/api/production/recording.d.ts index 9a8690c5..0d2c991a 100644 --- a/src/types/api/production/recording.d.ts +++ b/src/types/api/production/recording.d.ts @@ -67,6 +67,7 @@ export type RecordingStock = { qty?: number; usage_amount?: number; pending_qty: number; + total_price?: number; product_warehouse: ProductWarehouse; };