mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'fix/recording' into 'development'
[FIX/FE] Recording Form See merge request mbugroup/lti-web-client!464
This commit is contained in:
@@ -155,7 +155,6 @@ build:dev:
|
||||
NEXT_PUBLIC_DASHBOARD_ACCOUNTING_URL: 'https://dev-dashboard-ho.mbugroup.id/'
|
||||
NEXT_PUBLIC_S3_PUBLIC_BASE_URL: 'https://mbu-lti-storage.s3.ap-southeast-3.amazonaws.com'
|
||||
|
||||
|
||||
deploy:dev:
|
||||
<<: *deploy_template
|
||||
needs: ['build:dev']
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
CreateGrowingRecordingPayload,
|
||||
CreateLayingRecordingPayload,
|
||||
CreateEggPayload,
|
||||
RecordingStock,
|
||||
} from '@/types/api/production/recording';
|
||||
import { getProductWarehouseOptionLabel } from '@/lib/product-warehouse';
|
||||
|
||||
@@ -282,8 +283,9 @@ export const getRecordingGrowingFormInitialValues = (
|
||||
label: getProductWarehouseOptionLabel(stock.product_warehouse),
|
||||
},
|
||||
qty:
|
||||
(stock as { qty?: number; usage_amount?: number }).qty ||
|
||||
(stock as { qty?: number; usage_amount?: number }).usage_amount ||
|
||||
(stock as RecordingStock).qty ||
|
||||
((stock as RecordingStock).usage_amount || 0) +
|
||||
((stock as RecordingStock).pending_qty || 0) ||
|
||||
'',
|
||||
})) ?? [
|
||||
{
|
||||
|
||||
@@ -1508,9 +1508,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
if (pendingQty > 0) {
|
||||
return (
|
||||
<span className='text-sm text-gray-600 whitespace-nowrap'>
|
||||
(tersedia: {formatNumber(requestedUsage)} | pending:{' '}
|
||||
(tersedia: {formatNumber(availableStock)} | pending:{' '}
|
||||
<span className='text-error'>{formatNumber(pendingQty)}</span> |
|
||||
pakai: {formatNumber(requestedUsage + pendingQty)})
|
||||
pakai: {formatNumber(requestedUsage)})
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
+1
@@ -62,6 +62,7 @@ export type RecordingDepletion = {
|
||||
|
||||
export type RecordingStock = {
|
||||
product_warehouse_id: number;
|
||||
qty?: number;
|
||||
usage_amount?: number;
|
||||
pending_qty: number;
|
||||
product_warehouse: ProductWarehouse;
|
||||
|
||||
Reference in New Issue
Block a user