From 47875e51d3deb32df452548b4c33a43af228c7e3 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 25 Sep 2024 17:18:14 +0530 Subject: [PATCH 1/2] Fixed: discrepacny in state updation of void label shipments (#786) --- src/services/OrderService.ts | 3 +++ src/store/modules/order/actions.ts | 2 +- src/store/modules/orderLookup/actions.ts | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/services/OrderService.ts b/src/services/OrderService.ts index 1a9dc7d0..74fda0da 100644 --- a/src/services/OrderService.ts +++ b/src/services/OrderService.ts @@ -376,6 +376,9 @@ const fetchShipmentPackages = async (shipmentIds: Array, isTrackingRequi if(!isTrackingRequired) { trackingCodeFilters = { "trackingCode_op": "empty", + "trackingCode_grp": "1", + "fetchShipmentPackages_op": "SHRSCS_VOIDED", + "fetchShipmentPackages_grp": "2" } } diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 81aabb53..41848f93 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -214,7 +214,7 @@ const actions: ActionTree = { }, []); // If there is any shipment package with missing tracking code, retry shipping label - const missingLabelImage = this.state.util.productStoreShipmentMethCount > 0 ? currentShipmentPackages.some((shipmentPackage:any) => shipmentPackage.trackingCode === null) : false; + const missingLabelImage = this.state.util.productStoreShipmentMethCount > 0 ? currentShipmentPackages.some((shipmentPackage:any) => shipmentPackage.trackingCode === null || shipmentPackage.trackingCode === '') : false; return { ...order, diff --git a/src/store/modules/orderLookup/actions.ts b/src/store/modules/orderLookup/actions.ts index d8d53632..9744d6be 100644 --- a/src/store/modules/orderLookup/actions.ts +++ b/src/store/modules/orderLookup/actions.ts @@ -341,7 +341,7 @@ const actions: ActionTree = { return orderSegmentInfo }, {}) : [] - let orderShipmentPackages = [] + let orderShipmentPackages = [] as any const shipmentIds = Object.values(orderRouteSegmentInfo).flatMap((routes: any) => routes.map((route: any) => route.shipmentId)); try { @@ -359,6 +359,15 @@ const actions: ActionTree = { return shipment; }, {}); + Object.values(orderRouteSegmentInfo).map((segments: any) => { + segments.map((segment: any) => { + const currentPackage = orderShipmentPackages.find((shipmentPackage: any) => shipmentPackage.shipmentId === segment.shipmentId) + if(currentPackage && currentPackage.carrierServiceStatusId === "SHRSCS_VOIDED") { + segment.trackingIdNumber = "" + } + }) + }) + order["shipmentPackages"] = shipmentPackages; const carrierPartyIds = [] as any; From 6583f174aed5ca12bcf65f280adac479b550f3a4 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 25 Sep 2024 18:07:35 +0530 Subject: [PATCH 2/2] Reverted: check for order procession date validation over void label action (#786) --- src/views/OrderLookupDetail.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index b02f8f49..722ddcba 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -191,7 +191,7 @@

{{ getShipmentMethodDesc(shipGroups[0].shipmentMethodTypeId) || shipGroups[0].shipmentMethodTypeId }}

{{ translate("Tracking Code") }}{{ ":" }} {{ shipGroups[0].trackingIdNumber }} - + @@ -270,7 +270,6 @@ import { IonThumbnail, IonTitle, IonToolbar, - alertController, popoverController } from "@ionic/vue"; import { defineComponent } from "vue"; @@ -278,10 +277,7 @@ import { translate } from '@hotwax/dxp-components'; import { cubeOutline, golfOutline, callOutline, cashOutline, closeCircleOutline, ellipsisVerticalOutline, informationCircleOutline, ribbonOutline, mailOutline, ticketOutline, timeOutline, pulseOutline, storefrontOutline, sunnyOutline, checkmarkDoneOutline, downloadOutline } from "ionicons/icons"; import { mapGetters, useStore } from "vuex"; import { DateTime } from "luxon"; -import { formatCurrency, getColorByDesc, showToast } from "@/utils" -import { OrderService } from "@/services/OrderService"; -import { hasError } from "@/adapter"; -import logger from "@/logger"; +import { formatCurrency, getColorByDesc } from "@/utils" import OrderLookupLabelActionsPopover from '@/components/OrderLookupLabelActionsPopover.vue'; export default defineComponent({ @@ -351,10 +347,6 @@ export default defineComponent({ await this.store.dispatch('stock/fetchStock', { productId, facilityId }) this.isFetchingStock = false }, - isEligibleForVoiding(shipGroup: any) { - const twentyFourHoursInMillis = 24 * 60 * 60 * 1000; // 24 hours in milliseconds - return (DateTime.now().toMillis() - shipGroup.orderDate >= twentyFourHoursInMillis); - }, async shippingLabelActionPopover(ev: Event, shipGroup: any) { const popover = await popoverController.create({ component: OrderLookupLabelActionsPopover,