From c897add2a09766640cc38db835bcf3e78310f2f2 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 6 Dec 2023 16:11:25 +0530 Subject: [PATCH 1/4] Improved: code to autoselect PO items received in entirety (#278) --- src/components/ClosePurchaseOrderModal.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 0d2229af..51caab1a 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -96,6 +96,7 @@ export default defineComponent({ computed: { ...mapGetters({ getProduct: 'product/getProduct', + getPOItemAccepted: 'order/getPOItemAccepted', order: 'order/getCurrent', productIdentificationPref: 'user/getProductIdentificationPref' }) @@ -163,8 +164,18 @@ export default defineComponent({ }, getPOItems() { return this.order.items.filter((item: any) => item.orderId) + }, + getAlreadyFulfilledItems() { + this.order.items.map((item: any) => { + if(this.isPOItemStatusPending(item) && this.getPOItemAccepted(item.productId) >= item.quantity) { + item.isChecked = true; + } + }) } }, + mounted() { + this.getAlreadyFulfilledItems() + }, setup() { const router = useRouter() const store = useStore() From d2b208a1c69aa642d301ec476cbca9a9a7be36bf Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 6 Dec 2023 16:17:45 +0530 Subject: [PATCH 2/4] Improved: method name for checking fulfilled items (#278) --- src/components/ClosePurchaseOrderModal.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 51caab1a..7298e9c5 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -165,7 +165,7 @@ export default defineComponent({ getPOItems() { return this.order.items.filter((item: any) => item.orderId) }, - getAlreadyFulfilledItems() { + checkAlreadyFulfilledItems() { this.order.items.map((item: any) => { if(this.isPOItemStatusPending(item) && this.getPOItemAccepted(item.productId) >= item.quantity) { item.isChecked = true; @@ -174,7 +174,7 @@ export default defineComponent({ } }, mounted() { - this.getAlreadyFulfilledItems() + this.checkAlreadyFulfilledItems() }, setup() { const router = useRouter() From 5474f4c1f244c43be6123f41322b64dece40bc06 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 7 Dec 2023 14:53:50 +0530 Subject: [PATCH 3/4] Improved: code to auto select closed items and items with quantity greater than 0 (#278) --- src/components/ClosePurchaseOrderModal.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 7298e9c5..48df87c5 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -27,9 +27,7 @@

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

- {{ $t("Completed") }} - {{ $t("Rejected") }} - + @@ -75,7 +73,6 @@ import { useRouter } from 'vue-router'; export default defineComponent({ name: "ClosePurchaseOrderModal", components: { - IonBadge, IonButton, IonButtons, IonCheckbox, @@ -167,7 +164,7 @@ export default defineComponent({ }, checkAlreadyFulfilledItems() { this.order.items.map((item: any) => { - if(this.isPOItemStatusPending(item) && this.getPOItemAccepted(item.productId) >= item.quantity) { + if(this.isPOItemStatusPending(item) && this.getPOItemAccepted(item.productId) > 0) { item.isChecked = true; } }) From 69ba863a21b246404cdbeebb0a4f56c689dd272c Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 7 Dec 2023 14:55:52 +0530 Subject: [PATCH 4/4] Improved: code to remove unused imports (#278) --- src/components/ClosePurchaseOrderModal.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 48df87c5..ab61777b 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -42,7 +42,6 @@