From ac43b04f0e74624c0359edef2d88e939b4403b1b Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 18 Oct 2023 17:45:41 +0530 Subject: [PATCH] Improved: optimized way of writing conditions (#212) --- src/components/ClosePurchaseOrderModal.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 5c8935a9..7ca5902e 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -18,7 +18,7 @@ {{ $t("To close the purchase order, select all.") }} - + @@ -68,9 +68,8 @@ import { closeOutline, checkmarkCircle, arrowBackOutline, saveOutline } from 'io import { defineComponent } from 'vue'; import { mapGetters, useStore } from 'vuex' import { OrderService } from "@/services/OrderService"; -import { productHelpers, showToast } from '@/utils'; +import { productHelpers } from '@/utils'; import { ShopifyImg } from '@hotwax/dxp-components'; -import { translate } from '@/i18n' import { useRouter } from 'vue-router'; export default defineComponent({ @@ -127,6 +126,7 @@ export default defineComponent({ return alert.present(); }, async updatePOItemStatus() { + // Shipment can only be created if quantity is specified for atleast one PO item. if(this.isEligibileForCreatingShipment) { const eligibleItemsForCreatingShipment = this.order.items.filter((item: any) => item.quantityAccepted > 0) await this.store.dispatch('order/createPurchaseShipment', { items: eligibleItemsForCreatingShipment, orderId: this.order.orderId })