From 1b8509bad3b3fc11a00b9b0f2d2025805dd84e72 Mon Sep 17 00:00:00 2001 From: yenugukeerthana Date: Mon, 9 Oct 2023 12:35:54 +0530 Subject: [PATCH] Fix. handling null value for outward number Co-authored-by: deeptirawat1510 --- src/inventory/aushada/aushada.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/inventory/aushada/aushada.jsx b/src/inventory/aushada/aushada.jsx index 2dc6e87..0eafdb3 100644 --- a/src/inventory/aushada/aushada.jsx +++ b/src/inventory/aushada/aushada.jsx @@ -106,14 +106,16 @@ const Aushada = (props) => { for (const result of itemStock) { for (const stockOperation of result.details) { const formattedDate = convertToDateTimeFormat(selectedDate); - if (stockOperation.batchOperation.inwardDate === formattedDate) { - inwardNumberMatch = true; - break; - } - if (stockOperation.batchOperation.outwardId === outwardNumber) { - outwardMatch = true; - break; - } + if (enableEaushadhaInwardApi && (stockOperation.batchOperation.inwardDate === formattedDate)) { + inwardNumberMatch = true; + break; + } + else{ + if ( outwardNumber && stockOperation.batchOperation.outwardId === outwardNumber) { + outwardMatch = true; + break; + } + } } if (inwardNumberMatch || outwardMatch) break; }