Server IP : 150.95.80.236 / Your IP : 18.222.120.93 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/es6/validators/vat/ |
Upload File : |
export default function t(t){if(t===""){return{meta:{},valid:true}}const e=t.replace(/[^\d]+/g,"");if(e===""||e.length!==14){return{meta:{},valid:false}}if(e==="00000000000000"||e==="11111111111111"||e==="22222222222222"||e==="33333333333333"||e==="44444444444444"||e==="55555555555555"||e==="66666666666666"||e==="77777777777777"||e==="88888888888888"||e==="99999999999999"){return{meta:{},valid:false}}let r=e.length-2;let a=e.substring(0,r);const l=e.substring(r);let n=0;let i=r-7;let s;for(s=r;s>=1;s--){n+=parseInt(a.charAt(r-s),10)*i--;if(i<2){i=9}}let f=n%11<2?0:11-n%11;if(f!==parseInt(l.charAt(0),10)){return{meta:{},valid:false}}r=r+1;a=e.substring(0,r);n=0;i=r-7;for(s=r;s>=1;s--){n+=parseInt(a.charAt(r-s),10)*i--;if(i<2){i=9}}f=n%11<2?0:11-n%11;return{meta:{},valid:f===parseInt(l.charAt(1),10)}}