Compare commits

..

4 Commits

Author SHA1 Message Date
MacBook Air M1 89a6312761 adjust laporan depresiasi 2026-06-10 22:18:44 +07:00
MacBook Air M1 7061031cd9 show total price when pending is 0 2026-06-10 21:15:59 +07:00
Giovanni Gabriel Septriadi 2e99a7b2f7 Merge branch 'feat/recording-detail-used-product-total-price' into 'development'
[FEA/FE] Recording Detail Used Product Total Price

See merge request mbugroup/lti-web-client!511
2026-06-10 13:20:35 +00:00
ValdiANS 61cd56be22 feat: add total_price to recording stock type and display it in recording detail form 2026-06-10 14:50:50 +07:00
3 changed files with 19 additions and 5 deletions
@@ -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,15 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
<span className='text-sm text-gray-600 whitespace-nowrap'>
(tersedia: {formatNumber(availableStock)} | pending:{' '}
<span className='text-error'>{formatNumber(pendingQty)}</span> |
pakai: {formatNumber(requestedUsage)})
pakai: {formatNumber(requestedUsage)}
{showTotalPrice && <> | total harga: {totalPrice}</>})
</span>
);
}
if (showTotalPrice) {
return (
<span className='text-sm text-gray-600 whitespace-nowrap'>
(total harga: {totalPrice})
</span>
);
}
@@ -1529,13 +1540,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}</>})
</span>
);
}
return (
<span className='text-sm text-gray-600 whitespace-nowrap'>
(tersedia: {formatNumber(availableStock)})
(tersedia: {formatNumber(availableStock)}
{showTotalPrice && <> | total harga: {totalPrice}</>})
</span>
);
},
@@ -120,7 +120,7 @@ const ReportDepreciationTab = ({ tabId }: ReportDepreciationTabProps) => {
'IDR',
'id-ID',
0,
10
2
),
},
{
@@ -143,7 +143,7 @@ const ReportDepreciationTab = ({ tabId }: ReportDepreciationTabProps) => {
'IDR',
'id-ID',
0,
10
2
),
},
],
+1
View File
@@ -67,6 +67,7 @@ export type RecordingStock = {
qty?: number;
usage_amount?: number;
pending_qty: number;
total_price?: number;
product_warehouse: ProductWarehouse;
};