Merge branch 'development' into 'production'

Development

See merge request mbugroup/lti-web-client!514
This commit is contained in:
Giovanni Gabriel Septriadi
2026-06-11 07:24:00 +00:00
3 changed files with 19 additions and 7 deletions
@@ -72,7 +72,7 @@ import {
} from '@/components/pages/production/recording/form/RecordingForm.schema'; } from '@/components/pages/production/recording/form/RecordingForm.schema';
import { isResponseSuccess, isResponseError } from '@/lib/api-helper'; import { isResponseSuccess, isResponseError } from '@/lib/api-helper';
import { formatDate, formatNumber, cn } from '@/lib/helper'; import { formatDate, formatNumber, cn, formatCurrency } from '@/lib/helper';
import { import {
getProductWarehouseOptionLabel, getProductWarehouseOptionLabel,
isProductWarehouseSelectableForKandang, isProductWarehouseSelectableForKandang,
@@ -1509,6 +1509,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
const { pendingQty } = getStockPendingInfo( const { pendingQty } = getStockPendingInfo(
stock.product_warehouse_id.value stock.product_warehouse_id.value
); );
const totalPrice = initialValues?.stocks?.[stockIdx]?.total_price;
const showTotalPrice =
type === 'detail' && typeof totalPrice === 'number';
if (isDetail) { if (isDetail) {
if (pendingQty > 0) { if (pendingQty > 0) {
@@ -1516,11 +1519,14 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
<span className='text-sm text-gray-600 whitespace-nowrap'> <span className='text-sm text-gray-600 whitespace-nowrap'>
(tersedia: {formatNumber(availableStock)} | pending:{' '} (tersedia: {formatNumber(availableStock)} | pending:{' '}
<span className='text-error'>{formatNumber(pendingQty)}</span> | <span className='text-error'>{formatNumber(pendingQty)}</span> |
pakai: {formatNumber(requestedUsage)}) pakai: {formatNumber(requestedUsage)}
{showTotalPrice && (
<> | total harga: {formatCurrency(totalPrice)}</>
)}
)
</span> </span>
); );
} }
return null;
} }
if (requestedUsage > 0) { if (requestedUsage > 0) {
@@ -1529,13 +1535,18 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
(tersedia: {formatNumber(availableStock)} | pakai:{' '} (tersedia: {formatNumber(availableStock)} | pakai:{' '}
{formatNumber(requestedUsage)} | sisa:{' '} {formatNumber(requestedUsage)} | sisa:{' '}
{formatNumber(Math.max(remainingStock, 0))} | dipinjam:{' '} {formatNumber(Math.max(remainingStock, 0))} | dipinjam:{' '}
{formatNumber(Math.max(-remainingStock, 0))}) {formatNumber(Math.max(-remainingStock, 0))}
{showTotalPrice && (
<> | total harga: {formatCurrency(totalPrice)}</>
)}
)
</span> </span>
); );
} }
return ( return (
<span className='text-sm text-gray-600 whitespace-nowrap'> <span className='text-sm text-gray-600 whitespace-nowrap'>
(tersedia: {formatNumber(availableStock)}) (tersedia: {formatNumber(availableStock)}
{showTotalPrice && <> | total harga: {formatCurrency(totalPrice)}</>})
</span> </span>
); );
}, },
@@ -120,7 +120,7 @@ const ReportDepreciationTab = ({ tabId }: ReportDepreciationTabProps) => {
'IDR', 'IDR',
'id-ID', 'id-ID',
0, 0,
10 2
), ),
}, },
{ {
@@ -143,7 +143,7 @@ const ReportDepreciationTab = ({ tabId }: ReportDepreciationTabProps) => {
'IDR', 'IDR',
'id-ID', 'id-ID',
0, 0,
10 2
), ),
}, },
], ],
+1
View File
@@ -67,6 +67,7 @@ export type RecordingStock = {
qty?: number; qty?: number;
usage_amount?: number; usage_amount?: number;
pending_qty: number; pending_qty: number;
total_price?: number;
product_warehouse: ProductWarehouse; product_warehouse: ProductWarehouse;
}; };