From 703533dd4a554b963451d2835090d8d34edc248d Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 18:17:23 +0530 Subject: [PATCH 1/7] Improved: Added support for scanning on selected productIdentifier --- src/components/ScanOrderItemModal.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ScanOrderItemModal.vue b/src/components/ScanOrderItemModal.vue index 2795df22..a3993b09 100644 --- a/src/components/ScanOrderItemModal.vue +++ b/src/components/ScanOrderItemModal.vue @@ -133,8 +133,8 @@ 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)); + return itemVal === payload; }); if(item) { From 2e641503b7873c562b05f2659ac100ad322313b6 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 18:23:53 +0530 Subject: [PATCH 2/7] Improved: added default scan on product sku --- src/components/ScanOrderItemModal.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ScanOrderItemModal.vue b/src/components/ScanOrderItemModal.vue index a3993b09..4b4f3eba 100644 --- a/src/components/ScanOrderItemModal.vue +++ b/src/components/ScanOrderItemModal.vue @@ -133,8 +133,8 @@ export default defineComponent({ let currentItem = {} as any; const item = this.orderItems.find((orderItem: any) => { - const itemVal = getProductIdentificationValue(this.productIdentificationPref.primaryId, this.getProduct(orderItem.productId)); - return itemVal === payload; + const itemVal = getProductIdentificationValue(this.productIdentificationPref.primaryId, this.getProduct(orderItem.productId)) ? getProductIdentificationValue(this.productIdentificationPref.primaryId, this.getProduct(orderItem.productId)) : orderItem.productSku + return itemVal === payload && !orderItem.isChecked; }); if(item) { From b7c30434cbc39e92ebbdd0415414f00dc3ac8c20 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 18:30:52 +0530 Subject: [PATCH 3/7] Update ScanOrderItemModal.vue --- src/components/ScanOrderItemModal.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ScanOrderItemModal.vue b/src/components/ScanOrderItemModal.vue index 4b4f3eba..0e1c328a 100644 --- a/src/components/ScanOrderItemModal.vue +++ b/src/components/ScanOrderItemModal.vue @@ -134,6 +134,7 @@ export default defineComponent({ let currentItem = {} as any; const item = this.orderItems.find((orderItem: any) => { 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; }); From f7a28cf102da548e0352a07a2f25253d08da2ef7 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 18:31:37 +0530 Subject: [PATCH 4/7] Update ScanOrderItemModal.vue --- src/components/ScanOrderItemModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ScanOrderItemModal.vue b/src/components/ScanOrderItemModal.vue index 0e1c328a..ee4942e5 100644 --- a/src/components/ScanOrderItemModal.vue +++ b/src/components/ScanOrderItemModal.vue @@ -134,7 +134,7 @@ export default defineComponent({ let currentItem = {} as any; const item = this.orderItems.find((orderItem: any) => { 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; + if(itemVal === payload) currentItem = orderItem; return itemVal === payload && !orderItem.isChecked; }); From 85bf53d6f77d0c1752388ead22f856b6e3866258 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 19:52:43 +0530 Subject: [PATCH 5/7] Improved: Added support of scanning on selected identifier for transfer order --- src/store/modules/transferorder/actions.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/store/modules/transferorder/actions.ts b/src/store/modules/transferorder/actions.ts index a00855e8..02069698 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,13 @@ 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 item = state.current.items.find((orderItem: any) => { + const itemVal = getProductIdentificationValue(productIdentificationStore.getProductIdentificationPref.primaryId, getProduct(orderItem.productId)) ? getProductIdentificationValue(productIdentificationStore.getProductIdentificationPref.primaryId, 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 ) From b1170311295179d0433a59bcbaeb8fa67d2f6021 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 19:57:03 +0530 Subject: [PATCH 6/7] Improved: added variable and improve the snippet --- src/store/modules/transferorder/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/modules/transferorder/actions.ts b/src/store/modules/transferorder/actions.ts index 02069698..0e4c8128 100644 --- a/src/store/modules/transferorder/actions.ts +++ b/src/store/modules/transferorder/actions.ts @@ -281,9 +281,10 @@ const actions: ActionTree = { // since some items might be completed and some pending. Hence searching is done with status check. const getProduct = store.getters['product/getProduct']; const productIdentificationStore = useProductIdentificationStore() + let productIdentificationPref = productIdentificationStore.getProductIdentificationPref.primaryId const item = state.current.items.find((orderItem: any) => { - const itemVal = getProductIdentificationValue(productIdentificationStore.getProductIdentificationPref.primaryId, getProduct(orderItem.productId)) ? getProductIdentificationValue(productIdentificationStore.getProductIdentificationPref.primaryId, getProduct(orderItem.productId)) : orderItem.internalName; + 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){ From dcf9f9188cab985cfe08f0a8f3cc25862f9825ba Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 10 Oct 2024 20:03:52 +0530 Subject: [PATCH 7/7] Update actions.ts --- src/store/modules/transferorder/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/transferorder/actions.ts b/src/store/modules/transferorder/actions.ts index 0e4c8128..a005fbea 100644 --- a/src/store/modules/transferorder/actions.ts +++ b/src/store/modules/transferorder/actions.ts @@ -281,7 +281,7 @@ const actions: ActionTree = { // since some items might be completed and some pending. Hence searching is done with status check. const getProduct = store.getters['product/getProduct']; const productIdentificationStore = useProductIdentificationStore() - let productIdentificationPref = productIdentificationStore.getProductIdentificationPref.primaryId + 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;