From 0099cf58baa9c6288365f5f43716e51e0b42a789 Mon Sep 17 00:00:00 2001 From: DominikNoga Date: Mon, 24 Jun 2024 09:15:29 +0200 Subject: [PATCH] OAM-229: fixed stock movement validation --- .../adjustment-creation.controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stock-adjustment-creation/adjustment-creation.controller.js b/src/stock-adjustment-creation/adjustment-creation.controller.js index 1402829..cd3b71b 100644 --- a/src/stock-adjustment-creation/adjustment-creation.controller.js +++ b/src/stock-adjustment-creation/adjustment-creation.controller.js @@ -405,8 +405,9 @@ lineItem.totalPrice = 0; // AO-804: Ends here var validatedQuantity = vm.getLineItemTotalQuantity(lineItem); - if (validatedQuantity > lineItem.$previewSOH && ((lineItem.reason - && lineItem.reason.reasonType === REASON_TYPES.DEBIT) || !lineItem.reason)) { + if (adjustmentType.state === ADJUSTMENT_TYPE.ISSUE.state && + validatedQuantity > lineItem.$previewSOH && ((lineItem.reason && + lineItem.reason.reasonType === REASON_TYPES.DEBIT) || !lineItem.reason)) { lineItem.$errors.quantityInvalid = messageService .get('stockAdjustmentCreation.quantityGreaterThanStockOnHand'); } else if (validatedQuantity > MAX_INTEGER_VALUE) {