Server IP : 150.95.80.236 / Your IP : 3.137.166.252 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/plugins/formvalidation/dist/amd/validators/vat/ |
Upload File : |
define(["require", "exports", "../../algorithms/luhn"], function (require, exports, luhn_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function frVat(value) { var v = value; if (/^FR[0-9A-Z]{2}[0-9]{9}$/.test(v)) { v = v.substr(2); } if (!/^[0-9A-Z]{2}[0-9]{9}$/.test(v)) { return { meta: {}, valid: false, }; } if (v.substr(2, 4) !== '000') { return { meta: {}, valid: (0, luhn_1.default)(v.substr(2)), }; } if (/^[0-9]{2}$/.test(v.substr(0, 2))) { return { meta: {}, valid: v.substr(0, 2) === "" + parseInt(v.substr(2) + '12', 10) % 97, }; } else { var alphabet = '0123456789ABCDEFGHJKLMNPQRSTUVWXYZ'; var check = void 0; if (/^[0-9]$/.test(v.charAt(0))) { check = alphabet.indexOf(v.charAt(0)) * 24 + alphabet.indexOf(v.charAt(1)) - 10; } else { check = alphabet.indexOf(v.charAt(0)) * 34 + alphabet.indexOf(v.charAt(1)) - 100; } return { meta: {}, valid: (parseInt(v.substr(2), 10) + 1 + Math.floor(check / 11)) % 11 === check % 11, }; } } exports.default = frVat; });