diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index cf8a4404..9bdb33ff 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -3125,10 +3125,8 @@ export class ProfileController extends Controller { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } if (citizenIdDigits[12] !== chkDigit) { @@ -3163,10 +3161,8 @@ export class ProfileController extends Controller { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } // else if(chkDigit === 11){ // chkDigit = cal % 10; @@ -3243,10 +3239,8 @@ export class ProfileController extends Controller { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } if (citizenIdDigits[12] !== chkDigit) { @@ -3313,10 +3307,8 @@ export class ProfileController extends Controller { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } if (citizenIdDigits[12] !== chkDigit) { diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 0eff8b1b..9331c1a2 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1859,10 +1859,8 @@ export class ProfileEmployeeController extends Controller { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } if (citizenIdDigits[12] !== chkDigit) { @@ -1953,10 +1951,8 @@ export class ProfileEmployeeController extends Controller { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } if (citizenIdDigits[12] !== chkDigit) { diff --git a/src/interfaces/extension.ts b/src/interfaces/extension.ts index 522e58ba..38985d89 100644 --- a/src/interfaces/extension.ts +++ b/src/interfaces/extension.ts @@ -276,10 +276,8 @@ class Extension { citizenIdDigits[11] * 2; const calStp2 = cal % 11; let chkDigit = 11 - calStp2; - if (chkDigit === 10) { - chkDigit = 1; - } else if (chkDigit === 11) { - chkDigit = chkDigit % 10; + if (chkDigit >= 10) { + chkDigit = 0; } // if (citizenIdDigits[12] !== chkDigit) {