mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
fix: adjust initialPricePerConvertion value
This commit is contained in:
+12
-13
@@ -126,18 +126,14 @@ const DeliveryOrderProductForm = ({
|
|||||||
Number(initialValues.total_peti)
|
Number(initialValues.total_peti)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
// const initialPricePerConvertion =
|
const initialPricePerConvertion =
|
||||||
// initialValues?.total_price &&
|
initialValues?.total_price &&
|
||||||
// initialValues?.total_peti &&
|
initialValues?.total_peti &&
|
||||||
// Number(initialValues.total_peti) !== 0
|
Number(initialValues.total_peti) !== 0
|
||||||
// ? (Number(initialValues.total_price) -
|
? (Number(initialValues.total_price) -
|
||||||
// initialSisaBerat * Number(initialValues.unit_price || 0)) /
|
initialSisaBerat * Number(initialValues.unit_price || 0)) /
|
||||||
// Number(initialValues.total_peti)
|
Number(initialValues.total_peti)
|
||||||
// : 0;
|
: Number(initialValues?.unit_price || 0);
|
||||||
|
|
||||||
const initialPricePerConvertion = initialValues?.unit_price
|
|
||||||
? Number(initialValues?.unit_price)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
const initialPriceSisaBerat =
|
const initialPriceSisaBerat =
|
||||||
initialValues?.total_price && initialValues?.total_peti
|
initialValues?.total_price && initialValues?.total_peti
|
||||||
@@ -728,7 +724,7 @@ const DeliveryOrderProductForm = ({
|
|||||||
placeholder='Masukan Total Peti'
|
placeholder='Masukan Total Peti'
|
||||||
endAdornment={
|
endAdornment={
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<span className='text-sm text-base-content/50'>Kg</span>
|
<span className='text-sm text-base-content/50'>Peti</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
bottomLabel={`1 ${formik.values.convertion_unit?.value.toLowerCase()} = ${formik.values.weight_per_convertion ?? 0} Kg`}
|
bottomLabel={`1 ${formik.values.convertion_unit?.value.toLowerCase()} = ${formik.values.weight_per_convertion ?? 0} Kg`}
|
||||||
@@ -778,6 +774,9 @@ const DeliveryOrderProductForm = ({
|
|||||||
}
|
}
|
||||||
errorMessage={formik.errors.total_weight}
|
errorMessage={formik.errors.total_weight}
|
||||||
placeholder='Masukan Total Bobot'
|
placeholder='Masukan Total Bobot'
|
||||||
|
disabled={
|
||||||
|
formik.values.convertion_unit?.value.toLowerCase() === 'peti'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
+12
-13
@@ -61,18 +61,14 @@ const SalesOrderProductForm = ({
|
|||||||
Number(initialValues.total_peti)
|
Number(initialValues.total_peti)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
// const initialPricePerConvertion =
|
const initialPricePerConvertion =
|
||||||
// initialValues?.total_price &&
|
initialValues?.total_price &&
|
||||||
// initialValues?.total_peti &&
|
initialValues?.total_peti &&
|
||||||
// Number(initialValues.total_peti) !== 0
|
Number(initialValues.total_peti) !== 0
|
||||||
// ? (Number(initialValues.total_price) -
|
? (Number(initialValues.total_price) -
|
||||||
// initialSisaBerat * Number(initialValues.unit_price || 0)) /
|
initialSisaBerat * Number(initialValues.unit_price || 0)) /
|
||||||
// Number(initialValues.total_peti)
|
Number(initialValues.total_peti)
|
||||||
// : 0;
|
: Number(initialValues?.unit_price || 0);
|
||||||
|
|
||||||
const initialPricePerConvertion = initialValues?.unit_price
|
|
||||||
? Number(initialValues?.unit_price)
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
const isInitialTelurQty =
|
const isInitialTelurQty =
|
||||||
initialValues?.marketing_type?.value?.toLowerCase() === 'telur' &&
|
initialValues?.marketing_type?.value?.toLowerCase() === 'telur' &&
|
||||||
@@ -624,7 +620,7 @@ const SalesOrderProductForm = ({
|
|||||||
placeholder='Masukan Total Peti'
|
placeholder='Masukan Total Peti'
|
||||||
endAdornment={
|
endAdornment={
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<span className='text-sm text-base-content/50'>Kg</span>
|
<span className='text-sm text-base-content/50'>Peti</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
bottomLabel={`1 ${formik.values.convertion_unit?.value.toLowerCase()} = ${formik.values.weight_per_convertion ?? 0} Kg`}
|
bottomLabel={`1 ${formik.values.convertion_unit?.value.toLowerCase()} = ${formik.values.weight_per_convertion ?? 0} Kg`}
|
||||||
@@ -674,6 +670,9 @@ const SalesOrderProductForm = ({
|
|||||||
}
|
}
|
||||||
errorMessage={formik.errors.total_weight}
|
errorMessage={formik.errors.total_weight}
|
||||||
placeholder='Masukan Total Bobot'
|
placeholder='Masukan Total Bobot'
|
||||||
|
disabled={
|
||||||
|
formik.values.convertion_unit?.value.toLowerCase() === 'peti'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user