Merge branch 'master' of https://github.com/merelendor/evoleasing-account
This commit is contained in:
commit
1f6cc319a2
@ -157,9 +157,13 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
fias_id: "",
|
||||
}
|
||||
},
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
assignment_date: "",
|
||||
credentials_dateend: "",
|
||||
indefinite: false,
|
||||
*/
|
||||
},
|
||||
signatory_person: {
|
||||
not_head_person: false,
|
||||
@ -228,10 +232,13 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
componentDidMount()
|
||||
{
|
||||
const { main, signatory_person } = this.state;
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
if( main.inn !== null && main.inn.length === 12)
|
||||
{
|
||||
this._handle_onCheckboxFieldChange("head_person.indefinite", true);
|
||||
}
|
||||
*/
|
||||
|
||||
if(signatory_person.lastname !== null || signatory_person.lastname !== undefined || signatory_person.lastname !== "")
|
||||
{
|
||||
@ -285,6 +292,8 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
_handle_onIndefiniteChange = () =>
|
||||
{
|
||||
const { head_person } = this.state;
|
||||
@ -300,6 +309,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
}, 10);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
_handle_onChangeDelegationAgreement = () =>
|
||||
{
|
||||
@ -407,7 +417,11 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
"identity_document.placebirth",
|
||||
"identity_document.citizenship_code",
|
||||
"identity_document.registration_address.name",
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
"assignment_date",
|
||||
*/
|
||||
];
|
||||
|
||||
if(parseInt(_get(head_person, "identity_document.doctype"), 10) === 100000000)
|
||||
@ -426,6 +440,9 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
if(head_person.assignment_date !== undefined && head_person.assignment_date !== null && head_person.assignment_date !== "")
|
||||
{
|
||||
try
|
||||
@ -473,6 +490,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if(head_person.telephone === "" || head_person.telephone === null || isNaN(parseInt(head_person.telephone.replace(/[^\d]+/g, ''), 10)) || parseInt(head_person.telephone.replace(/[^\d]+/g, ''), 10).toString().length < 11)
|
||||
{
|
||||
@ -906,6 +924,9 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/*}
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
{ errors.indexOf("head_person.assignment_date_invalid") > -1 &&
|
||||
(
|
||||
<FormMessage type="error" title="Ошибка" message="Пожалуйста, укажите прошедшую дату."/>
|
||||
@ -938,6 +959,8 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
*/}
|
||||
{/*}
|
||||
{ !head_person.indefinite && (
|
||||
<React.Fragment>
|
||||
{ errors.indexOf("head_person.credentials_dateend_invalid") > -1 &&
|
||||
@ -962,6 +985,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
</React.Fragment>
|
||||
) }
|
||||
{*/}
|
||||
|
||||
{ errors.indexOf("head_person_files") > -1 &&
|
||||
(
|
||||
|
||||
@ -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)))
|
||||
{
|
||||
|
||||
BIN
lib/evo_anketa_v2_empty_licenses_20240208.pdf
Normal file
BIN
lib/evo_anketa_v2_empty_licenses_20240208.pdf
Normal file
Binary file not shown.
@ -52,9 +52,13 @@ const fields = {
|
||||
head_person: {
|
||||
fullname: { name: "head_fullname", type: "text", bind: null },
|
||||
jobtitle: { name: "head_jobtitle", type: "text", bind: null },
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
assignment_date: { name: "head_date", type: "text", bind: null, date: true },
|
||||
credentials_dateend: { name: "head_dateend", type: "text", bind: null, date: true },
|
||||
indefinite: { name: "head_date_infinite", type: "checkbox", bind: null },
|
||||
*/
|
||||
telephone: { name: "head_phone", type: "text", bind: null },
|
||||
email: { name: "head_email", type: "text", bind: null },
|
||||
},
|
||||
@ -143,7 +147,7 @@ export default async function handler(req, res)
|
||||
var crm_jwt = jwt.sign({ acc_number: client_jwt_decoded.acc_number }, process.env.JWT_SECRET_CRM, { noTimestamp: true });
|
||||
|
||||
console.log("API", "download", "__dirname", __dirname);
|
||||
const formPdfBytes = fs.readFileSync(`${ __dirname }/../../../../../lib/evo_anketa_v2_empty_licenses.pdf`);
|
||||
const formPdfBytes = fs.readFileSync(`${ __dirname }/../../../../../lib/evo_anketa_v2_empty_licenses_20240208.pdf`);
|
||||
const fontBytes = fs.readFileSync(`${ __dirname }/../../../../../lib/ubuntu_mono_regular.ttf`);
|
||||
|
||||
const pdfDoc = await PDFDocument.load(formPdfBytes);
|
||||
@ -298,6 +302,9 @@ export default async function handler(req, res)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
if(group === "head_person")
|
||||
{
|
||||
if(field === "credentials_dateend")
|
||||
@ -308,6 +315,15 @@ export default async function handler(req, res)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if(group === "head_person")
|
||||
{
|
||||
if(field === "assignment_date" || field === "credentials_dateend" || field === "indefinite")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(field === "fullname")
|
||||
{
|
||||
|
||||
@ -161,8 +161,14 @@ export default async function handler(req, res)
|
||||
payload.head_person.identity_document.citizenship_code = payload.head_person.identity_document.citizenship.code.toString();
|
||||
payload.head_person.telephone = checkNullEmpty(payload.head_person.telephone) ? payload.head_person.telephone.replace(/[^0-9]/g, '') : null;
|
||||
payload.head_person.identity_document.issuedate = checkNullEmpty(payload.head_person.identity_document.issuedate) ? moment(payload.head_person.identity_document.issuedate).format("YYYY-MM-DD") : null;
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
payload.head_person.assignment_date = checkNullEmpty(payload.head_person.assignment_date) ? moment(payload.head_person.assignment_date).format("YYYY-MM-DD") : null;
|
||||
payload.head_person.credentials_dateend = checkNullEmpty(payload.head_person.credentials_dateend) ? moment(payload.head_person.credentials_dateend).format("YYYY-MM-DD") : null;
|
||||
*/
|
||||
payload.head_person.assignment_date = null;
|
||||
payload.head_person.credentials_dateend = null;
|
||||
|
||||
if(payload.signatory_person.not_head_person)
|
||||
{
|
||||
@ -178,24 +184,43 @@ export default async function handler(req, res)
|
||||
else
|
||||
{
|
||||
payload.signatory_person = { ...payload.signatory_person, ..._pick(payload.head_person, [
|
||||
"lastname", "firstname", "middlename", "no_middle_name", "jobtitle", "telephone", "email", "identity_document", "assignment_date", "credentials_dateend", "indefinite",
|
||||
"lastname", "firstname", "middlename", "no_middle_name", "jobtitle", "telephone", "email", "identity_document",
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
"assignment_date", "credentials_dateend", "indefinite",
|
||||
*/
|
||||
]) };
|
||||
}
|
||||
payload.signatory_person.identity_document.citizenship_code = payload.signatory_person.identity_document.citizenship.code.toString();
|
||||
payload.signatory_person.telephone = checkNullEmpty(payload.signatory_person.telephone) ? payload.signatory_person.telephone.replace(/[^0-9]/g, '') : null;
|
||||
payload.signatory_person.identity_document.issuedate = checkNullEmpty(payload.signatory_person.identity_document.issuedate) ? moment(payload.signatory_person.identity_document.issuedate).format("YYYY-MM-DD") : null;
|
||||
payload.signatory_person.docdate = checkNullEmpty(payload.signatory_person.docdate) ? moment(payload.signatory_person.docdate).format("YYYY-MM-DD") : null;
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
payload.signatory_person.assignment_date = checkNullEmpty(payload.signatory_person.assignment_date) ? moment(payload.signatory_person.assignment_date).format("YYYY-MM-DD") : null;
|
||||
payload.signatory_person.credentials_dateend = checkNullEmpty(payload.signatory_person.credentials_dateend) ? moment(payload.signatory_person.credentials_dateend).format("YYYY-MM-DD") : null;
|
||||
*/
|
||||
|
||||
payload.signatory_person.birthdate = checkNullEmpty(payload.signatory_person.birthdate) ? moment(payload.signatory_person.birthdate).format("YYYY-MM-DD") : null;
|
||||
|
||||
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;
|
||||
@ -208,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 }, ...{
|
||||
@ -381,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)
|
||||
{
|
||||
|
||||
@ -74,9 +74,13 @@ export const questionnaire_template = {
|
||||
fias_id: null,
|
||||
}
|
||||
},
|
||||
/*
|
||||
Запрос 2024-02-08 на удаление даты назначения и даты окончания полномочий
|
||||
|
||||
assignment_date: null,
|
||||
credentials_dateend: null,
|
||||
indefinite: false,
|
||||
*/
|
||||
},
|
||||
head_person_files: [],
|
||||
signatory_person: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user