TASK 2024-02-13 : remove from questionnaire phone, email from founders form, add founder link to SP or HP phone/email
This commit is contained in:
parent
09fa505fbe
commit
e2fb568e4e
@ -151,6 +151,10 @@ class ShareholderForm extends React.Component
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
{/*
|
||||
Запрос 2024-02-13 на удаление телефона и адреса E-mail
|
||||
|
||||
<div className="form_field">
|
||||
<label>Телефон <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
@ -180,6 +184,7 @@ class ShareholderForm extends React.Component
|
||||
disabled={ checking }
|
||||
/>
|
||||
</div>
|
||||
*/}
|
||||
|
||||
<div className="form_field">
|
||||
<label>Тип документа <sup className="required_label">*</sup></label>
|
||||
@ -739,8 +744,11 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
"founder_part",
|
||||
"lastname",
|
||||
"firstname",
|
||||
/*
|
||||
Запрос 2024-02-13 на удаление телефона и адреса E-mail
|
||||
"telephone",
|
||||
"email",
|
||||
*/
|
||||
"identity_document.seria",
|
||||
"identity_document.docnumber",
|
||||
"identity_document.issuedate",
|
||||
@ -772,6 +780,9 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
}
|
||||
|
||||
const v = _get(founder_persons[f], check[i]);
|
||||
/*
|
||||
Запрос 2024-02-13 на удаление телефона и адреса E-mail
|
||||
|
||||
if(check[i] === "telephone")
|
||||
{
|
||||
if(v === "" || v === null || isNaN(parseInt(v.replace(/[^\d]+/g, ''), 10)) || parseInt(v.replace(/[^\d]+/g, ''), 10).toString().length < 11)
|
||||
@ -787,7 +798,8 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
errors[f].push(`email`);
|
||||
}
|
||||
}
|
||||
else if(check[i] === "founder_part")
|
||||
*/
|
||||
if(check[i] === "founder_part")
|
||||
{
|
||||
if(v !== "" && v !== null && !isNaN(parseFloat(v)))
|
||||
{
|
||||
|
||||
@ -207,11 +207,20 @@ export default async function handler(req, res)
|
||||
|
||||
const founder_persons = parsed.founder_persons;
|
||||
|
||||
const hp_check = `${ payload.head_person.lastname !== undefined && payload.head_person.lastname !== null ? payload.head_person.lastname : "" }${ payload.head_person.firstname !== undefined && payload.head_person.firstname !== null ? payload.head_person.firstname : "" }${ payload.head_person.middlename !== undefined && payload.head_person.middlename !== null ? payload.head_person.middlename : "" }`.replace(/\s/, "").toLowerCase();
|
||||
const sp_check = `${ payload.signatory_person.lastname !== undefined && payload.signatory_person.lastname !== null ? payload.signatory_person.lastname : "" }${ payload.signatory_person.firstname !== undefined && payload.signatory_person.firstname !== null ? payload.signatory_person.firstname : "" }${ payload.signatory_person.middlename !== undefined && payload.signatory_person.middlename !== null ? payload.signatory_person.middlename : "" }`.replace(/\s/, "").toLowerCase();
|
||||
|
||||
for(let i in founder_persons)
|
||||
{
|
||||
founder_persons[i].founder_number = parseInt(i, 10) + 1;
|
||||
founder_persons[i].founder_part = parseFloat(founder_persons[i].founder_part);
|
||||
/*
|
||||
Запрос 2024-02-13 на удаление телефона и адреса E-mail
|
||||
|
||||
founder_persons[i].telephone = checkNullEmpty(founder_persons[i].telephone) ? founder_persons[i].telephone.replace(/[^0-9]/g, '') : null;
|
||||
*/
|
||||
founder_persons[i].telephone = null;
|
||||
founder_persons[i].email = null;
|
||||
founder_persons[i].identity_document.issuedate = checkNullEmpty(founder_persons[i].identity_document.issuedate) ? moment(founder_persons[i].identity_document.issuedate).format("YYYY-MM-DD") : null;
|
||||
founder_persons[i].identity_document.citizenship_code = founder_persons[i].identity_document.citizenship.code.toString();
|
||||
founder_persons[i].birthdate = checkNullEmpty(founder_persons[i].birthdate) ? moment(founder_persons[i].birthdate).format("YYYY-MM-DD") : null;
|
||||
@ -224,6 +233,22 @@ export default async function handler(req, res)
|
||||
{
|
||||
founder_persons[i].no_middle_name = true;
|
||||
}
|
||||
|
||||
const fp_check = `${ founder_persons[i].lastname !== undefined && founder_persons[i].lastname !== null ? founder_persons[i].lastname : "" }${ founder_persons[i].firstname !== undefined && founder_persons[i].firstname !== null ? founder_persons[i].firstname : "" }${ founder_persons[i].middlename !== undefined && founder_persons[i].middlename !== null ? founder_persons[i].middlename : "" }`.replace(/\s/, "").toLowerCase();
|
||||
|
||||
console.log({ sp_check, hp_check, fp_check, });
|
||||
|
||||
if(fp_check === sp_check)
|
||||
{
|
||||
founder_persons[i].telephone = payload.signatory_person.telephone;
|
||||
founder_persons[i].email = payload.signatory_person.email;
|
||||
}
|
||||
|
||||
if(fp_check === hp_check)
|
||||
{
|
||||
founder_persons[i].telephone = payload.head_person.telephone;
|
||||
founder_persons[i].email = payload.head_person.email;
|
||||
}
|
||||
}
|
||||
|
||||
payload = { ...payload, ...{ founder_persons }, ...{
|
||||
@ -397,7 +422,7 @@ export default async function handler(req, res)
|
||||
resolve();
|
||||
});
|
||||
|
||||
//res.status(500).json({ payload, id, digital });
|
||||
//res.status(500).json({ payload });
|
||||
}
|
||||
catch(upload_single_error)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user