summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-06-11 13:55:31 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-06-11 13:55:31 +0700
commit54636b53685422d495adce95b491f7b10585cb5c (patch)
tree99b60e655d2796ed3eb051fa029d88ccd79a51dd /src
parent907deb7ca6589b83203b2352a3dd02b631696848 (diff)
parentc644e559eff7320dfe7e08004aba040f9f11cad6 (diff)
Merge branch 'feature/integrasi-biteship' of https://bitbucket.org/altafixco/next-indoteknik into biteship-merge
# Conflicts: # src/lib/checkout/components/Checkout.jsx
Diffstat (limited to 'src')
-rw-r--r--src/lib/checkout/components/Checkout.jsx89
-rw-r--r--src/lib/treckingAwb/api/getManifest.js17
-rw-r--r--src/lib/treckingAwb/component/InformationSection.jsx8
3 files changed, 60 insertions, 54 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index 77053d1c..0dc025f5 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -253,6 +253,7 @@ const Checkout = () => {
return;
}
+
dataVoucher.forEach((addNewLine) => {
if (addNewLine.applyType !== 'shipping') {
// Mencari voucher dalam listVouchers
@@ -362,38 +363,38 @@ const Checkout = () => {
};
}, []);
- const hitungDiscountVoucher = (code, source) => {
- let countDiscount = 0;
- if (source === 'voucher') {
- let dataVoucherIndex = listVouchers.findIndex(
- (voucher) => voucher.code == code
- );
- let dataActiveVoucher = listVouchers[dataVoucherIndex];
-
- countDiscount = dataActiveVoucher.discountVoucher;
- } else {
- let dataVoucherIndex = listVoucherShippings.findIndex(
- (voucher) => voucher.code == code
- );
- let dataActiveVoucher = listVoucherShippings[dataVoucherIndex];
-
- countDiscount = dataActiveVoucher.discountVoucher;
- }
-
- /*if (dataActiveVoucher.discountType === 'percentage') {
- countDiscount = cartCheckout?.subtotal * (dataActiveVoucher.discountAmount / 100)
- if (
- dataActiveVoucher.maxDiscountAmount > 0 &&
- countDiscount > dataActiveVoucher.maxDiscountAmount
- ) {
- countDiscount = dataActiveVoucher.maxDiscountAmount
- }
- } else {
- countDiscount = dataActiveVoucher.discountAmount
- }*/
-
- return countDiscount;
- };
+ // const hitungDiscountVoucher = (code, source) => {
+ // let countDiscount = 0;
+ // if (source === 'voucher') {
+ // let dataVoucherIndex = listVouchers.findIndex(
+ // (voucher) => voucher.code == code
+ // );
+ // let dataActiveVoucher = listVouchers[dataVoucherIndex];
+ //
+ // countDiscount = dataActiveVoucher.discountVoucher;
+ // } else {
+ // let dataVoucherIndex = listVoucherShippings.findIndex(
+ // (voucher) => voucher.code == code
+ // );
+ // let dataActiveVoucher = listVoucherShippings[dataVoucherIndex];
+ //
+ // countDiscount = dataActiveVoucher.discountVoucher;
+ // }
+ //
+ // /*if (dataActiveVoucher.discountType === 'percentage') {
+ // countDiscount = cartCheckout?.subtotal * (dataActiveVoucher.discountAmount / 100)
+ // if (
+ // dataActiveVoucher.maxDiscountAmount > 0 &&
+ // countDiscount > dataActiveVoucher.maxDiscountAmount
+ // ) {
+ // countDiscount = dataActiveVoucher.maxDiscountAmount
+ // }
+ // } else {
+ // countDiscount = dataActiveVoucher.discountAmount
+ // }*/
+ //
+ // return countDiscount;
+ // };
// useEffect(() => {
// if (!listVouchers) return;
@@ -535,7 +536,11 @@ const Checkout = () => {
return;
}
//new release
- // if (selectedCarrier != 1 && biayaKirim == 0) {
+ // if (!selectedService) {
+ toast.error('Harap pilih tipe layanan pengiriman');
+ return;
+ }
+ if (selectedCourier != 1 && biayaKirim == 0) {
// toast.error('Maaf, layanan tidak tersedia. Mohon pilih expedisi lain.');
// return;
// }
@@ -577,15 +582,15 @@ const Checkout = () => {
delivery_service_type: selectedService?.service_type,
// New release
- // carrier_id: selectedCarrierId,
- // estimated_arrival_days: splitDuration(etd),
- // delivery_service_type: selectedExpedisiService,
+ // carrier_id: selectedCourierId,
+ estimated_arrival_days_start : parseInt(eta_courier_start) + parseInt(productSla),
+ // estimated_arrival_days: parseInt(eta_courier) + parseInt(productSla),
+ // delivery_service_type: selectedService?.service_type,
flash_sale: hasFlashSale, // dibuat negasi untuk ngetest kebalikan nilai false
voucher: activeVoucher,
voucher_shipping: activeVoucherShipping,
type: 'sale_order',
};
-
if (query) {
data.source = 'buy';
}
@@ -1235,7 +1240,7 @@ const Checkout = () => {
</Skeleton>
)}
<Divider />
- <SectionValidation address={selectedAddress.shipping} />
+ <SectionValidation address={selectedAddress.invoicing} />
{/*new-relase*/}
{/*<SectionExpedisi*/}
{/* address={selectedAddress.shipping}*/}
@@ -1250,7 +1255,7 @@ const Checkout = () => {
{/* <SectionListService*/}
{/* listserviceExpedisi={listserviceExpedisi}*/}
{/* setSelectedServiceType={setSelectedServiceType}*/}
- {/* />*/}
+ {/* /> */}
<div className='p-4 flex flex-col gap-y-4'>
{!!products &&
@@ -1541,7 +1546,7 @@ const Checkout = () => {
)}
{products && <SectionExpedition products={products} />}
<Divider />
- <SectionValidation address={selectedAddress.shipping} />
+ <SectionValidation address={selectedAddress.invoicing} />
{/* <SectionExpedisi
address={selectedAddress.shipping}
listExpedisi={listExpedisi}
@@ -1864,9 +1869,7 @@ const SectionValidation = ({ address }) =>
</Link>
</div>
</BottomPopup>
- )
-// )
-;
+ );
const SectionExpedisi = ({
address,
diff --git a/src/lib/treckingAwb/api/getManifest.js b/src/lib/treckingAwb/api/getManifest.js
index 7d78a5f2..5523a164 100644
--- a/src/lib/treckingAwb/api/getManifest.js
+++ b/src/lib/treckingAwb/api/getManifest.js
@@ -1,9 +1,12 @@
-const { default: odooApi } = require("@/core/api/odooApi")
-const { getAuth } = require("@/core/utils/auth")
+const { default: odooApi } = require('@/core/api/odooApi');
+const { getAuth } = require('@/core/utils/auth');
-export const getManifest = async ({id}) => {
- const auth = getAuth()
- const manifest = await odooApi('GET', `/api/v1/partner/${auth.partnerId}/stock-picking/${id}/tracking`)
+export const getManifest = async ({ id }) => {
+ const auth = getAuth();
+ const manifest = await odooApi(
+ 'GET',
+ `/api/v1/partner/${auth.partnerId}/stock-picking/${id}/tracking`
+ );
- return manifest
-} \ No newline at end of file
+ return manifest;
+};
diff --git a/src/lib/treckingAwb/component/InformationSection.jsx b/src/lib/treckingAwb/component/InformationSection.jsx
index 082939b7..a2297af3 100644
--- a/src/lib/treckingAwb/component/InformationSection.jsx
+++ b/src/lib/treckingAwb/component/InformationSection.jsx
@@ -40,10 +40,10 @@ const InformationSection = ({ manifests }) => {
</button>
</div>
</div>
- <div className='grid grid-cols-[150px_auto]'>
- <span>Kurir</span>
- <span className='font-semibold'> : {manifests?.products}</span>
- </div>
+ {/*<div className='grid grid-cols-[150px_auto]'>*/}
+ {/* <span>Barang</span>*/}
+ {/* <span className='font-semibold'>: {manifests?.products}</span>*/}
+ {/*</div>*/}
<div className='grid grid-cols-[150px_auto]'>
<span>Kurir</span>
<span className='font-semibold'>