Compare commits

..

5 Commits

Author SHA1 Message Date
Rivaldi A N S e75f4aab82 Merge branch 'feat/recording-detail-used-product-total-price' into 'development'
[FEAT/FE] Recording Detail Used Product Total Price

See merge request mbugroup/lti-web-client!515
2026-06-11 04:19:48 +00:00
ValdiANS 6129e4ab1f Merge branch 'development' into feat/recording-detail-used-product-total-price 2026-06-11 11:19:11 +07:00
ValdiANS a7cdf0f785 fix: format total price 2026-06-11 11:14:31 +07:00
Giovanni Gabriel Septriadi 0085f69534 Merge branch 'feat/total-price-recording' into 'development'
adjust laporan depresiasi

See merge request mbugroup/lti-web-client!513
2026-06-10 15:20:54 +00:00
Giovanni Gabriel Septriadi b756006c0a Merge branch 'feat/total-price-recording' into 'development'
show total price when pending is 0

See merge request mbugroup/lti-web-client!512
2026-06-10 14:17:38 +00:00
@@ -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,7 +1509,7 @@ 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 totalPrice = initialValues?.stocks?.[stockIdx]?.total_price;
const showTotalPrice = const showTotalPrice =
type === 'detail' && typeof totalPrice === 'number'; type === 'detail' && typeof totalPrice === 'number';
@@ -1520,18 +1520,13 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
(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: {totalPrice}</>}) {showTotalPrice && (
<> | total harga: {formatCurrency(totalPrice)}</>
)}
)
</span> </span>
); );
} }
if (showTotalPrice) {
return (
<span className='text-sm text-gray-600 whitespace-nowrap'>
(total harga: {totalPrice})
</span>
);
}
return null;
} }
if (requestedUsage > 0) { if (requestedUsage > 0) {
@@ -1541,14 +1536,17 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
{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: {totalPrice}</>}) {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: {totalPrice}</>}) {showTotalPrice && <> | total harga: {formatCurrency(totalPrice)}</>})
</span> </span>
); );
}, },