Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: used product store settings inplace of userpreference everywhere #441

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
10 changes: 5 additions & 5 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

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',
Expand Down Expand Up @@ -234,7 +234,7 @@

const orderQueryPayload = prepareOrderQuery({
...payload,
shipmentMethodTypeId: !store.state.user.preference.showShippingOrders ? 'STOREPICKUP' : '',
shipmentMethodTypeId: !store.state.user.bopisProductStoreSettings['SHOW_SHIPPING_ORDERS'] ? 'STOREPICKUP' : '',
orderTypeId: 'SALES_ORDER'
})

Expand Down Expand Up @@ -335,7 +335,7 @@
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)',
Expand Down Expand Up @@ -421,7 +421,7 @@
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'
Expand Down Expand Up @@ -530,7 +530,7 @@
return resp;
},

async packDeliveryItems ({ commit }, shipmentId) {

Check warning on line 533 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 533 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
const params = {
shipmentId: shipmentId,
statusId: 'SHIPMENT_PACKED'
Expand All @@ -541,7 +541,7 @@
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;
Expand Down Expand Up @@ -665,7 +665,7 @@
}).catch(err => err);
},

async rejectOrderItems ({ commit }, order) {

Check warning on line 668 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 668 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
const payload = {
'orderId': order.orderId
}
Expand Down Expand Up @@ -1075,7 +1075,7 @@

const orderQueryPayload = prepareOrderQuery(params)

let resp, total, shipGroups = [];

Check warning on line 1078 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'total' is defined but never used

Check warning on line 1078 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'total' is defined but never used
const facilityTypeIds: Array<string> = [];

try {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const handleParameterMatching = (orderVal: any, parameterVal: any, operation?: s

const getOrderCategory = (order: any) => {

if(!store.state.user.preference.showShippingOrders) {
if(!store.state.user.bopisProductStoreSettings['SHOW_SHIPPING_ORDERS']) {
orderCategoryParameters["Open"]["shipmentMethodTypeId"] = { value: "STOREPICKUP" }
orderCategoryParameters["Packed"]["shipmentMethodTypeId"] = { value: "STOREPICKUP" }
orderCategoryParameters["Completed"]["shipmentMethodTypeId"] = { value: "STOREPICKUP" }
Expand Down
9 changes: 4 additions & 5 deletions src/views/OrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ion-button v-if="orderType === 'open'" class="ion-hide-md-up" :disabled="!order?.orderId || !hasPermission(Actions.APP_ORDER_UPDATE) || order.readyToHandover || order.readyToShip || order.rejected" @click="rejectOrder()">
<ion-icon slot="icon-only" color="danger" :icon="bagRemoveOutline" />
</ion-button>
<ion-button v-else-if="orderType === 'packed' && showPackingSlip" :class="order.part?.shipmentMethodEnum?.shipmentMethodEnumId !== 'STOREPICKUP' ? 'ion-hide-md-up' : ''" :disabled="!order?.orderId || !hasPermission(Actions.APP_ORDER_UPDATE) || order.handovered || order.shipped" @click="order.part?.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP' ? printPackingSlip(order) : printShippingLabelAndPackingSlip(order)">
<ion-button v-else-if="orderType === 'packed' && getBopisProductStoreSettings('PRINT_PACKING_SLIPS')" :class="order.part?.shipmentMethodEnum?.shipmentMethodEnumId !== 'STOREPICKUP' ? 'ion-hide-md-up' : ''" :disabled="!order?.orderId || !hasPermission(Actions.APP_ORDER_UPDATE) || order.handovered || order.shipped" @click="order.part?.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP' ? printPackingSlip(order) : printShippingLabelAndPackingSlip(order)">
<ion-icon slot="icon-only" :icon="printOutline" />
</ion-button>
</ion-buttons>
Expand Down Expand Up @@ -79,7 +79,7 @@
<p>{{ order.shippingInstructions }}</p>
</ion-label>
</ion-item>
<ion-item v-if="orderType === 'packed' && configurePicker && order.pickers" lines="none">
<ion-item v-if="orderType === 'packed' && getBopisProductStoreSettings('ENABLE_TRACKING') && order.pickers" lines="none">
<ion-label>
{{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }}
</ion-label>
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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: '<br/><br/>' }) : '';
Expand Down
14 changes: 6 additions & 8 deletions src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{{ order.part.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP' ? translate("Ready for pickup") : translate("Ready to ship") }}
</ion-button>
<div></div>
<ion-button v-if="printPicklistPref" slot="end" fill="clear" @click.stop="printPicklist(order, order.part)">
<ion-button v-if="getBopisProductStoreSettings('PRINT_PICKLISTS')" slot="end" fill="clear" @click.stop="printPicklist(order, order.part)">
<ion-icon :icon="printOutline" slot="icon-only" />
</ion-button>
</div>
Expand All @@ -86,7 +86,7 @@
<ion-label class="ion-text-wrap">
<h1>{{ order.customer.name }}</h1>
<p>{{ order.orderName ? order.orderName : order.orderId }}</p>
<p v-if="configurePicker">{{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }}</p>
<p v-if="getBopisProductStoreSettings('ENABLE_TRACKING')">{{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }}</p>
</ion-label>
<ion-badge v-if="order.placedDate" color="dark" slot="end">{{ timeFromNow(order.placedDate) }}</ion-badge>
</ion-item>
Expand Down Expand Up @@ -118,7 +118,7 @@
<ion-button :disabled="!hasPermission(Actions.APP_ORDER_UPDATE)" fill="clear" @click.stop="deliverShipment(order)">
{{ order.part.shipmentMethodEnum.shipmentMethodEnumId === 'STOREPICKUP' ? translate("Handover") : translate("Ship") }}
</ion-button>
<ion-button v-if="showPackingSlip" fill="clear" slot="end" @click.stop="printPackingSlip(order)">
<ion-button v-if="getBopisProductStoreSettings('PRINT_PACKING_SLIPS')" fill="clear" slot="end" @click.stop="printPackingSlip(order)">
<ion-icon slot="icon-only" :icon="printOutline" />
</ion-button>
<ion-button v-if="order.part.shipmentMethodEnum.shipmentMethodEnumId === 'STOREPICKUP'" fill="clear" slot="end" @click.stop="sendReadyForPickupEmail(order)">
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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: '<br/><br/>'}) : '';
Expand Down Expand Up @@ -516,7 +514,7 @@ export default defineComponent({
return;
}

if(!this.configurePicker) {
if(!this.getBopisProductStoreSettings('ENABLE_TRACKING')) {
try {
const resp = await UserService.ensurePartyRole({
partyId: "_NA_",
Expand Down
4 changes: 0 additions & 4 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,10 @@ 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"
})
},
Expand Down
Loading