diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 7ca5902e..0d2229af 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -127,9 +127,10 @@ export default defineComponent({ }, async updatePOItemStatus() { // Shipment can only be created if quantity is specified for atleast one PO item. + // In some cases we don't need to create shipment instead directly need to close PO items. 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 }) + const eligibleItemsForShipment = this.order.items.filter((item: any) => item.quantityAccepted > 0) + await this.store.dispatch('order/createPurchaseShipment', { items: eligibleItemsForShipment, orderId: this.order.orderId }) } const eligibleItems = this.order.items.filter((item: any) => item.isChecked && this.isPOItemStatusPending(item)) diff --git a/src/views/PurchaseOrderDetail.vue b/src/views/PurchaseOrderDetail.vue index 54943a20..6cd4a563 100644 --- a/src/views/PurchaseOrderDetail.vue +++ b/src/views/PurchaseOrderDetail.vue @@ -192,7 +192,6 @@ import LocationPopover from '@/components/LocationPopover.vue' import ImageModal from '@/components/ImageModal.vue'; import { copyToClipboard, hasError, productHelpers } from '@/utils'; import { Actions, hasPermission } from '@/authorization' -import emitter from "@/event-bus" export default defineComponent({ name: "PurchaseOrderDetails",