From 9dafc555037b6a5dc4e94fa759feecb195d7b3b3 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 7 Aug 2024 18:06:32 +0530 Subject: [PATCH 1/7] Improved: Show Completed Shipments Along with Open Shipments (#380) --- src/locales/en.json | 5 +++- src/views/PurchaseOrderDetail.vue | 2 +- src/views/ShipmentDetails.vue | 31 ++++++++++++++++++++---- src/views/Shipments.vue | 39 +++++++++++++++++++++++++++---- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 8d36c657..ef52a19e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -45,6 +45,7 @@ "Inventory can be received for purchase orders in multiple shipments. Proceeding will receive a new shipment for this purchase order but it will still be available for receiving later": "Inventory can be received for purchase orders in multiple shipments. { space } Proceeding will receive a new shipment for this purchase order but it will still be available for receiving later", "item": "item", "Item count": "Item count", + "Item count:": "Item count: {count}", "items": "items", "Load more returns": "Load more returns", "Load more shipments": "Load more shipments", @@ -63,12 +64,13 @@ "OMS": "OMS", "OMS instance": "OMS instance", "Only allow received quantity to be incremented by scanning the barcode of products. If the identifier is not found, the scan will default to using the internal name.": "Only allow received quantity to be incremented by scanning the barcode of products. {space} If the identifier is not found, the scan will default to using the internal name.", + "Open": "Open", "ordered": "ordered", "Orders not found": "Orders not found", "Password": "Password", "Pending: item": "Pending: {itemsCount} item", "Pending: items": "Pending: {itemsCount} items", - "Please provide a valid valid barcode identifier.": "Please provide a valid valid barcode identifier.", + "Please provide a valid barcode identifier.": "Please provide a valid barcode identifier.", "primary identifier": "primary identifier", "Primary identifier": "Primary identifier", "Primary Product Identifier": "Primary Product Identifier", @@ -103,6 +105,7 @@ "Scan items": "Scan items", "Scanned item is not present within the shipment:": "Scanned item is not present within the shipment: {itemName}", "Scanned successfully.": "Scanned {itemName} successfully.", + "Search items": "Search items", "secondary identifier": "secondary identifier", "Secondary identifier": "Secondary identifier", "Search": "Search", diff --git a/src/views/PurchaseOrderDetail.vue b/src/views/PurchaseOrderDetail.vue index c55fc3cf..d0e9e952 100644 --- a/src/views/PurchaseOrderDetail.vue +++ b/src/views/PurchaseOrderDetail.vue @@ -265,7 +265,7 @@ export default defineComponent({ if(this.queryString) payload = this.queryString if(!payload) { - showToast(translate("Please provide a valid valid barcode identifier.")) + showToast(translate("Please provide a valid barcode identifier.")) return; } const result = await this.store.dispatch('order/updateProductCount', payload) diff --git a/src/views/ShipmentDetails.vue b/src/views/ShipmentDetails.vue index 2497d3ba..7a2ae997 100644 --- a/src/views/ShipmentDetails.vue +++ b/src/views/ShipmentDetails.vue @@ -17,16 +17,18 @@

{{ current.externalOrderName ? current.externalOrderName : current.externalOrderId }}

{{ translate("External ID") }}: {{ current.externalId }}

{{ translate("Shipment ID") }}: {{ current.shipmentId }}

+

{{ translate("Item count:", { count: current.items.length }) }}

{{current.trackingIdNumber}} + {{ translate("Completed") }} -
+
- + - + {{ translate("Scan") }}
@@ -167,6 +169,7 @@ export default defineComponent({ facilityLocationsByFacilityId: 'user/getFacilityLocationsByFacilityId', currentFacility: 'user/getCurrentFacility', isForceScanEnabled: 'util/isForceScanEnabled', + barcodeIdentifier: 'util/getBarcodeIdentificationValue' }), }, methods: { @@ -248,7 +251,7 @@ export default defineComponent({ if(this.queryString) payload = this.queryString if(!payload) { - showToast(translate("Please provide a valid valid barcode identifier.")) + showToast(translate("Please provide a valid barcode identifier.")) return; } const result = await this.store.dispatch('shipment/updateShipmentProductCount', payload) @@ -298,6 +301,26 @@ export default defineComponent({ }); return modal.present(); }, + searchProduct() { + if(!this.queryString) { + showToast(translate("Please provide a valid barcode identifier.")) + return; + } + + const scannedElement = document.getElementById(this.queryString); + if(scannedElement) { + this.lastScannedId = this.queryString + scannedElement.scrollIntoView() + + // Scanned product should get un-highlighted after 3s for better experience hence adding setTimeOut + setTimeout(() => { + this.lastScannedId = '' + }, 3000) + } else { + showToast(translate("Scanned item is not present within the shipment:", { itemName: this.queryString })); + } + this.queryString = '' + } }, setup() { const store = useStore(); diff --git a/src/views/Shipments.vue b/src/views/Shipments.vue index 178f0636..faeaa5e9 100644 --- a/src/views/Shipments.vue +++ b/src/views/Shipments.vue @@ -5,11 +5,22 @@ {{ translate("Shipments") }} + +
+ + + + + {{ translate("Open") }} + + + {{ translate("Completed") }} + + +
- -
@@ -44,11 +55,14 @@ import { IonContent, IonHeader, IonIcon, + IonLabel, IonMenuButton, IonPage, IonRefresher, IonRefresherContent, IonSearchbar, + IonSegment, + IonSegmentButton, IonTitle, IonToolbar } from '@ionic/vue'; @@ -65,11 +79,14 @@ export default defineComponent({ IonContent, IonHeader, IonIcon, + IonLabel, IonMenuButton, IonSearchbar, IonPage, IonRefresher, IonRefresherContent, + IonSegment, + IonSegmentButton, IonTitle, IonToolbar, ShipmentListItem @@ -84,7 +101,8 @@ export default defineComponent({ return { queryString: '', fetchingShipments: false, - showErrorMessage: false + showErrorMessage: false, + selectedSegment: "open" } }, ionViewWillEnter () { @@ -104,7 +122,7 @@ export default defineComponent({ const payload = { "inputFields": { "destinationFacilityId": this.user.facilityId, - "statusId": "PURCH_SHIP_SHIPPED", + "statusId": this.selectedSegment === "open" ? "PURCH_SHIP_SHIPPED" : "PURCH_SHIP_RECEIVED", "grp_op": "AND", "shipmentTypeId_value": "INCOMING_SHIPMENT", "shipmentTypeId_op": "equals", @@ -143,6 +161,9 @@ export default defineComponent({ if (event) event.target.complete(); }) }, + segmentChanged(event: any) { + this.getShipments() + } }, setup() { const store = useStore(); @@ -154,4 +175,12 @@ export default defineComponent({ } } }) - \ No newline at end of file + + + \ No newline at end of file From faf022bf62d03134c786cd26bef1a9b167bc2018 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 7 Aug 2024 18:19:32 +0530 Subject: [PATCH 2/7] Reverted: unwanted getter in the shipment details page (#380) --- src/views/ShipmentDetails.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/ShipmentDetails.vue b/src/views/ShipmentDetails.vue index 7a2ae997..2a1cdaf4 100644 --- a/src/views/ShipmentDetails.vue +++ b/src/views/ShipmentDetails.vue @@ -169,7 +169,6 @@ export default defineComponent({ facilityLocationsByFacilityId: 'user/getFacilityLocationsByFacilityId', currentFacility: 'user/getCurrentFacility', isForceScanEnabled: 'util/isForceScanEnabled', - barcodeIdentifier: 'util/getBarcodeIdentificationValue' }), }, methods: { From a193f0aa82991b47e8f220c6780d4042bfc00ce3 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 21 Aug 2024 16:18:04 +0530 Subject: [PATCH 3/7] Improved: added support for showing completed purchase orders (#380) --- src/store/modules/order/actions.ts | 2 +- src/views/PurchaseOrderDetail.vue | 134 +++++++++++++++++------------ src/views/PurchaseOrders.vue | 38 ++++++-- 3 files changed, 114 insertions(+), 60 deletions(-) diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 6f599645..7e1636e2 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -96,7 +96,7 @@ const actions: ActionTree = { }, "query": "docType:ORDER", "filter": [ - `orderTypeId: PURCHASE_ORDER AND orderId: ${orderId} AND orderStatusId: (ORDER_APPROVED OR ORDER_CREATED) AND facilityId: ${this.state.user.currentFacility.facilityId}` + `orderTypeId: PURCHASE_ORDER AND orderId: ${orderId} AND orderStatusId: (ORDER_APPROVED OR ORDER_CREATED OR ORDER_COMPLETED) AND facilityId: ${this.state.user.currentFacility.facilityId}` ] } } diff --git a/src/views/PurchaseOrderDetail.vue b/src/views/PurchaseOrderDetail.vue index d0e9e952..020e255d 100644 --- a/src/views/PurchaseOrderDetail.vue +++ b/src/views/PurchaseOrderDetail.vue @@ -8,7 +8,7 @@ - + @@ -31,15 +31,15 @@
- + - + {{ translate("Scan") }}
- + {{ translate("Pending: items", { itemsCount: getPOItems('pending').length }) }} @@ -48,57 +48,59 @@ - -
-
- - - - - -

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}

-

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

-
-
-
- -
- -
- -
- - - -
-
- -
-
- - {{ translate("Receive All") }} - + -
- - - {{ getPOItemAccepted(item.productId) }} {{ translate("received") }} - -
- -
- {{ item.quantity }} {{ translate("ordered") }} -
-
- - - + {{ translate("Completed: items", { itemsCount: getPOItems('completed').length }) }} @@ -142,7 +144,7 @@
- + {{ translate("Receive And Close") }} @@ -305,6 +307,24 @@ export default defineComponent({ } this.queryString = '' }, + searchProduct() { + if(!this.queryString) { + showToast(translate("Please provide a valid barcode identifier.")) + return; + } + const scannedElement = document.getElementById(this.queryString); + if(scannedElement) { + this.lastScannedId = this.queryString + scannedElement.scrollIntoView() + // Scanned product should get un-highlighted after 3s for better experience hence adding setTimeOut + setTimeout(() => { + this.lastScannedId = '' + }, 3000) + } else { + showToast(translate("Scanned item is not present within the shipment:", { itemName: this.queryString })); + } + this.queryString = '' + }, getPOItems(orderType: string) { if(orderType === 'completed'){ return this.order.items.filter((item: any) => item.orderItemStatusId === 'ITEM_COMPLETED') @@ -378,11 +398,17 @@ export default defineComponent({ return true; } }) + }, + isPOReceived() { + return this.order.orderStatusId === "ORDER_COMPLETED" } }, ionViewWillEnter() { - this.store.dispatch("order/getOrderDetail", { orderId: this.$route.params.slug }).then(() => { - this.store.dispatch('order/getPOHistory', { orderId: this.order.orderId }) + this.store.dispatch("order/getOrderDetail", { orderId: this.$route.params.slug }).then(async () => { + await this.store.dispatch('order/getPOHistory', { orderId: this.order.orderId }) + if(this.isPOReceived()) { + this.showCompletedItems = true; + } }) }, setup() { diff --git a/src/views/PurchaseOrders.vue b/src/views/PurchaseOrders.vue index bb1b392e..4df94eba 100644 --- a/src/views/PurchaseOrders.vue +++ b/src/views/PurchaseOrders.vue @@ -5,11 +5,21 @@ {{ translate("Purchase Orders") }} +
+ + + + + {{ translate("Open") }} + + + {{ translate("Completed") }} + + +
- -
@@ -44,11 +54,14 @@ import { IonContent, IonHeader, IonIcon, + IonLabel, IonMenuButton, IonPage, IonRefresher, IonRefresherContent, IonSearchbar, + IonSegment, + IonSegmentButton, IonTitle, IonToolbar } from '@ionic/vue'; @@ -65,11 +78,14 @@ export default defineComponent({ IonContent, IonHeader, IonIcon, + IonLabel, IonMenuButton, IonPage, IonRefresher, IonRefresherContent, IonSearchbar, + IonSegment, + IonSegmentButton, IonTitle, IonToolbar, PurchaseOrderItem @@ -78,7 +94,8 @@ export default defineComponent({ return { queryString: '', fetchingOrders: false, - showErrorMessage: false + showErrorMessage: false, + selectedSegment: "open" } }, computed: { @@ -105,7 +122,7 @@ export default defineComponent({ "group.ngroups": true, } as any, "query": "*:*", - "filter": `docType: ORDER AND orderTypeId: PURCHASE_ORDER AND orderStatusId: (ORDER_APPROVED OR ORDER_CREATED) AND facilityId: ${this.currentFacility.facilityId}` + "filter": `docType: ORDER AND orderTypeId: PURCHASE_ORDER AND orderStatusId: ${this.selectedSegment === 'open' ? '(ORDER_APPROVED OR ORDER_CREATED)' : 'ORDER_COMPLETED'} AND facilityId: ${this.currentFacility.facilityId}` } } if(this.queryString) { @@ -129,6 +146,9 @@ export default defineComponent({ if (event) event.target.complete(); }) }, + segmentChanged() { + this.getPurchaseOrders(); + } }, mounted () { this.getPurchaseOrders(); @@ -144,4 +164,12 @@ export default defineComponent({ } } }); - \ No newline at end of file + + + \ No newline at end of file From ed1881a9cc41948cfd62f904c2722013a4770561 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 21 Aug 2024 18:16:09 +0530 Subject: [PATCH 4/7] Improved: added support for showing completed returns and updated details page respectively (#380) --- src/locales/en.json | 1 - src/views/PurchaseOrders.vue | 2 +- src/views/ReturnDetails.vue | 28 ++++++++++++++++++------ src/views/Returns.vue | 41 +++++++++++++++++++++++++++++++----- src/views/Shipments.vue | 4 ++-- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index ef52a19e..a046022f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -139,7 +139,6 @@ "There are no purchase orders to receive": "There are no purchase orders to receive", "There are no returns to receive": "There are no returns to receive", "This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.": "This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.", - "This return has been and cannot be edited.": "This return has been {status} and cannot be edited.", "Timezone": "Timezone", "Time zone updated successfully": "Time zone updated successfully", "To close the purchase order, select all.": "To close the purchase order, select all.", diff --git a/src/views/PurchaseOrders.vue b/src/views/PurchaseOrders.vue index 4df94eba..d06e3602 100644 --- a/src/views/PurchaseOrders.vue +++ b/src/views/PurchaseOrders.vue @@ -8,7 +8,7 @@
- + {{ translate("Open") }} diff --git a/src/views/ReturnDetails.vue b/src/views/ReturnDetails.vue index 52508f0e..38b2e4c4 100644 --- a/src/views/ReturnDetails.vue +++ b/src/views/ReturnDetails.vue @@ -25,10 +25,10 @@
- + - + {{ translate("Scan") }}
@@ -157,10 +157,8 @@ export default defineComponent({ }, async ionViewWillEnter() { const current = await this.store.dispatch('return/setCurrent', { shipmentId: this.$route.params.id }) - - if(!this.isReturnReceivable(current.statusId)) { - showToast(translate("This return has been and cannot be edited.", { status: current?.statusDesc?.toLowerCase() })); - } + console.log(this.current); + }, computed: { ...mapGetters({ @@ -280,6 +278,24 @@ export default defineComponent({ }); return modal.present(); }, + searchProduct() { + if(!this.queryString) { + showToast(translate("Please provide a valid barcode identifier.")) + return; + } + const scannedElement = document.getElementById(this.queryString); + if(scannedElement) { + this.lastScannedId = this.queryString + scannedElement.scrollIntoView() + // Scanned product should get un-highlighted after 3s for better experience hence adding setTimeOut + setTimeout(() => { + this.lastScannedId = '' + }, 3000) + } else { + showToast(translate("Scanned item is not present within the shipment:", { itemName: this.queryString })); + } + this.queryString = '' + } }, setup() { const store = useStore(); diff --git a/src/views/Returns.vue b/src/views/Returns.vue index ae3522ca..0195daa7 100644 --- a/src/views/Returns.vue +++ b/src/views/Returns.vue @@ -5,11 +5,22 @@ {{ translate("Returns") }} + +
+ + + + + {{ translate("Open") }} + + + {{ translate("Completed") }} + + +
- -
@@ -44,11 +55,14 @@ import { IonContent, IonHeader, IonIcon, + IonLabel, IonMenuButton, IonPage, IonRefresher, IonRefresherContent, IonSearchbar, + IonSegment, + IonSegmentButton, IonTitle, IonToolbar } from '@ionic/vue'; @@ -65,11 +79,14 @@ export default defineComponent({ IonContent, IonHeader, IonIcon, + IonLabel, IonMenuButton, IonSearchbar, IonPage, IonRefresher, IonRefresherContent, + IonSegment, + IonSegmentButton, IonTitle, IonToolbar, ReturnListItem @@ -84,7 +101,8 @@ export default defineComponent({ return { queryString: '', fetchingReturns: false, - showErrorMessage: false + showErrorMessage: false, + selectedSegment: "open" } }, mounted () { @@ -102,7 +120,9 @@ export default defineComponent({ const payload = { "entityName": "SalesReturnShipmentView", "inputFields": { - "destinationFacilityId": this.currentFacility.facilityId + "destinationFacilityId": this.currentFacility.facilityId, + "statusId": "PURCH_SHIP_RECEIVED", + "statusId_op": this.selectedSegment === "open" ? "notEqual" : "equals" }, "fieldList" : [ "shipmentId","externalId","statusId","shopifyOrderName","hcOrderId","trackingCode", "destinationFacilityId" ], "noConditionFind": "Y", @@ -146,6 +166,9 @@ export default defineComponent({ if (event) event.target.complete(); }) }, + segmentChanged() { + this.getReturns(); + } }, setup() { const store = useStore(); @@ -157,4 +180,12 @@ export default defineComponent({ } } }) - \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/Shipments.vue b/src/views/Shipments.vue index faeaa5e9..8c543df3 100644 --- a/src/views/Shipments.vue +++ b/src/views/Shipments.vue @@ -9,7 +9,7 @@
- + {{ translate("Open") }} @@ -161,7 +161,7 @@ export default defineComponent({ if (event) event.target.complete(); }) }, - segmentChanged(event: any) { + segmentChanged() { this.getShipments() } }, From 00b2698b8edc1f5c9e498b60fe40301c97e54cd1 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 22 Oct 2024 19:14:46 +0530 Subject: [PATCH 5/7] Reverted: caching of order detail from po list in state on order details page (#380) --- src/store/modules/order/actions.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index cb923260..baaeaf7a 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -71,20 +71,6 @@ const actions: ActionTree = { async getOrderDetail({ commit, state }, { orderId }) { let resp; - const current = state.current as any - const orders = state.purchaseOrders.list as any - - if (current.length && current[0]?.orderId === orderId) { return current } - - else if(orders.length > 0) { - return orders.some((order: any) => { - if (order.doclist.docs[0]?.orderId === orderId) { - this.dispatch('product/fetchProductInformation', { order: order.doclist.docs }); - commit(types.ORDER_CURRENT_UPDATED, { ...state.current, orderId: order.doclist.docs[0]?.orderId, externalOrderId: order.doclist.docs[0]?.externalOrderId, orderStatusId: order.doclist.docs[0]?.orderStatusId, orderStatusDesc: order.doclist.docs[0]?.orderStatusDesc, items: JSON.parse(JSON.stringify(order.doclist.docs)) }) - return current; - } - }) - } try { const payload = { "json": { From 7c35a4afaf794faa555c3654991d05c3c0439fcb Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 6 Nov 2024 12:26:54 +0530 Subject: [PATCH 6/7] Reverted: unwanted console statement in return details page (#380) --- src/views/ReturnDetails.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/views/ReturnDetails.vue b/src/views/ReturnDetails.vue index 3d095ffc..5127e07c 100644 --- a/src/views/ReturnDetails.vue +++ b/src/views/ReturnDetails.vue @@ -157,8 +157,6 @@ export default defineComponent({ }, async ionViewWillEnter() { const current = await this.store.dispatch('return/setCurrent', { shipmentId: this.$route.params.id }) - console.log(this.current); - }, computed: { ...mapGetters({ From 89b0110b3b8119ba78da3aef0222f67910e496a9 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 6 Nov 2024 12:55:05 +0530 Subject: [PATCH 7/7] Improved: toast message while searching item in case of completed shipments (#380) --- src/locales/en.json | 1 + src/views/PurchaseOrderDetail.vue | 2 +- src/views/ReturnDetails.vue | 2 +- src/views/ShipmentDetails.vue | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index a046022f..bfefe353 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -106,6 +106,7 @@ "Scanned item is not present within the shipment:": "Scanned item is not present within the shipment: {itemName}", "Scanned successfully.": "Scanned {itemName} successfully.", "Search items": "Search items", + "Searched item is not present within the shipment:": "Scanned item is not present within the shipment: {itemName}", "secondary identifier": "secondary identifier", "Secondary identifier": "Secondary identifier", "Search": "Search", diff --git a/src/views/PurchaseOrderDetail.vue b/src/views/PurchaseOrderDetail.vue index 020e255d..ce80f448 100644 --- a/src/views/PurchaseOrderDetail.vue +++ b/src/views/PurchaseOrderDetail.vue @@ -321,7 +321,7 @@ export default defineComponent({ this.lastScannedId = '' }, 3000) } else { - showToast(translate("Scanned item is not present within the shipment:", { itemName: this.queryString })); + showToast(translate("Searched item is not present within the shipment:", { itemName: this.queryString })); } this.queryString = '' }, diff --git a/src/views/ReturnDetails.vue b/src/views/ReturnDetails.vue index 5127e07c..24b3daa9 100644 --- a/src/views/ReturnDetails.vue +++ b/src/views/ReturnDetails.vue @@ -290,7 +290,7 @@ export default defineComponent({ this.lastScannedId = '' }, 3000) } else { - showToast(translate("Scanned item is not present within the shipment:", { itemName: this.queryString })); + showToast(translate("Searched item is not present within the shipment:", { itemName: this.queryString })); } this.queryString = '' } diff --git a/src/views/ShipmentDetails.vue b/src/views/ShipmentDetails.vue index c516a170..f2a9fe55 100644 --- a/src/views/ShipmentDetails.vue +++ b/src/views/ShipmentDetails.vue @@ -317,7 +317,7 @@ export default defineComponent({ this.lastScannedId = '' }, 3000) } else { - showToast(translate("Scanned item is not present within the shipment:", { itemName: this.queryString })); + showToast(translate("Searched item is not present within the shipment:", { itemName: this.queryString })); } this.queryString = '' }