{% if is_company_completed == true
and entitites_needed_to_be_filled.company is empty
and entitites_needed_to_be_filled.contacts is empty
and entitites_needed_to_be_filled.billing_addresses is empty
and entitites_needed_to_be_filled.delivery_addresses is empty %}
<div class="alert alert-success text-left" role="alert">
<h4 class="alert-heading">
<i class="fas fa-check-circle"></i> Fiche finalisée
</h4>
<hr>
{% if is_granted('ROLE_COMMERCIAL') %}
<p class="mb-0">Vous pouvez dès maintenant envoyer votre fiche à la comptabilité.</p>
<span>
<a href="{{ path('company_to_accountant', {'id': company.id}) }}" class="btn btn-primary"
onclick="return confirm('Voulez-vous envoyer la fiche à la compta {{ company.name }} par mail ?');">
<i class="fa fa-envelope" aria-hidden="true"></i>
<span>
Valider la fiche et l'envoyer à la compta
</span>
</a>
</span>
{% elseif not is_granted('ROLE_COMMERCIAL') and not is_granted('ROLE_ACCOUNTANT') %}
<p class="mb-0">Vous pouvez dès maintenant envoyer votre fiche au commercial.</p>
<span>
<a href="{{ path('company_submit_info', {'id': company.id}) }}" class="btn btn-primary">
<i class="fa fa-envelope" aria-hidden="true"></i>
Soumettre les informations au commercial pour validation
</a>
</span>
{% endif %}
</div>
{% else %}
<div class="alert alert-warning text-left" role="alert">
<h5 class="alert-heading">
<i class="fas fa-exclamation-triangle"></i>
{% if is_granted('ROLE_COMMERCIAL') %}
Il vous reste des éléments à remplir pour envoyer votre fiche à la comptabilité:
{% elseif not is_granted('ROLE_COMMERCIAL') and not is_granted('ROLE_ACCOUNTANT') %}
Il vous reste des éléments à remplir pour demander la validation au commercial :
{% endif %}
</h5>
<hr>
{% if missing_contact %}
<p class="mb-0">
Il vous reste au moins un contact à renseigner
<a href="{{ path('contact_new', {'id_company': company.id}) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endif %}
{% if missing_billing_address %}
<p class="mb-0">
Il vous reste au moins une adresse de facturation à renseigner
<a href="{{ path('billing_address_new', {'id_company': company.id}) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endif %}
{% if missing_delivery_address %}
<p class="mb-0">
Il vous reste au moins une adresse de livraison à renseigner
<a href="{{ path('delivery_address_new', {'id_company': company.id}) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endif %}
{% if entitites_needed_to_be_filled.company is not empty %}
<p class="mb-0">
Cette fiche "société" ne semble pas complète :
<a href="{{ path('company_edit', {'id': entitites_needed_to_be_filled.company} ) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endif %}
{% if entitites_needed_to_be_filled.contacts is not empty %}
{% for contact in entitites_needed_to_be_filled.contacts %}
<p class="mb-0">
Cette fiche "contact" ne semble pas complète :
<a href="{{ path('contact_edit', {'id': contact} ) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endfor %}
{% endif %}
{% if entitites_needed_to_be_filled.billing_addresses is not empty %}
{% for billing_address in entitites_needed_to_be_filled.billing_addresses %}
<p class="mb-0">
Cette fiche "facturation" ne semble pas complète :
<a href="{{ path('billing_address_edit', {'id': billing_address} ) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endfor %}
{% endif %}
{% if entitites_needed_to_be_filled.delivery_addresses is not empty %}
{% for delivery_address in entitites_needed_to_be_filled.delivery_addresses %}
<p class="mb-0">
Cette fiche "livraison" ne semble pas complète :
<a href="{{ path('delivery_address_edit', {'id': delivery_address} ) }}" class="alert-link">(cliquez ici)</a>
</p>
{% endfor %}
{% endif %}
</div>
{% endif %}