{% from 'utils.html.twig' import ico, dateFormat %}
{# MODO DE EXIBIÇÃO #}
{% if receiverEdit is not defined and receiverPartnerEdit is not defined %}
{% set receiverEdit = false %}
{% set receiverPartnerEdit = false %}
{% set status = 0 %}
{% else %}
{% set status = receiverEdit.status %}
{% endif %}
{% set formEdit = (status in [0, enum('ReceiverEnum::RELEASED')])? true : false %}
{% set req = ' <em>*</em>' %}
<div id="status-type-person" data-status-tipo-pessoa="{{ receiverEdit? receiverEdit.personType }}">
{% if not receiverEdit %}
<div id="modal-etapas" class="modal-etapas">
<p class="etapa" data-status="active">
<span class="indice">
<i class="num">1</i>
<i class="check">{{ ico('check') }}</i>
</span>
</p>
<p class="etapa" data-status="next">
<span class="indice">
<i class="num">2</i>
<i class="check">{{ ico('check') }}</i>
</span>
</p>
<p class="etapa hidden juridico" data-status="next">
<span class="indice">
<i class="num">3</i>
<i class="check">{{ ico('check') }}</i>
</span>
</p>
<p class="etapa hidden juridico" data-status="next">
<span class="indice">
<i class="num">4</i>
<i class="check">{{ ico('check') }}</i>
</span>
</p>
<p class="etapa js--step-bank" data-status="next">
<span class="indice">
<i class="num"></i>
<i class="check">{{ ico('check') }}</i>
</span>
</p>
</div>
{% endif %}
<form
{# EDIT #}
{% if receiverEdit %}
action="/admin/receiver/user/edit/{{ receiverEdit.id }}" method="put"
{# CREATE #}
{% else %}
action="/admin/receiver/user/register" method="post"
{% endif %}
id="formReceiver" class="form-geral form-user" novalidate data-no-reset="true">
<input type="hidden" name="user" value="{{ user.id }}">
{# STEP 1 ////////////////////////////////////////////////////////////////////// #}
<section id="receiver-info-data" class="form-step tab-data" {{ not receiverEdit? 'data-status="active"' }}>
<div class="receiver-head">
{# TITLE FORM #}
<span class="person">{{ getLanguage('person_informations', 'receiver') }}</span>
<span class="company">{{ getLanguage('company_informations', 'receiver') }}</span>
{# WARN REQUIRED #}
<p>{{ getLanguage('required_fields', 'util')|raw }}</p>
</div>
{% include 'website/user/receiver/receiver-form-step-info.html.twig' %}
{% if receiverEdit %}
<div class="receiver-head">
{# TITLE FORM #}
<span class="person">{{ getLanguage('address_data_person', 'receiver') }}</span>
<span class="company">{{ getLanguage('address_data_company', 'receiver') }}</span>
</div>
{% include 'website/user/receiver/receiver-form-step-address.html.twig' %}
{% endif %}
</section>
{# -/ STEP 1 /////////////////////////////////////////////////////////////////// #}
{# STEP 2 ////////////////////////////////////////////////////////////////////// #}
{% if not receiverEdit %}
<section id="receiver-address-data" class="form-step tab-data" {{ not receiverEdit? 'data-status="next"' }}>
<div class="receiver-head">
{# TITLE FORM #}
<span class="person">{{ getLanguage('address_data_person', 'receiver') }}</span>
<span class="company">{{ getLanguage('address_data_company', 'receiver') }}</span>
{# WARN REQUIRED #}
<p>{{ getLanguage('required_fields', 'util')|raw }}</p>
</div>
{% include 'website/user/receiver/receiver-form-step-address.html.twig' %}
</section>
{% endif %}
{# -/ STEP 2 /////////////////////////////////////////////////////////////////// #}
{# STEP 3 ////////////////////////////////////////////////////////////////////// #}
<section id="receiver-info-partner-data" class="form-step tab-data hidden juridico" {{ not receiverEdit? 'data-status="next"' }}
data-status-partner="{{ enum('ReceiverEnum::PERSON') }}"
>
<div class="receiver-head">
{# TITLE FORM #}
<span>{{ getLanguage('partner_informations', 'receiver') }}</span>
{# WARN REQUIRED #}
<p>{{ getLanguage('required_fields', 'util')|raw }}</p>
</div>
{%
include 'website/user/receiver/receiver-form-step-info.html.twig'
with { infoType: 'Partner' }
%}
{% if receiverEdit %}
<div class="receiver-head">
{# TITLE FORM #}
<span>{{ getLanguage('partner_address_data', 'receiver') }}</span>
</div>
{%
include 'website/user/receiver/receiver-form-step-address.html.twig'
with { addressType: 'Partner' }
%}
{% endif %}
</section>
{# -/ STEP 3 /////////////////////////////////////////////////////////////////// #}
{# STEP 4 ////////////////////////////////////////////////////////////////////// #}
{% if not receiverEdit %}
<section id="receiver-address-partner-data" class="form-step hidden juridico" data-status="next">
<div class="receiver-head">
{# TITLE FORM #}
<span>{{ getLanguage('partner_address_data', 'receiver') }}</span>
{# WARN REQUIRED #}
<p>{{ getLanguage('required_fields', 'util')|raw }}</p>
</div>
{%
include 'website/user/receiver/receiver-form-step-address.html.twig'
with { addressType: 'Partner' }
%}
</section>
{% endif %}
{# -/ STEP 4 /////////////////////////////////////////////////////////////////// #}
{# STEP 5 ////////////////////////////////////////////////////////////////////// #}
<section id="receiver-bank-data" class="form-step tab-data js--step-bank" {{ not receiverEdit? 'data-status="next"' }}>
<div class="receiver-head">
{# TITLE FORM #}
<span>{{ getLanguage('bank_data', 'receiver') }}</span>
{# WARN REQUIRED #}
<p>{{ getLanguage('required_fields', 'util')|raw }}</p>
</div>
{% include 'website/user/receiver/receiver-form-step-bank.html.twig' %}
</section>
{# -/ STEP 5 /////////////////////////////////////////////////////////////////// #}
{# STEP 6 ////////////////////////////////////////////////////////////////////// #}
{% if receiverEdit %}
{% set internalStatusVerification = (receiverEdit.internalStatus == enum('ReceiverEnum::RELEASED') ? true : false) %}
{% if not isTrial or not internalStatusVerification %}
{% if receiverEdit.type == enum('ReceiverEnum::EMPLOYEE')
and receiverEdit.user.allowReceiver == enum('ReceiverEnum::YES')
and receiverEdit.allowTransfer == enum('ReceiverEnum::YES') %}
<section id="receiver-transfer-data" class="form-step tab-data js--step-transfer">
<div class="receiver-head">
{# TITLE FORM #}
<span>{{ getLanguage('transfer_config', 'receiver') }}</span>
{# WARN REQUIRED #}
<p>{{ getLanguage('required_fields', 'util')|raw }}</p>
</div>
{% include 'website/user/receiver/receiver-form-step-transfer.html.twig' %}
</section>
{% endif %}
{% endif %}
{% endif %}
{# -/ STEP 6 /////////////////////////////////////////////////////////////////// #}
{# SUBMIT DADOS #}
{% if layout == 'page' %}
<nav class="actions-confirm">
<button type="submit" id="btnReceiverSubmit" class="btn-continuar-peq">{{ ico('check-circle') }} {{ getLanguage('save', 'receiver') }}<i class="loader">{{ ico('loader-wish') }}</i></button>
</nav>
{# MODAL #}
{% elseif layout == 'modal' %}
<nav class="actions">
{# TERMS #}
<div class="wrap-check-accept hidden">
<p>
<input type="checkbox" id="check-accept-terms" name="check-accept-terms">
{{ getLanguage('declare_accepted', 'receiver') }} <a href="https://docs.google.com/document/d/1sjZPiNCOkRqSTL6JE4w1YMAaG028e_ez8E4JSaBbviQ/edit" target="_blank">{{ getLanguage('user_terms', 'receiver') }}</a>.
</p>
</div>
<button type="reset" class="cancel">{{ getLanguage('reset', 'receiver') }}</button>
<button type="button" class="cancel btn-receiver-anterior hidden">
{{ ico('arrow-left') }} {{ getLanguage('back', 'receiver') }}
</button>
<button type="button" class="btn-continuar-peq btn-receiver-proximo">
{{ getLanguage('next', 'receiver') }} {{ ico('arrow-right') }}
</button>
<button type="submit" class="btn-continuar-peq btn-receiver-finish hidden">{{ ico('check-circle') }} {{ getLanguage('finish', 'receiver') }}<i class="loader">{{ ico('loader-wish') }}</i></button>
</nav>
{% endif %}
</form>
</div>