КОНТРОЛЫ/legal_entity.md


Исходный код

Twig код

{% set name_input_name = name ~ '[name]' %}
{% set tax_registration_reason_code_name = name ~ '[tax_registration_reason_code]' %}
{% set entity_type_name = name ~ '[entity_type]' %}
{% set vat_id_name = name ~ '[vat_id]' %}
{% set address_name = name ~ '[address]' %}
{% set kpp_name = name ~ '[kpp]' %}
{% set bank_code_name = name ~ '[bank_code]' %}
{% set external_name = name ~ '[external_id]' %}
{% set unp = name ~ '[unp]' %}
{% set bin = name ~ '[bin]' %}
{% set egrpou = name ~ '[egrpou]' %}
{% set mfo = name ~ '[mfo]' %}
{% set bank_account_number = name ~ '[bank_account_number]' %}
{% set oked = name ~ '[oked]' %}
{% set director = name ~ '[director]' %}
{% set real_address = name ~ '[real_address]' %}
{% set value = element.cf[cf.ID].VALUE[key] %}

<div class="legal-entity js-control-legal-entity {{ class_name }}" data-search-in="{{ cf.SETTINGS.search_in|default('') }}">
  <div class="legal-entity__item legal-entity__item_name">
    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_name',
      additional_data: 'spellcheck="false" data-query-type="name"',
      input_class_name: 'linked-form__cf js-legal-entity-name' ~ ' ' ~ input_class_name,
      items: [],
      value: value.name|default(''),
      input_type: 'text',
      name: name_input_name,
      ajax: {},
      placeholder: placeholder,
      disabled: disabled
    } %}
  </div>

  <div class="legal-entity__item legal-entity__item_labeled">
    <span class="legal-entity__item-label">{{ "ITIN"|i18n }} </span>

    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_vat',
      additional_data: 'spellcheck="false" data-query-type="vat-id"',
      input_class_name: 'linked-form__cf js-legal-entity-vat legal-entity__item-mini-input js-control-allow-numeric',
      items: [],
      value: value.vat_id|default(''),
      input_type: 'text',
      name: vat_id_name,
      styled_input: true,
      ajax: {},
      placeholder: inn_placeholder ? inn_placeholder : placeholder
    } %}
  </div>

  <div class="legal-entity__item legal-entity__item_labeled">
    <span class="legal-entity__item-label">{{ "IEC"|i18n }} </span>

    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_kpp',
      additional_data: 'spellcheck="false" data-query-type="kpp"',
      input_class_name: 'linked-form__cf js-legal-entity-kpp legal-entity__item-mini-input js-control-allow-numeric',
      items: [],
      value: value.kpp|default(''),
      input_type: 'text',
      name: kpp_name,
      styled_input: true,
      ajax: {},
      placeholder: kpp_placeholder ? kpp_placeholder : placeholder
    } %}
  </div>

  <div class="legal-entity__item legal-entity__item_labeled">
    <span class="legal-entity__item-label">{{ "Registration #"|i18n }} </span>

    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_ogrn',
      additional_data: 'spellcheck="false" data-query-type="tax_registration_reason_code"',
      input_class_name: 'linked-form__cf js-legal-entity-ogrn legal-entity__item-mini-input js-control-allow-numeric',
      items: [],
      value: value.tax_registration_reason_code|default(''),
      input_type: 'text',
      name: tax_registration_reason_code_name,
      styled_input: true,
      ajax: {},
      placeholder: ogrn_placeholder ? ogrn_placeholder : placeholder
    } %}
  </div>

  <div class="legal-entity__item legal-entity__item_labeled">
    <span class="legal-entity__item-label">{{ "Bank code"|i18n }} </span>

    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_bank_code',
      additional_data: 'spellcheck="false" data-query-type="bank_code"',
      input_class_name: 'linked-form__cf js-legal-entity-bank_code legal-entity__item-mini-input js-control-allow-numeric',
      items: [],
      value: value.bank_code|default(''),
      input_type: 'text',
      name: bank_code_name,
      styled_input: true,
      ajax: {},
      placeholder: bank_code_placeholder ? bank_code_placeholder : placeholder
    } %}
  </div>

  {% if value.bin %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">{{ "БИН"|i18n }} </span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_bin',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.bin|default(''),
        input_type: 'text',
        name: bin,
        styled_input: true,
        ajax: {},
        placeholder: bin_placeholder ? bin_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-bin" name="{{ bin }}" value="{{ value.bin|default('') }}" disabled="{{ disabled }}">
  {% endif %}


  {% if value.unp %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">{{ "УНП"|i18n }} </span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_unp',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.unp|default(''),
        input_type: 'text',
        name: unp,
        styled_input: true,
        ajax: {},
        placeholder: unp_placeholder ? unp_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-unp" name="{{ unp }}" value="{{ value.unp|default('') }}" disabled="{{ disabled }}">
  {% endif %}


  {% if value.egrpou %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">{{ "ЕГРПОУ"|i18n }} </span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_egrpou',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.egrpou|default(''),
        input_type: 'text',
        name: egrpou,
        styled_input: true,
        ajax: {},
        placeholder: egrpou_placeholder ? egrpou_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-egrpou" name="{{ egrpou }}" value="{{ value.egrpou|default('') }}" disabled="{{ disabled }}">
  {% endif %}

  {% if value.mfo %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">{{ "MFO"|i18n }}</span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_mfo',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.mfo|default(''),
        input_type: 'text',
        name: mfo,
        styled_input: true,
        ajax: {},
        placeholder: mfo_placeholder ? mfo_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-mfo" name="{{ mfo }}" value="{{ value.mfo|default('') }}" disabled="{{ disabled }}">
  {% endif %}

  {% if value.bank_account_number %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">Р/C</span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_bank_account_number',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.bank_account_number|default(''),
        input_type: 'text',
        name: bank_account_number,
        styled_input: true,
        ajax: {},
        placeholder: bank_account_number_placeholder ? bank_account_number_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-bank_account_number" name="{{ bank_account_number }}" value="{{ value.bank_account_number|default('') }}" disabled="{{ disabled }}">
  {% endif %}

  {% if value.oked %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">{{ "oked"|i18n }}</span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_oked',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.oked|default(''),
        input_type: 'text',
        name: oked,
        styled_input: true,
        ajax: {},
        placeholder: oked_placeholder ? oked_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-oked" name="{{ oked }}" value="{{ value.oked|default('') }}" disabled="{{ disabled }}">
  {% endif %}

  {% if value.director %}
    <div class="legal-entity__item legal-entity__item_labeled">
      <span class="legal-entity__item-label">{{ "Director"|i18n }}</span>

      {% include "interface/controls/suggest.twig" with {
        class_name: 'legal-entity__suggest legal-entity__suggest_director',
        additional_data: 'spellcheck="false"',
        input_class_name: 'linked-form__cf legal-entity__item-mini-input',
        items: [],
        value: value.director|default(''),
        input_type: 'text',
        name: director,
        styled_input: true,
        ajax: {},
        placeholder: director_placeholder ? director_placeholder : placeholder
      } %}
    </div>
  {% else %}
    <input type="hidden" class="js-legal-entity-director" name="{{ director }}" value="{{ value.director|default('') }}" disabled="{{ disabled }}">
  {% endif %}

  <div class="legal-entity__item legal-entity__item_labeled legal-entity__item_labeled-last">
    <span class="legal-entity__item-label">{{ "CF_NAME_ADDRESS"|i18n }} </span>

    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_address',
      additional_data: 'spellcheck="false" data-query-type="address"',
      input_class_name: 'linked-form__cf js-legal-entity-address legal-entity__item-mini-input',
      items: [],
      value: value.address|default(''),
      input_type: 'text',
      name: address_name,
      styled_input: true,
      ajax: {},
      placeholder: address_placeholder ? address_placeholder : placeholder
    } %}
  </div>

  <div class="legal-entity__item legal-entity__item_labeled">
    <span class="legal-entity__item-label">{{ "Real address"|i18n }} </span>

    {% include "interface/controls/suggest.twig" with {
      class_name: 'legal-entity__suggest legal-entity__suggest_address',
      additional_data: 'spellcheck="false"',
      input_class_name: 'linked-form__cf legal-entity__item-mini-input',
      items: [],
      value: value.real_address|default(''),
      input_type: 'text',
      name: real_address,
      styled_input: true,
      ajax: {},
      placeholder: real_address_placeholder ? real_address_placeholder : placeholder
    } %}
  </div>

  <input type="hidden" class="js-legal-entity-type" name="{{ entity_type_name }}" value="{{ value.entity_type|default('') }}" disabled="{{ disabled }}">
  <input type="hidden" class="js-legal-entity-external" name="{{ external_name }}" value="{{ value.external_uid|default('') }}" disabled="{{ disabled }}">
</div>

Ссылка на вики репозиторий