<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8">
  <title>Bulletin d'adhésion</title>
  <style>
    @page {
      size: A4;
      margin: .5cm;
    }
    body {
      font-family: Arial, sans-serif;
      font-size: 12px;
      color: #083484;
      margin: 0;
      padding: 0;
      
        margin: auto;
        
        padding: 1cm;
    }
    
    h1, h2 {
      text-align: center;
    }
    table {
      width: 100%;
      border-collapse: collapse 1px;
      margin-bottom: 15px;
    }
    td, th {
      border: .5px solid #031434;
      padding: 3px;
    }
    .no-border {
      border: none !important;
    }
    .section-title {
      background: #f0f0f0;
      font-weight: bold;
    }
    .row {
      display: flex;
      justify-content: space-between;
    }
    .stamp {
      margin-top: 10px;
    }
  </style>
  
</head>
<body>



  {% load static %}

    <table style="margin-top: 20px; border-collapse: collapse; width: 100%;">
        <tr >
          <td colspan="2" style="border: none;text-align: center;"><img width="250px" src="{{logo}}" ></td>
          <td colspan="3" style="border: none;text-align: center;"><h3 style="margin-top:0;margin-bottom: 0; text-align: center;">BULLETIN INDIVIDUEL D’ADHÉSION (AYANT VALEUR DE CONTRAT)</h2></td>
          <td  colspan="2" style="border: none;text-align: center;"><img width="70px" src="{{qr}}" ></td>
        
          

        </tr>
      </table>
    {% comment %} <br> {% endcomment %}
  <table>
    <tr><td colspan="2" class="section-title">ADHERENT : {{emp.getCode}} </td></tr>
    <tr>
      <td><strong>Code apporteur :</strong> {% if contract.partner  %} {{contract.partner.getCode}} {% else %} _  {% endif %}  </td>
      <td><strong>Nom apporteur :</strong> {% if contract.partner  %} {{contract.partner.cuser.user.first_name}} {{contract.partner.cuser.user.last_name}} {% else %} Direct  {% endif %}</td>
    </tr>
  </table>

  <table>
    <tr><td colspan="5" class="section-title">INFORMATIONS DU CLIENT</td></tr>
    <tr>
      <td colspan="2"><strong>Prénom(s) et Nom <br></strong>{{emp.cuser.user.first_name}} {{emp.cuser.user.last_name}}</td>
      <td><strong>Sexe</strong><br> {{emp.sex}} </td>
      <td colspan="2"><strong>Date de naissance</strong> <br> {{emp.birthdate}}</td>
      {% comment %} <td><strong>Lieu de naissance</strong> <br> {{emp.birthplace}}</td> {% endcomment %}
    </tr>
    <tr>
      <td colspan="2"><strong>Téléphone</strong> <br> {{emp.cuser.phone}}</td>
      <td><strong>Nationalité</strong> <br> {{emp.nationality}}</td>
      <td colspan="2"><strong>E-mail</strong> <br> {{emp.cuser.user.email}}</td>
      
    </tr>
    <tr>
      {% comment %} <td><strong>Secteur</strong> <br> {{emp.sector}}</td> {% endcomment %}
      <td><strong>Profession</strong> <br> {{emp.profession}}</td>
      <td colspan="2"><strong>Type de pièce</strong> <br> {{emp.identityType}}</td>
      <td colspan="2"><strong>Numéro pièce</strong> <br> {{emp.identityNumber}}</td>
      {% comment %} <td><strong>Date de délivrance</strong> <br> {{emp.dateOfIssue}}</td> {% endcomment %}
    </tr>
    {% comment %} <tr>
      <td><strong>Banque</strong> <br> {{emp.bank}}</td>
      <td><strong>Code agence</strong> <br> {{emp.codeBank}}</td>
      <td><strong>Numéro de compte</strong> <br> {{emp.numberBank}} </td>
      <td><strong>Clé RIB</strong> <br> {{emp.rib}}</td>
    </tr> {% endcomment %}
    <tr>
      <td colspan="5"><strong>Adresse : </strong> {{emp.address}} </td>
    </tr>
  </table>

  <table>
    <tr><td colspan="5" class="section-title">BÉNÉFICIAIRES</td></tr>
    {% if emp.clause == 'GENERIC' %}
    <tr style="margin-bottom: 10px; !important;">
      <td colspan="5">{{ emp.clauseDescription|default:"_" }}</td>
    </tr>
    
    
    {% endif %}

    {% if emp.clause == 'SPECIFIC' %}
    {% for benef in emp.benefEmployee.all  %}
    <tr>
      <td colspan="2"><strong>Prénom(s) et nom</strong> :<br> {{ benef.name }} </td>
      <td><strong>Date de naissance</strong> :<br> {{ benef.birthdate }}</td>
      <td><strong>Nationalité</strong> :<br> {{ benef.nationality }}</td>
      
      <td><strong>Répartition (%)</strong> :<br> {{ benef.percentage }}</td>
    </tr>
    <tr>
      <td colspan="3"><strong>Adresse :</strong> {{ benef.address }}</td>
      <td colspan="2"><strong>Téléphone</strong> : {{ benef.phone }}</td>
    </tr>
    {% endfor %}
    {% endif %}
    
    

    
  </table>

  {% comment %} <table>
    <tr><td colspan="2" class="section-title">PERSONNE À CONTACTER</td></tr>
    <tr><td colspan="2">1- ASTOU CISSE , <strong>contact:</strong> , <strong>adresse:</strong> adres contact 1</td></tr>
    <tr><td colspan="2">- ASTOU CISSE , <strong>contact:</strong> , <strong>adresse:</strong> adres contact 1</td></tr>
  </table> {% endcomment %}

  <table>
    <tr><td colspan="4" class="section-title">INFORMATIONS DU CONTRAT D’ASSURANCE</td></tr>
    <tr>
      <td><strong>Versement initial</strong> <br> {{contract.initPayment}} </td>
      <td><strong>Prime périodique</strong> <br> {{contract.periodicBonus}}</td>
      <td><strong>Prime prévoyance (incluse)</strong> <br> {{contract.foresightBonus}}</td>
      <td><strong>Frais d’adhésion</strong> <br> {{contract.membershipFees}}</td>
    </tr>
    <tr>
      <td><strong>Date d’effet</strong> <br> {{contract.startDate}}</td>
      <td><strong>Durée du contrat</strong> <br> {{contract.period}}</td>
      <td><strong>Date d’échéance</strong> <br> {{contract.dueDate}}</td>
      <td><strong>Rente annuelle</strong> <br> {{contract.annualPension}}</td>
    </tr>
  </table>

  {% comment %} <table>
    <tr><td colspan="4" class="section-title">DÉCLARATION DE BONNE SANTÉ</td></tr>
    <tr>
        <td colspan="4">Ne pas avoir eu de maladie ayant nécessité une hospitalisation, un traitement ou une surveillance médicale... <strong>OUI</strong></td>
        
    </tr>

    <tr>
        <td colspan="4">Ne etre titulaire d’une pension d’invalidité >= 20% pour accident ou maladie <strong>OUI</strong></td>
    </tr>

    <tr>
        <td colspan="4">Ne pas devoir subir une intervention chirurgicale ou des examens médicaux dans les 6 prochains mois <strong>OUI</strong></td>
    </tr>
  </table> {% endcomment %}
  {% comment %} saut de page {% endcomment %}
  <div style="page-break-after: always;"></div>
  <table>
    <tr><td colspan="4"  class="section-title">QUESTIONNAIRE MEDICAL</td></tr>

    <tr>
        <td colspan="4">
            {% for q in emp.employeeAnswer.all %}
            {{ q.question }} <strong>{{ q.answer }}</strong> <br>
            {% endfor %}
        </td>
    </tr>

  </table>

  <table style="margin-top: 20px; border-collapse: collapse; width: 100%;">
    <tr style="height: 50px;">
      <td colspan="2" style="border: none;text-align: left;"><strong>Visa SanlamAllianz Assurances Vie</strong></td>
      <td colspan="2" style="border: none;text-align: right;"><strong>Visa Assuré</strong></td>
    </tr>
  </table>
  

  

</body>
</html>
