From aa43f1bcfd3fc783c991d13e2e543866fb0bdd89 Mon Sep 17 00:00:00 2001
From: FIN-IT_AndriFP <andrifebriyadiputra@gmail.com>
Date: Thu, 12 Feb 2026 09:09:25 +0700
Subject: (andri) fix ketika qty = 0

---
 src/app/api/stock-opname/route.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/app/api/stock-opname/route.tsx')

diff --git a/src/app/api/stock-opname/route.tsx b/src/app/api/stock-opname/route.tsx
index ec943c5..8e09351 100644
--- a/src/app/api/stock-opname/route.tsx
+++ b/src/app/api/stock-opname/route.tsx
@@ -181,7 +181,7 @@ const computeIsDifferent = async ({ companyId, productId }: { companyId: number;
     // Jika tidak ada qty verifikasi, cek kondisi tim 1/2/3
     const conditional = {
       // anyCountEqWithOnhand: [totalQty['COUNT1'], totalQty['COUNT2'], totalQty['COUNT3']].includes(onhandQty),
-      anyCountEqWithOnhand: (totalQty["COUNT1"] === onhandQty && zeroCount2 && zeroCount3) || (totalQty["COUNT2"] === onhandQty && zeroCount3 && onhandQty!== 0) || (totalQty["COUNT3"] === onhandQty && onhandQty!== 0),
+      anyCountEqWithOnhand: (totalQty["COUNT1"] === onhandQty && zeroCount2 && zeroCount3) || (totalQty["COUNT2"] === onhandQty && zeroCount3) || (totalQty["COUNT3"] === onhandQty),
       anyCountEqWithAllQty: [totalQty["COUNT1"], totalQty["COUNT2"], totalQty["COUNT3"]].includes(allQty),
       count1EqWithCount2: totalQty["COUNT1"] !== null && totalQty["COUNT2"] !== null && totalQty["COUNT1"] === totalQty["COUNT2"] && totalQty["COUNT3"] === null,
       count1EqWithCount3: totalQty["COUNT1"] !== null && totalQty["COUNT3"] !== null && totalQty["COUNT1"] === totalQty["COUNT3"],
@@ -206,7 +206,7 @@ const computeIsDifferent = async ({ companyId, productId }: { companyId: number;
 
     const detailCondition = {
       verificationCheckAll: _.isNumber(VERIFICATION.quantity),
-      anyCountEqWithOnhand: (totalQty["COUNT1"] === onhandQty && zeroCount2 && zeroCount3) || (totalQty["COUNT2"] === onhandQty && zeroCount3 && onhandQty!== 0) || (totalQty["COUNT3"] === onhandQty && onhandQty!== 0),
+      anyCountEqWithOnhand: (totalQty["COUNT1"] === onhandQty && zeroCount2 && zeroCount3) || (totalQty["COUNT2"] === onhandQty && zeroCount3) || (totalQty["COUNT3"] === onhandQty),
       count1EqWithCount2: totalQty["COUNT3"] === 0 && count1 === count2,
       // count1EqWithCount3: count1 === count3,
       count1EqWithCount3: count1 != 0 && count1 === count3,
-- 
cgit v1.2.3

