diff --git a/.env.example b/.env.example index c15fca79..317ddb22 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ VUE_APP_I18N_FALLBACK_LOCALE=en-US VUE_APP_CACHE_MAX_AGE=3600 VUE_APP_VIEW_SIZE=10 VUE_APP_BASE_URL= -VUE_APP_PERMISSION_ID= +VUE_APP_PERMISSION_ID="FULFILLMENT_APP_VIEW" VUE_APP_ALIAS={} VUE_APP_MAPPING_TYPES={"IMPORD": "IMP_ORD_MAPPING_PREF","EXPORD": "EXP_PKD_ORD_MAP_PREF"} VUE_APP_MAPPING_IMPORD={"orderId": { "label": "Order ID", "value": "" }, "facilityId": { "label": "Facility ID", "value": "" },"trackingCode": { "label": "Tracking Code", "value": "" }} diff --git a/package-lock.json b/package-lock.json index df9816f7..104b626f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "fulfillment", - "version": "2.9.3", + "version": "2.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fulfillment", - "version": "2.9.3", + "version": "2.10.0", "dependencies": { "@capacitor/android": "^2.4.7", "@capacitor/core": "^2.4.7", "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.2", + "@hotwax/dxp-components": "^1.15.3", "@hotwax/oms-api": "^1.14.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", @@ -2798,9 +2798,9 @@ "integrity": "sha512-zpUjGoY7LBlKeiP0V7tonrmoey8HQ5THQmyixQ+IDtrjmEJNBjynW/Ef3gC0FUNNPuVqxWPZdT5CVgaETLGTwg==" }, "node_modules/@hotwax/dxp-components": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.2.tgz", - "integrity": "sha512-0jF1xkRIVrDbJwUaaPwWUhp3cVBpdjgAJO/fOQ4XYjzKb8rYXgw0Xm/qHHUnSeAZW5laMnQrm1KtPZp8szu4dQ==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.3.tgz", + "integrity": "sha512-D8PXmlDV1TJNlDt0p2mydXBvWJrNWqiRASYPNy0YiiaMaMUALvGD1Ak6w+4mCsFuadiWcbxBtFyBFfAMDWULIQ==", "dependencies": { "@hotwax/oms-api": "^1.8.1", "@ionic/core": "^7.6.0", diff --git a/package.json b/package.json index 9c43ed7e..eddb4ae3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fulfillment", - "version": "2.9.3", + "version": "2.10.0", "private": true, "description": "An Ionic project", "scripts": { @@ -16,7 +16,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.2", + "@hotwax/dxp-components": "^1.15.3", "@hotwax/oms-api": "^1.14.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", diff --git a/src/authorization/Rules.ts b/src/authorization/Rules.ts index 182507f5..37c76379 100644 --- a/src/authorization/Rules.ts +++ b/src/authorization/Rules.ts @@ -25,5 +25,6 @@ export default { "APP_COLLATERAL_REJECTION_CONFIG_UPDATE": "COMMON_ADMIN", "APP_UPDT_FULFILL_FORCE_SCAN_CONFIG": "COMMON_ADMIN", "APP_ORGANIZATION_HEADER_VIEW": "SFA_ADMIN OR CARRIER_SETUP_VIEW OR FF_ORDER_LOOKUP_VIEW", - "APP_REJECTIONS_VIEW": "SFA_ADMIN" + "APP_REJECTIONS_VIEW": "SFA_ADMIN", + "FULFILLMENT_APP_VIEW": "FULFILLMENT_APP_VIEW" } as any \ No newline at end of file diff --git a/src/components/GenerateTrackingCodeModal.vue b/src/components/GenerateTrackingCodeModal.vue index f145cb48..456dfe66 100644 --- a/src/components/GenerateTrackingCodeModal.vue +++ b/src/components/GenerateTrackingCodeModal.vue @@ -55,7 +55,7 @@ - + diff --git a/src/components/ScanOrderItemModal.vue b/src/components/ScanOrderItemModal.vue index 2795df22..ee4942e5 100644 --- a/src/components/ScanOrderItemModal.vue +++ b/src/components/ScanOrderItemModal.vue @@ -133,8 +133,9 @@ export default defineComponent({ let currentItem = {} as any; const item = this.orderItems.find((orderItem: any) => { - if(orderItem.productSku === payload) currentItem = orderItem - return orderItem.productSku === payload && !orderItem.isChecked; + const itemVal = getProductIdentificationValue(this.productIdentificationPref.primaryId, this.getProduct(orderItem.productId)) ? getProductIdentificationValue(this.productIdentificationPref.primaryId, this.getProduct(orderItem.productId)) : orderItem.productSku + if(itemVal === payload) currentItem = orderItem; + return itemVal === payload && !orderItem.isChecked; }); if(item) { diff --git a/src/services/UserService.ts b/src/services/UserService.ts index 8e96b9bd..0fbdb968 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -85,12 +85,12 @@ const recycleOutstandingOrders = async(payload: any): Promise => { }) } -const getEComStores = async (token: any, facilityId: any): Promise => { +const getEComStores = async (token: any, facility: any): Promise => { try { const params = { "inputFields": { "storeName_op": "not-empty", - facilityId + facilityId: facility.facilityId }, "fieldList": ["productStoreId", "storeName"], "entityName": "ProductStoreFacilityDetail", @@ -110,12 +110,21 @@ const getEComStores = async (token: any, facilityId: any): Promise => { } }); if (hasError(resp)) { - return Promise.reject(resp.data); + // Following promise reject pattern as OMS api, to show error message on the login page. + return Promise.reject({ + code: 'error', + message: `Failed to fetch product stores for ${facility.facilityName} facility.`, + serverResponse: resp.data + }) } else { return Promise.resolve(resp.data.docs); } } catch(error: any) { - return Promise.reject(error) + return Promise.reject({ + code: 'error', + message: 'Something went wrong', + serverResponse: error + }) } } diff --git a/src/store/modules/orderLookup/actions.ts b/src/store/modules/orderLookup/actions.ts index 9744d6be..8dfe7dec 100644 --- a/src/store/modules/orderLookup/actions.ts +++ b/src/store/modules/orderLookup/actions.ts @@ -185,6 +185,7 @@ const actions: ActionTree = { statusId: "PAYMENT_CANCELLED", statusId_op: "notEqual" }, + orderBy: "createdDate DESC", viewSize: 50, fieldList: ["paymentMethodTypeId", "maxAmount", "statusId"], entityName: "OrderPaymentPreference" diff --git a/src/store/modules/transferorder/actions.ts b/src/store/modules/transferorder/actions.ts index a00855e8..a005fbea 100644 --- a/src/store/modules/transferorder/actions.ts +++ b/src/store/modules/transferorder/actions.ts @@ -7,9 +7,10 @@ import { hasError } from '@/adapter' import * as types from './mutation-types' import { escapeSolrSpecialChars, prepareOrderQuery } from '@/utils/solrHelper' import logger from '@/logger' -import { shopifyImgContext, translate } from '@hotwax/dxp-components' +import { getProductIdentificationValue, useProductIdentificationStore, translate } from '@hotwax/dxp-components' import { showToast } from "@/utils"; import { UtilService } from '@/services/UtilService' +import store from "@/store"; const actions: ActionTree = { @@ -278,7 +279,14 @@ const actions: ActionTree = { async updateOrderProductCount({ commit, state }, payload ) { // When there exists multiple line item for a single product, then may arise discrepancy in scanning // since some items might be completed and some pending. Hence searching is done with status check. - const item = state.current.items.find((item: any) => (item.internalName === payload && item.statusId !== 'ITEM_COMPLETED' && item.statusId !== 'ITEM_REJECTED' && item.statusId !== 'ITEM_CANCELLED')); + const getProduct = store.getters['product/getProduct']; + const productIdentificationStore = useProductIdentificationStore() + const productIdentificationPref = productIdentificationStore.getProductIdentificationPref.primaryId + + const item = state.current.items.find((orderItem: any) => { + const itemVal = getProductIdentificationValue(productIdentificationPref, getProduct(orderItem.productId)) ? getProductIdentificationValue(productIdentificationPref, getProduct(orderItem.productId)) : orderItem.internalName; + return itemVal === payload && orderItem.statusId !== 'ITEM_COMPLETED' && orderItem.statusId !== 'ITEM_REJECTED' && orderItem.statusId !== 'ITEM_CANCELLED'; + }) if(item){ item.pickedQuantity = parseInt(item.pickedQuantity) + 1; commit(types.ORDER_CURRENT_UPDATED, state.current ) diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index b0447921..dded57a2 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -72,7 +72,7 @@ const actions: ActionTree = { // TODO Use a separate API for getting facilities, this should handle user like admin accessing the app const currentFacility = userProfile.facilities[0]; - userProfile.stores = await UserService.getEComStores(token, currentFacility.facilityId); + userProfile.stores = await UserService.getEComStores(token, currentFacility); let preferredStore = userProfile.stores[0] @@ -187,22 +187,28 @@ const actions: ActionTree = { // Hence displaying loader to not allowing user to navigate to orders page to avoid wrong results. emitter.emit('presentLoader', {message: 'Updating facility', backdropDismiss: false}) - const userProfile = JSON.parse(JSON.stringify(state.current as any)); - userProfile.stores = await UserService.getEComStores(undefined, payload.facility.facilityId); + try { + const userProfile = JSON.parse(JSON.stringify(state.current as any)); + userProfile.stores = await UserService.getEComStores(undefined, payload.facility); - let preferredStore = userProfile.stores[0]; - const preferredStoreId = await UserService.getPreferredStore(undefined); + let preferredStore = userProfile.stores[0]; + const preferredStoreId = await UserService.getPreferredStore(undefined); - if (preferredStoreId) { - const store = userProfile.stores.find((store: any) => store.productStoreId === preferredStoreId); - store && (preferredStore = store) + if (preferredStoreId) { + const store = userProfile.stores.find((store: any) => store.productStoreId === preferredStoreId); + store && (preferredStore = store) + } + commit(types.USER_INFO_UPDATED, userProfile); + commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); + commit(types.USER_CURRENT_ECOM_STORE_UPDATED, preferredStore); + this.dispatch('order/clearOrders') + await dispatch('getDisableShipNowConfig') + await dispatch('getDisableUnpackConfig') + } catch(error: any) { + logger.error(error); + showToast(error?.message ? error.message : translate("Something went wrong")) } - commit(types.USER_INFO_UPDATED, userProfile); - commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); - commit(types.USER_CURRENT_ECOM_STORE_UPDATED, preferredStore); - this.dispatch('order/clearOrders') - await dispatch('getDisableShipNowConfig') - await dispatch('getDisableUnpackConfig') + emitter.emit('dismissLoader') }, diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index bad82ac9..189acee0 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -145,7 +145,6 @@

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(productComponent.productIdTo)) }}

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(productComponent.productIdTo)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(productComponent.productIdTo)) : productComponent.productIdTo }} - {{ translate("Kit") }}

{{ getFeature(getProduct(productComponent.productIdTo).featureHierarchy, '1/COLOR/')}} {{ getFeature(getProduct(productComponent.productIdTo).featureHierarchy, '1/SIZE/')}}

diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index ac09d857..4df9145f 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -126,14 +126,17 @@ {{ translate("Payment") }}
- +

{{ orderPayment.methodTypeId }}

{{ translate(getPaymentMethodDesc(orderPayment.methodTypeId)) || orderPayment.methodTypeId }} {{ translate(getStatusDesc(orderPayment.paymentStatus)) }}
-

{{ formatCurrency(orderPayment.amount, order.currencyUom) }}

+
+ {{ translate("Latest") }} + {{ formatCurrency(orderPayment.amount, order.currencyUom) }} +