diff options
| author | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2026-02-02 15:44:09 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2026-02-02 15:44:09 +0700 |
| commit | 017d0b4ec1f664bec8446259f7b95f4f4879e3e8 (patch) | |
| tree | 5932c6bcf6962c31d140ef8e53f8c07b47dfb883 | |
| parent | 7376e70d47d429787900eb49cb6102b389e0690c (diff) | |
(andri) fix count2 green when count1 & count3 is null
| -rw-r--r-- | src/app/api/company/[companyId]/product/[productId]/compute-different/route.tsx | 3 | ||||
| -rw-r--r-- | src/app/api/stock-opname/route.tsx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/app/api/company/[companyId]/product/[productId]/compute-different/route.tsx b/src/app/api/company/[companyId]/product/[productId]/compute-different/route.tsx index 61e6db3..c2ae5bb 100644 --- a/src/app/api/company/[companyId]/product/[productId]/compute-different/route.tsx +++ b/src/app/api/company/[companyId]/product/[productId]/compute-different/route.tsx @@ -86,7 +86,8 @@ export async function POST(request: NextRequest, { params }: PostParams) { verificationCheckAll: _.isNumber(VERIFICATION.quantity), anyCountEqWithOnhand: (totalQty["COUNT1"] === onhandQty && zeroCount2 && zeroCount3) || (totalQty["COUNT2"] === onhandQty && zeroCount3 && onhandQty!== 0) || (totalQty["COUNT3"] === onhandQty && onhandQty!== 0), count1EqWithCount2: totalQty["COUNT3"] === 0 && count1 === count2, - count1EqWithCount3: count1 == count3, + // count1EqWithCount3: count1 == count3, + count1EqWithCount3: count1 != 0 && count1 === count3, count2EqWithCount3: totalQty["COUNT2"] !== 0 && totalQty["COUNT3"] !== 0 && count2 === count3, // count3EqWithCount1_2: (COUNT3.quantity !== COUNT1.quantity) && (COUNT3.quantity !== COUNT2.quantity) && (COUNT1.quantity === COUNT2.quantity) && (COUNT3.quantity !== onhandQty) }; diff --git a/src/app/api/stock-opname/route.tsx b/src/app/api/stock-opname/route.tsx index e1adb0f..ec943c5 100644 --- a/src/app/api/stock-opname/route.tsx +++ b/src/app/api/stock-opname/route.tsx @@ -208,7 +208,8 @@ const computeIsDifferent = async ({ companyId, productId }: { companyId: number; verificationCheckAll: _.isNumber(VERIFICATION.quantity), anyCountEqWithOnhand: (totalQty["COUNT1"] === onhandQty && zeroCount2 && zeroCount3) || (totalQty["COUNT2"] === onhandQty && zeroCount3 && onhandQty!== 0) || (totalQty["COUNT3"] === onhandQty && onhandQty!== 0), count1EqWithCount2: totalQty["COUNT3"] === 0 && count1 === count2, - count1EqWithCount3: count1 === count3, + // count1EqWithCount3: count1 === count3, + count1EqWithCount3: count1 != 0 && count1 === count3, count2EqWithCount3: totalQty["COUNT2"] !== 0 && totalQty["COUNT3"] !== 0 && count2 === count3, // count3EqWithCount1_2: (COUNT3.quantity !== COUNT1.quantity) && (COUNT3.quantity !== COUNT2.quantity) && (COUNT1.quantity === COUNT2.quantity) && (COUNT3.quantity !== onhandQty) }; |
