import React from "react"; import Head from 'next/head'; import Image from 'next/image'; import Link from "next/link"; import cookie from 'cookie'; import numeral from "numeral"; import pluralize from 'pluralize-ru'; import { SpinnerCircular } from 'spinners-react'; import Select from 'react-select'; import { connect } from "react-redux"; import { withRouter } from 'next/router'; import { get as _get } from 'lodash'; import QuestionnaireForm from "../QuestionnaireForm"; import CalendarDatePicker from '../../../CalendarDatePicker'; import citizenships from "../../../../lib/citizenships.json"; import { reduxWrapper } from '../../../../store'; import AddressSuggests from "../../AddressSuggests"; class ShareholderForm extends React.Component { _handle_onTextFieldChange = this.props._handle_onTextFieldChange; _handle_onCheckboxFieldChange = this.props._handle_onCheckboxFieldChange; _handle_onFieldChange = this.props._handle_onFieldChange; _handle_onCitizenshipChange = (name, value) => { console.log("_handle_onCitizenshipChange", value); let citizenship = undefined; for(let i in citizenships) { if(parseInt(citizenships[i].value, 10) === parseInt(value, 10)) { citizenship = citizenships[i].label; } } this._handle_onFieldChange(name, { title: citizenship, code: value, }); } render() { const { index, shareholder, checking } = this.props; let citizenship = undefined; if(shareholder.identity_document.citizenship.code !== "") { for(let i in citizenships) { if(parseInt(citizenships[i].value, 10) === parseInt(shareholder.identity_document.citizenship.code, 10)) { citizenship = citizenships[i]; } } } return (
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ false } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.issuedate`, date) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } />
this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.placebirth`, data.title) } disabled={ checking } />
clearSignatorySelection(`founded_persons[${ index }]`, { founder_from_list: !shareholder.founder_from_list ? true : false, lastname: "", firstname: "", middlename: "", no_middle_name: false, }) } />
) } { !checking && ( ) } ) } { index > 0 ? ( { shareholder.founder_from_list ? (
{ signatories !== undefined && signatories !== null && signatories.map((signatory, s_index) => { const disabled = signatory.signatoryid !== shareholder.signatory_id ? this._checkSignatoryDisabled(signatory.signatoryid) : false; if(checking) { if(shareholder.signatory_id !== signatory.signatoryid) { return null; } } return (
changeSignatorySelection(`founded_persons[${ index }]`, { ...shareholder, ...{ founder_from_list: true, signatory_id: signatory.signatoryid, lastname: signatory.lastname, firstname: signatory.firstname, middlename: signatory.middlename, } }) } disabled={ disabled } />
); }) }
) : ( ) }
) : ( ) }
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } />
this._handle_onCheckboxFieldChange(event.target.name, parseInt(event.target.value, 10)) } />
this._handle_onCheckboxFieldChange(event.target.name, parseInt(event.target.value, 10)) } />
) } } class Form_4_Shareholders extends QuestionnaireForm { constructor(props) { super(props); this.state = { founded_persons: [], founded_persons_template: { signatory_id: null, lastname: "", firstname: "", middlename: "", no_middle_name: false, jobtitle: "", telephone: "", email: "", founder_from_list: true, founder_number: 0, founder_part: "", is_beneficial: false, identity_document: { doctype: "", seria: "", docnumber: "", issuedate: "", icode: "", issueby: "", issueby_search_dadata: "", placebirth: "", citizenship: { title: "", code: "", }, registration_address: { title: "", fias_id: "", } } }, loading: false, }; } static getDerivedStateFromProps(nextProps, prevState) { return { founded_persons: nextProps.questionnaire.founded_persons, }; } componentDidMount() { console.log("Form_4_Shareholders", "this.state", this.state); console.log("Form_4_Shareholders", "global.store.getState()", global.store.getState()); const founded_persons_template = JSON.parse(JSON.stringify(this.state.founded_persons_template)); if(this.state.founded_persons.length === 0) { this._updateQuestionnaire({ founded_persons: [{ ...founded_persons_template, ...{ founder_from_list: false, founder_number: this.state.founded_persons.length + 1 } }], }); } } _handle_onAddShareholder = () => { console.log("_handle_onAddShareholder"); const founded_persons = [ ...this.state.founded_persons ]; const founded_persons_template = JSON.parse(JSON.stringify(this.state.founded_persons_template)); console.log("_handle_onAddShareholder", { founded_persons_template }); if(founded_persons.length < 4) { founded_persons.push(founded_persons_template); this._updateQuestionnaire({ founded_persons, }); } } _handle_onRemoveShareholder = (index) => { const founded_persons = [ ...this.state.founded_persons ]; founded_persons.splice(index, 1); this._updateQuestionnaire({ founded_persons, }); } _handle_onClearSignatorySelection = (name, values) => { const founded_persons_template = JSON.parse(JSON.stringify(this.state.founded_persons_template)); const update = { ...founded_persons_template , ...values }; console.log("_handle_onClearSignatorySelection", update); this._handle_onFieldChange(name, update ); } _handle_onChangeSignatorySelection = (name, values) => { console.log("_handle_onChangeSignatorySelection"); console.log(name, values); this._handle_onFieldChange(name, { ...values } ); } _handle_onFormSubmit = (event) => { event.preventDefault(); console.log("Form_4_Shareholders", "_handle_onFormSubmit"); this._handle_onCheckboxFieldChange("step", 5); setTimeout(() => { this.props.onNextStep("regulatory"); }, 10); } _checkDisabled = () => { const { founded_persons } = this.state; const check_all = [ "founder_part", ]; const check = [ "lastname", "firstname", "telephone", "email", "identity_document.seria", "identity_document.docnumber", "identity_document.issuedate", "identity_document.icode", "identity_document.issueby", "identity_document.placebirth", "identity_document.citizenship.code", "identity_document.registration_address.title", ]; for(let f in founded_persons) { for(let i in check_all) { if(_get(founded_persons[f], check_all[i]) === "") { console.log("1. EMPTY", f, check_all[i]); return true; } } if(!founded_persons[f].founder_from_list) { for(let i in check) { if(_get(founded_persons[f], check[i]) === "") { console.log("2. EMPTY", f, check[i]); return true; } } } else { if(founded_persons[f].signatory_id === null) { console.log("3. EMPTY", f, "signatory_id"); console.log("founded_persons[f]"); console.log(founded_persons[f]); return true; } } } return false; } render() { const { signatories, checking } = this.props; const { founded_persons, loading, address, } = this.state; return (

4. Сведения об участниках (акционерах) и бенефициарных владельцах

– физических лицах, владеющих долей в уставном капитале более 25% *бенефициарный владелец (в соответствии с Федеральным законом от 07.08.2001 No115-ФЗ «О противодействии легализации (отмыванию) доходов, полученных преступным путем, и финансированию терроризма») — физическое лицо, которое в конечном счете прямо или косвенно (через третьих лиц) владеет (имеет преобладающее участие более 25 процентов в капитале) вышеуказанным лизингополучателем-юридическим лицом, либо имеет возможность контролировать действия вышеуказанного лизингополучателя. Бенефициарным владельцем лизингополучателя-физического лица считается это лицо, за исключением случаев, если имеются основания полагать, что бенефициарным владельцем является иное физическое лицо. В случае, если бенефициарным владельцем являются несколько человек, сведения предоставляются в отношении каждого.

{ founded_persons.map((shareholder, index) => ( )) } { !checking && (
) } ) } } function mapStateToProps(state, ownProps) { return { questionnaire: state.questionnaire, } } export const getServerSideProps = reduxWrapper.getServerSideProps(store => async ({ req, res, query }) => { } ); export default connect(mapStateToProps)(Form_4_Shareholders);