mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'fix/purchase-product-receive-confirmation' into 'development'
[FIX/FE] Purchase Product Receive Confirmation See merge request mbugroup/lti-web-client!379
This commit is contained in:
@@ -157,11 +157,6 @@ const SalesOrderProductForm = ({
|
||||
);
|
||||
}, [selectedProductWarehouse, formik.values.marketing_type]);
|
||||
|
||||
console.log({
|
||||
initialValues,
|
||||
values: formik.values,
|
||||
});
|
||||
|
||||
// ===== Options =====
|
||||
const {
|
||||
options: warehouseOptions,
|
||||
|
||||
@@ -367,6 +367,9 @@ const PurchaseOrderAcceptApprovalForm = ({
|
||||
);
|
||||
} else {
|
||||
formik.setFieldValue(`items.${idx}.expedition_vendor_id`, null);
|
||||
|
||||
formik.setFieldValue(`items.${idx}.transport_per_item`, null);
|
||||
formik.setFieldValue(`items.${idx}.vehicle_number`, null);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -553,6 +556,7 @@ const PurchaseOrderAcceptApprovalForm = ({
|
||||
)
|
||||
}
|
||||
onBlur={formik.handleBlur}
|
||||
disabled={!Boolean(formItem?.expedition_vendor)}
|
||||
isError={
|
||||
isRepeaterInputError(idx, 'vehicle_number').isError
|
||||
}
|
||||
@@ -657,6 +661,7 @@ const PurchaseOrderAcceptApprovalForm = ({
|
||||
thousandSeparator=','
|
||||
decimalSeparator='.'
|
||||
inputPrefix={'Rp'}
|
||||
disabled={!Boolean(formItem?.expedition_vendor)}
|
||||
isError={
|
||||
isRepeaterInputError(idx, 'transport_per_item')
|
||||
.isError
|
||||
|
||||
@@ -185,7 +185,12 @@ const PurchaseAcceptApprovalItemObjectSchema: Yup.ObjectSchema<PurchaseAcceptApp
|
||||
.typeError('No. Surat jalan wajib diisi!'),
|
||||
vehicle_number: Yup.string()
|
||||
.nullable()
|
||||
.optional()
|
||||
.when('expedition_vendor', {
|
||||
is: (expeditionVendor?: { value?: number; label?: string } | null) =>
|
||||
Boolean(expeditionVendor?.value),
|
||||
then: (schema) => schema.required('Nomor kendaraan wajib diisi!'),
|
||||
otherwise: (schema) => schema.optional(),
|
||||
})
|
||||
.typeError('Nomor kendaraan harus berupa plat nomor!'),
|
||||
expedition_vendor: Yup.object({
|
||||
value: Yup.number().min(1).required(),
|
||||
@@ -213,7 +218,13 @@ const PurchaseAcceptApprovalItemObjectSchema: Yup.ObjectSchema<PurchaseAcceptApp
|
||||
.typeError('Jumlah diterima harus berupa angka!'),
|
||||
transport_per_item: Yup.mixed<string | number>()
|
||||
.nullable()
|
||||
.optional()
|
||||
.when('expedition_vendor', {
|
||||
is: (expeditionVendor?: { value?: number; label?: string } | null) =>
|
||||
Boolean(expeditionVendor?.value),
|
||||
then: (schema) =>
|
||||
schema.required('Biaya transport per item wajib diisi!'),
|
||||
otherwise: (schema) => schema.optional(),
|
||||
})
|
||||
.test(
|
||||
'is-valid-transport-per-item',
|
||||
'Biaya transport per item harus berupa angka lebih dari atau sama dengan 0!',
|
||||
|
||||
Reference in New Issue
Block a user