diff --git a/.env.example b/.env.example index 49012629..c6150f34 100644 --- a/.env.example +++ b/.env.example @@ -16,4 +16,4 @@ VUE_APP_NOTIF_APP_ID=BOPIS VUE_APP_NOTIF_ENUM_TYPE_ID=NOTIF_BOPIS VUE_APP_FIREBASE_CONFIG={"apiKey": "","authDomain": "","databaseURL": "","projectId": "","storageBucket": "","messagingSenderId": "","appId": ""} VUE_APP_FIREBASE_VAPID_KEY="" -VUE_APP_PRODUCT_STORE_SETTING_ENUMS={"ENABLE_TRACKING": {"enumId": "ENABLE_TRACKING","enumName": "Enable tracking","enumTypeId": "PROD_STR_STNG","description": "Enable tracking in BOPIS app"}, "PRINT_PACKING_SLIPS": {"enumId": "PRINT_PACKING_SLIPS","enumName": "Generate packing slips","enumTypeId": "PROD_STR_STNG","description": "Generate packing slips in BOPIS app"}, "PRINT_PICKLISTS": {"enumId": "wPRINT_PICKLISTS","enumName": "Print picklists","enumTypeId": "PROD_STR_STNG","description": "Print picklists in BOPIS app"}, "SHOW_SHIPPING_ORDERS": {"enumId": "SHOW_SHIPPING_ORDERS","enumName": "Show shipping orders","enumTypeId": "PROD_STR_STNG","description": "Show shipping orders in BOPIS app"}} +VUE_APP_PRODUCT_STORE_SETTING_ENUMS={"ENABLE_TRACKING": {"enumId": "ENABLE_TRACKING","enumName": "Enable tracking","enumTypeId": "PROD_STR_STNG","description": "Enable tracking in BOPIS app"}, "PRINT_PACKING_SLIPS": {"enumId": "PRINT_PACKING_SLIPS","enumName": "Generate packing slips","enumTypeId": "PROD_STR_STNG","description": "Generate packing slips in BOPIS app"}, "PRINT_PICKLISTS": {"enumId": "PRINT_PICKLISTS","enumName": "Print picklists","enumTypeId": "PROD_STR_STNG","description": "Print picklists in BOPIS app"}, "SHOW_SHIPPING_ORDERS": {"enumId": "SHOW_SHIPPING_ORDERS","enumName": "Show shipping orders","enumTypeId": "PROD_STR_STNG","description": "Show shipping orders in BOPIS app"}} diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 1f708f29..3c52c921 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -114,7 +114,7 @@ const actions: ActionTree ={ const orderQueryPayload = prepareOrderQuery({ ...payload, - shipmentMethodTypeId: !store.state.user.preference.showShippingOrders ? 'STOREPICKUP' : '', + shipmentMethodTypeId: !store.state.user.bopisProductStoreSettings['SHOW_SHIPPING_ORDERS'] ? 'STOREPICKUP' : '', '-shipmentStatusId': '(SHIPMENT_PACKED OR SHIPMENT_SHIPPED)', '-fulfillmentStatus': '(Cancelled OR Rejected)', orderStatusId: 'ORDER_APPROVED', @@ -234,7 +234,7 @@ const actions: ActionTree ={ const orderQueryPayload = prepareOrderQuery({ ...payload, - shipmentMethodTypeId: !store.state.user.preference.showShippingOrders ? 'STOREPICKUP' : '', + shipmentMethodTypeId: !store.state.user.bopisProductStoreSettings['SHOW_SHIPPING_ORDERS'] ? 'STOREPICKUP' : '', orderTypeId: 'SALES_ORDER' }) @@ -335,7 +335,7 @@ const actions: ActionTree ={ let resp; const orderQueryPayload = prepareOrderQuery({ ...payload, - shipmentMethodTypeId: !store.state.user.preference.showShippingOrders ? 'STOREPICKUP' : '', + shipmentMethodTypeId: !store.state.user.bopisProductStoreSettings['SHOW_SHIPPING_ORDERS'] ? 'STOREPICKUP' : '', shipmentStatusId: "SHIPMENT_PACKED", orderTypeId: 'SALES_ORDER', '-fulfillmentStatus': '(Cancelled OR Rejected)', @@ -421,7 +421,7 @@ const actions: ActionTree ={ let resp; const orderQueryPayload = prepareOrderQuery({ ...payload, - shipmentMethodTypeId: !store.state.user.preference.showShippingOrders ? 'STOREPICKUP' : '', + shipmentMethodTypeId: !store.state.user.bopisProductStoreSettings['SHOW_SHIPPING_ORDERS'] ? 'STOREPICKUP' : '', orderItemStatusId: "ITEM_COMPLETED", orderTypeId: 'SALES_ORDER', docType: 'ORDER' @@ -541,7 +541,7 @@ const actions: ActionTree ={ async packShipGroupItems ({ state, dispatch, commit }, payload) { emitter.emit("presentLoader") - if (store.state.user.preference.configurePicker && payload.order.isPicked !== 'Y') { + if (store.state.user.bopisProductStoreSettings['ENABLE_TRACKING'] && payload.order.isPicked !== 'Y') { let resp; const items = payload.order.parts[0].items; diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index e893d42d..7b9cff6c 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -14,7 +14,7 @@ - + @@ -79,7 +79,7 @@

{{ order.shippingInstructions }}

- + {{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }} @@ -313,15 +313,14 @@ export default defineComponent({ ...mapGetters({ order: "order/getCurrent", currentFacility: 'user/getCurrentFacility', - configurePicker: "user/configurePicker", partialOrderRejectionConfig: 'user/getPartialOrderRejectionConfig', getPaymentMethodDesc: 'util/getPaymentMethodDesc', getStatusDesc: 'util/getStatusDesc', - showPackingSlip: 'user/showPackingSlip', getProduct: 'product/getProduct', getProductStock: 'stock/getProductStock', getfacilityTypeDesc: 'util/getFacilityTypeDesc', getPartyName: 'util/getPartyName', + getBopisProductStoreSettings: 'user/getBopisProductStoreSettings' }) }, props: ['orderType', 'orderId', 'orderPartSeqId'], @@ -395,7 +394,7 @@ export default defineComponent({ return rejectOrderModal.present(); }, async readyForPickup(order: any, part: any) { - if(this.configurePicker && order.isPicked !== 'Y') return this.assignPicker(order, part, this.currentFacility.facilityId); + if(this.getBopisProductStoreSettings('ENABLE_TRACKING') && order.isPicked !== 'Y') return this.assignPicker(order, part, this.currentFacility.facilityId); const pickup = part?.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP'; const header = pickup ? translate('Ready for pickup') : translate('Ready to ship'); const message = pickup ? translate('An email notification will be sent to that their order is ready for pickup. This order will also be moved to the packed orders tab.', { customerName: order.customer.name, space: '

' }) : ''; diff --git a/src/views/Orders.vue b/src/views/Orders.vue index 41acf68b..b95a4113 100644 --- a/src/views/Orders.vue +++ b/src/views/Orders.vue @@ -72,7 +72,7 @@ {{ order.part.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP' ? translate("Ready for pickup") : translate("Ready to ship") }}
- + @@ -86,7 +86,7 @@

{{ order.customer.name }}

{{ order.orderName ? order.orderName : order.orderId }}

-

{{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }}

+

{{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }}

{{ timeFromNow(order.placedDate) }} @@ -118,7 +118,7 @@ {{ order.part.shipmentMethodEnum.shipmentMethodEnumId === 'STOREPICKUP' ? translate("Handover") : translate("Ship") }} - + @@ -252,15 +252,13 @@ export default defineComponent({ orders: 'order/getOpenOrders', packedOrders: 'order/getPackedOrders', completedOrders: 'order/getCompletedOrders', - configurePicker: "user/configurePicker", currentFacility: 'user/getCurrentFacility', isPackedOrdersScrollable: 'order/isPackedOrdersScrollable', isOpenOrdersScrollable: 'order/isOpenOrdersScrollable', isCompletedOrdersScrollable: 'order/isCompletedOrdersScrollable', - showPackingSlip: 'user/showPackingSlip', notifications: 'user/getNotifications', unreadNotificationsStatus: 'user/getUnreadNotificationsStatus', - printPicklistPref: 'user/printPicklistPref' + getBopisProductStoreSettings: 'user/getBopisProductStoreSettings' }) }, data() { @@ -393,7 +391,7 @@ export default defineComponent({ } }, async readyForPickup (order: any, part: any) { - if(this.configurePicker && order.isPicked !== 'Y') return this.assignPicker(order, part, this.currentFacility.facilityId); + if(this.getBopisProductStoreSettings('ENABLE_TRACKING') && order.isPicked !== 'Y') return this.assignPicker(order, part, this.currentFacility.facilityId); const pickup = part.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP'; const header = pickup ? translate('Ready for pickup') : translate('Ready to ship'); const message = pickup ? translate('An email notification will be sent to that their order is ready for pickup. This order will also be moved to the packed orders tab.', { customerName: order.customer.name, space: '

'}) : ''; @@ -516,7 +514,7 @@ export default defineComponent({ return; } - if(!this.configurePicker) { + if(!this.getBopisProductStoreSettings('ENABLE_TRACKING')) { try { const resp = await UserService.ensurePartyRole({ partyId: "_NA_", diff --git a/src/views/Settings.vue b/src/views/Settings.vue index c138ca87..1b4325cd 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -268,14 +268,11 @@ export default defineComponent({ userProfile: 'user/getUserProfile', currentFacility: 'user/getCurrentFacility', currentEComStore: 'user/getCurrentEComStore', - configurePicker: "user/configurePicker", showShippingOrders: 'user/showShippingOrders', - showPackingSlip: 'user/showPackingSlip', partialOrderRejectionConfig: 'user/getPartialOrderRejectionConfig', firebaseDeviceId: 'user/getFirebaseDeviceId', notificationPrefs: 'user/getNotificationPrefs', allNotificationPrefs: 'user/getAllNotificationPrefs', - printPicklistPref: "user/printPicklistPref", getBopisProductStoreSettings: "user/getBopisProductStoreSettings" }) },