diff options
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/api/company/[companyId]/product/[productId]/compute-different/route.tsx | 4 | ||||
| -rw-r--r-- | src/app/api/stock-opname/route.tsx | 4 |
2 files changed, 4 insertions, 4 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 c2ae5bb..1b641d3 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 @@ -61,7 +61,7 @@ export async function POST(request: NextRequest, { params }: PostParams) { const conditional = { verificationCheckAll: verificationCounter > 0 && verificationCounter === stockOpnames.length, // 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"] !== 0 && totalQty["COUNT2"] !== 0 && totalQty["COUNT1"] === totalQty["COUNT2"] && totalQty["COUNT3"] === null && totalQty["COUNT1"] !== onhandQty, count1EqWithCount3: totalQty["COUNT1"] !== 0 && totalQty["COUNT3"] !== 0 && totalQty["COUNT1"] === totalQty["COUNT3"], @@ -84,7 +84,7 @@ export async function POST(request: NextRequest, { params }: PostParams) { 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, 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, |
