From 118301abe43a7e0fec336d43f58faab3ba0c1f43 Mon Sep 17 00:00:00 2001
From: amansinghbais <singh11amanbais@gmail.com>
Date: Mon, 14 Oct 2024 15:40:04 +0530
Subject: [PATCH] Improved: code for allowing multi receiving in case of PO
 order (#394)

---
 src/store/modules/order/actions.ts    | 3 ++-
 src/store/modules/shipment/actions.ts | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts
index 6f599645..9d56b736 100644
--- a/src/store/modules/order/actions.ts
+++ b/src/store/modules/order/actions.ts
@@ -149,7 +149,8 @@ const actions: ActionTree<OrderState, RootState> = {
 
           const poShipment = {
             shipmentId,
-            items: payload.items
+            items: payload.items,
+            isMultiReceivingEnabled: true
           }
           await this.dispatch('shipment/receiveShipment', poShipment).catch((err) => console.error(err))
         })
diff --git a/src/store/modules/shipment/actions.ts b/src/store/modules/shipment/actions.ts
index ffe4adb2..0282ecf9 100644
--- a/src/store/modules/shipment/actions.ts
+++ b/src/store/modules/shipment/actions.ts
@@ -106,7 +106,7 @@ const actions: ActionTree<ShipmentState, RootState> = {
     let areAllSuccess = true;
 
     for (const item of payload.items) {
-      if(item.quantityReceived === 0) {
+      if(payload.isMultiReceivingEnabled || item.quantityReceived === 0) {
         if (!item.locationSeqId) {
           console.error("Missing locationSeqId on item");
           areAllSuccess = false;