Skip to content

Commit

Permalink
Merge pull request #811 from R-Sourabh/scaning-productIdentifier
Browse files Browse the repository at this point in the history
Improved: Added support for scanning on selected productIdentifier
  • Loading branch information
ravilodhi authored Oct 14, 2024
2 parents b2684d4 + dcf9f91 commit 2a98db6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/ScanOrderItemModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 10 additions & 2 deletions src/store/modules/transferorder/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TransferOrderState, RootState> = {

Expand Down Expand Up @@ -278,7 +279,14 @@ const actions: ActionTree<TransferOrderState, RootState> = {
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 )
Expand Down

0 comments on commit 2a98db6

Please sign in to comment.