Merge branch 'master' of https://github.com/merelendor/evoleasing-account
This commit is contained in:
commit
39884f6cad
@ -34,6 +34,8 @@ const is_valid_inn = (i) =>
|
|||||||
{
|
{
|
||||||
if ( i.match(/\D/) ) return false;
|
if ( i.match(/\D/) ) return false;
|
||||||
|
|
||||||
|
if(inn !== null)
|
||||||
|
{
|
||||||
var inn = i.match(/(\d)/g);
|
var inn = i.match(/(\d)/g);
|
||||||
|
|
||||||
if ( inn.length == 10 )
|
if ( inn.length == 10 )
|
||||||
@ -58,6 +60,7 @@ const is_valid_inn = (i) =>
|
|||||||
6*inn[9] + 8*inn[10]
|
6*inn[9] + 8*inn[10]
|
||||||
) % 11) % 10);
|
) % 11) % 10);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -530,6 +533,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
"individual_executive_docnum",
|
"individual_executive_docnum",
|
||||||
"individual_executive_docdate",
|
"individual_executive_docdate",
|
||||||
];
|
];
|
||||||
|
let ignore_kpp = false;
|
||||||
|
|
||||||
for(let i in main_check)
|
for(let i in main_check)
|
||||||
{
|
{
|
||||||
@ -537,10 +541,34 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
|
|
||||||
if(main_check[i] === "individual_executive_inn")
|
if(main_check[i] === "individual_executive_inn")
|
||||||
{
|
{
|
||||||
if(v !== null && !is_valid_inn(v.replace(/[^\d]+/g, '')))
|
if(v !== null)
|
||||||
|
{
|
||||||
|
const cleaned_inn = v.replace(/[^\d]+/g, '');
|
||||||
|
|
||||||
|
if(!is_valid_inn(cleaned_inn))
|
||||||
{
|
{
|
||||||
errors.push(`main.individual_executive_inn`);
|
errors.push(`main.individual_executive_inn`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cleaned_inn.length > 10)
|
||||||
|
{
|
||||||
|
ignore_kpp = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errors.push(`main.individual_executive_inn`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(main_check[i] === "individual_executive_kpp")
|
||||||
|
{
|
||||||
|
if(!ignore_kpp)
|
||||||
|
{
|
||||||
|
if(v === "" || v === null)
|
||||||
|
{
|
||||||
|
errors.push(`main.${ main_check[i] }`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -679,7 +707,6 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
|
|
||||||
//console.log({ errors });
|
//console.log({ errors });
|
||||||
|
|
||||||
|
|
||||||
let head_person_citizenship = { label: getCitizenshipTitleByCode(head_person.identity_document.citizenship.code), code: head_person.identity_document.citizenship.code };
|
let head_person_citizenship = { label: getCitizenshipTitleByCode(head_person.identity_document.citizenship.code), code: head_person.identity_document.citizenship.code };
|
||||||
let signatory_person_citizenship = { label: getCitizenshipTitleByCode(signatory_person.identity_document.citizenship.code), code: signatory_person.identity_document.citizenship.code };
|
let signatory_person_citizenship = { label: getCitizenshipTitleByCode(signatory_person.identity_document.citizenship.code), code: signatory_person.identity_document.citizenship.code };
|
||||||
|
|
||||||
@ -1041,7 +1068,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
name="main.individual_executive_inn"
|
name="main.individual_executive_inn"
|
||||||
value={ this._checkStrValue(main.individual_executive_inn) }
|
value={ this._checkStrValue(main.individual_executive_inn) }
|
||||||
placeholder="Введите ИНН"
|
placeholder="Введите ИНН"
|
||||||
onChange={ (event) => { this._removeError(event.target.name); this._handle_onInnChange(event.target.value); } }
|
onChange={ (event) => { this._removeError([ event.target.name, "main.individual_executive_kpp" ]); this._handle_onInnChange(event.target.value); } }
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user