summaryrefslogtreecommitdiff
path: root/src/lib/checkout/components/SectionExpedition.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/checkout/components/SectionExpedition.jsx')
-rw-r--r--src/lib/checkout/components/SectionExpedition.jsx24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/checkout/components/SectionExpedition.jsx b/src/lib/checkout/components/SectionExpedition.jsx
index be40a577..2098d5b5 100644
--- a/src/lib/checkout/components/SectionExpedition.jsx
+++ b/src/lib/checkout/components/SectionExpedition.jsx
@@ -8,6 +8,7 @@ import { useAddress } from '../stores/useAdress';
import currencyFormat from '@/core/utils/currencyFormat';
import { useCheckout } from '../stores/stateCheckout';
+import { formatShipmentRange } from '../utils/functionCheckouit';
function mappingItems(products) {
return products?.map((item) => ({
@@ -32,7 +33,6 @@ function mappingCourier(couriersOdoo, couriers, notIncludeInstant = false) {
return result; // Jika tidak ada, lewati item ini
}
-
if (
notIncludeInstant &&
['hours'].includes(item.shipment_duration_unit.toLowerCase())
@@ -47,7 +47,7 @@ function mappingCourier(couriersOdoo, couriers, notIncludeInstant = false) {
result[courier_code] = {
courier_name: item.courier_name,
courier_code: courier_code,
- courier_id_odoo : carrierId,
+ courier_id_odoo: carrierId,
service_type: {
[courier_service_code]: {
service_name: item.courier_service_name,
@@ -177,7 +177,7 @@ export default function SectionExpedition({ products }) {
mappingCourier(listExpedisi, data?.data?.pricing, notIncludeInstant) ||
null;
- console.log('ini scourier', data?.data?.pricing)
+ console.log('ini scourier', data?.data?.pricing);
const onCourierChange = (e) => {
setIsOpen(false);
@@ -193,7 +193,8 @@ export default function SectionExpedition({ products }) {
}
};
- const onSubmit = (data) => {1
+ const onSubmit = (data) => {
+ 1;
console.log(data);
};
@@ -292,7 +293,10 @@ export default function SectionExpedition({ products }) {
<div className='flex justify-between'>
<span>{selectedService.service_name}</span>
<span className='font-semibold'>
- {currencyFormat(selectedService.price)}
+ {currencyFormat(
+ Math.round(parseInt(selectedService?.price * 1.1) / 1000) *
+ 1000
+ )}
</span>
</div>
) : (
@@ -316,11 +320,17 @@ export default function SectionExpedition({ products }) {
{service.service_name}
</p>
<p className='text-gray-600 text-sm'>
- Estimasi Tiba {service.duration}
+ {formatShipmentRange(
+ service.shipment_range,
+ service.shipment_unit
+ )}
</p>
</div>
<span className='font-semibold'>
- {currencyFormat(service.price)}
+ {currencyFormat(
+ Math.round(parseInt(service?.price * 1.1) / 1000) *
+ 1000
+ )}
</span>
</div>
))}