<commit_before><ol class="breadcrumb">
    <?php if(!$sf_user->isAdmin()): ?>
        <li><a href="<?php echo url_for('accueil'); ?>">Accueil</a></li>
    <?php endif; ?>
  <li><a href="<?php if($sf_user->isAdmin()): ?><?php echo url_for('facturation'); ?><?php else: ?><?php echo url_for('facturation_declarant', $compte); ?><?php endif; ?>">Facturation</a></li>
  <li class="active"><a href=""><?php echo $compte->getNomAAfficher() ?> (<?php echo $compte->getIdentifiantAAfficher() ?>)</a></li>
</ol>

<?php use_helper('Date'); ?>
<?php use_helper('Float'); ?>
<?php use_helper('Generation'); ?>

<?php if ($sf_user->hasFlash('notice')): ?>
    <div class="alert alert-success" role="alert"><?php echo $sf_user->getFlash('notice') ?></div>
<?php endif; ?>

<?php if ($sf_user->hasFlash('error')): ?>
    <div class="alert alert-danger" role="alert"><?php echo $sf_user->getFlash('error') ?></div>
<?php endif; ?>

<?php if($sf_user->hasCredential(myUser::CREDENTIAL_ADMIN)): ?>
<h3>Générer une facture</h3>
<form method="post" action="" role="form" class="form-horizontal">
    <?php echo $form->renderHiddenFields(); ?>
    <?php echo $form->renderGlobalErrors(); ?>
    <div class="row">
        <div class="col-sm-8 col-xs-12">
          <?php if(isset($form["modele"])): ?>
            <div class="form-group <?php if($form["modele"]->hasError()): ?>has-error<?php endif; ?>">
                <?php echo $form["modele"]->renderError() ?>
                <?php echo $form["modele"]->renderLabel("Type de facture", array("class" => "col-xs-4 control-label")); ?>
                <div class="col-xs-8">
                <?php echo $form["modele"]->render(array("class" => "form-control")); ?>
                </div>
            </div>
          <?php endif; ?>
            <div class="form-group <?php if($form["date_facturation"]->hasError()): ?>has-error<?php endif; ?>">
                <?php echo $form["date_facturation"]->renderError(); ?>
                <?php echo $form["date_facturation"]->renderLabel("Date de facturation", array("class" => "col-xs-4 control-label")); ?>
                <div class="col-xs-8">
                    <div class="input-group date-picker-week">
                        <?php echo $form["date_facturation"]->render(array("class" => "form-control", "placeholder" => "Date de facturation")); ?>
                        <div class="input-group-addon">
                            <span class="glyphicon-calendar glyphicon"></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group text-right">
                <div class="col-xs-6 col-xs-offset-6">
                    <button class="btn btn-default btn-block btn-upper" type="submit">Générer la facture</button>
                </div>
            </div>
        </div>
    </div>
</form>
<?php endif; ?>

<div class="page-header">
    <h2>Espace Facture</h2>
</div>
<?php if(count($mouvements) && $sf_user->hasCredential(myUser::CREDENTIAL_ADMIN)): ?>
  <h3>Mouvements en attente de facturation</h3>
  <table class="table table-bordered table-striped">
    <thead>
        <tr>
            <th class="col-xs-2">Document</th>
            <th class="col-xs-2">Campagne</th>
            <th class="col-xs-4">Cotisation</th>
            <th class="col-xs-2">Taux</th>
            <th class="col-xs-1">Tva</th>
            <th class="col-xs-1">Montant HT</th>
        </tr>
    </thead>
    <tbody>
  <?php foreach ($mouvements as $keyMvt => $mvt): ?>
    <tr>
        <td><?php echo $mvt->getDocument()->getType();?></td>
        <td><?php echo format_date($mvt->date, "dd/MM/yyyy", "fr_FR"); ?></td>
        <td>Cotisation <?php echo $mvt->categorie; ?></td>
        <td class="text-right"><?php echo echoFloat($mvt->taux); ?></td>
        <td class="text-right"><?php echo echoFloat($mvt->tva); ?>&nbsp;%</td>
        <td class="text-right"><?php echo echoFloat($mvt->taux * $mvt->quantite); ?>&nbsp;€</td>
    </tr>
  <?php endforeach; ?>
  </tbody>
</table>
<?php endif; ?>
<h3>Liste des factures</h3>
<table class="table table-bordered table-striped">
    <thead>
        <tr>
            <th class="col-xs-2">Date</th>
            <th class="col-xs-2">Numéro</th>
            <th class="col-xs-2">Type</th>
            <th class="col-xs-4">Libellé</th>
            <th class="col-xs-2">Montant TTC</th>
            <?php if($sf_user->hasCredential(myUser::CREDENTIAL_ADMIN)): ?>
            <th style="witdth: 0;"></th><commit_msg>Tableau des mouvements en attente plus fournit<commit_after><ol class="breadcrumb">
    <?php if(!$sf_user->isAdmin()): ?>
        <li><a href="<?php echo url_for('accueil'); ?>">Accueil</a></li>
    <?php endif; ?>
  <li><a href="<?php if($sf_user->isAdmin()): ?><?php echo url_for('facturation'); ?><?php else: ?><?php echo url_for('facturation_declarant', $compte); ?><?php endif; ?>">Facturation</a></li>
  <li class="active"><a href=""><?php echo $compte->getNomAAfficher() ?> (<?php echo $compte->getIdentifiantAAfficher() ?>)</a></li>
</ol>

<?php use_helper('Date'); ?>
<?php use_helper('Float'); ?>
<?php use_helper('Generation'); ?>

<?php if ($sf_user->hasFlash('notice')): ?>
    <div class="alert alert-success" role="alert"><?php echo $sf_user->getFlash('notice') ?></div>
<?php endif; ?>

<?php if ($sf_user->hasFlash('error')): ?>
    <div class="alert alert-danger" role="alert"><?php echo $sf_user->getFlash('error') ?></div>
<?php endif; ?>

<?php if($sf_user->hasCredential(myUser::CREDENTIAL_ADMIN)): ?>
<h3>Générer une facture</h3>
<form method="post" action="" role="form" class="form-horizontal">
    <?php echo $form->renderHiddenFields(); ?>
    <?php echo $form->renderGlobalErrors(); ?>
    <div class="row">
        <div class="col-sm-8 col-xs-12">
          <?php if(isset($form["modele"])): ?>
            <div class="form-group <?php if($form["modele"]->hasError()): ?>has-error<?php endif; ?>">
                <?php echo $form["modele"]->renderError() ?>
                <?php echo $form["modele"]->renderLabel("Type de facture", array("class" => "col-xs-4 control-label")); ?>
                <div class="col-xs-8">
                <?php echo $form["modele"]->render(array("class" => "form-control")); ?>
                </div>
            </div>
          <?php endif; ?>
            <div class="form-group <?php if($form["date_facturation"]->hasError()): ?>has-error<?php endif; ?>">
                <?php echo $form["date_facturation"]->renderError(); ?>
                <?php echo $form["date_facturation"]->renderLabel("Date de facturation", array("class" => "col-xs-4 control-label")); ?>
                <div class="col-xs-8">
                    <div class="input-group date-picker-week">
                        <?php echo $form["date_facturation"]->render(array("class" => "form-control", "placeholder" => "Date de facturation")); ?>
                        <div class="input-group-addon">
                            <span class="glyphicon-calendar glyphicon"></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group text-right">
                <div class="col-xs-6 col-xs-offset-6">
                    <button class="btn btn-default btn-block btn-upper" type="submit">Générer la facture</button>
                </div>
            </div>
        </div>
    </div>
</form>
<?php endif; ?>

<div class="page-header">
    <h2>Espace Facture</h2>
</div>
<?php if(count($mouvements) && $sf_user->hasCredential(myUser::CREDENTIAL_ADMIN)): ?>
  <h3>Mouvements en attente de facturation</h3>
  <table class="table table-bordered table-striped">
    <thead>
        <tr>
            <th class="col-xs-1">Document</th>
            <th class="col-xs-1">Campagne</th>
            <th class="col-xs-4">Cotisation</th>
            <th class="col-xs-1">Quantite</th>
            <th class="col-xs-1">Prix unit.</th>
            <th class="col-xs-1">Tva</th>
            <th class="col-xs-2">Montant HT</th>
        </tr>
    </thead>
    <tbody>
  <?php foreach ($mouvements as $keyMvt => $mvt): ?>
    <tr>
        <td><?php echo $mvt->getDocument()->getType();?></td>
        <td><?php echo format_date($mvt->date, "dd/MM/yyyy", "fr_FR"); ?></td>
        <td><?php echo ucfirst($mvt->categorie); ?> <?php echo $mvt->type_libelle; ?></td>
        <td class="text-right"><?php echo echoFloat($mvt->quantite); ?></td>
        <td class="text-right"><?php echo echoFloat($mvt->taux); ?></td>
        <td class="text-right"><?php echo echoFloat($mvt->tva); ?>&nbsp;%</td>
        <td class="text-right"><?php echo echoFloat($mvt->taux * $mvt->quantite); ?>&nbsp;€</td>
    </tr>
  <?php endforeach; ?>
  </tbody>
</table>
<?php endif; ?>
<h3>Liste des factures</h3>
<table class="table table-bordered table-striped">
    <thead>
        <tr>
            <th class="col-xs-2">Date</th>
            <th class="col-xs-2">Numéro</th>
            <th class="col-xs-2">Type</th>
            <th class="col-xs-4">Libellé</th>
            <th class="col-xs-2">Montant TTC</th>
            <?php if($sf_user->hasCredential(myUser::CREDENTIAL_ADMIN)): ?>
            <th style="witdth: 0;"></th>
{'fraction_non_alphanumeric': 0.2217396025627104, 'fraction_numerical': 0.006406775980019546, 'mean_word_length': 2.6899038461538463, 'pattern_counts': {'":': 0, '<': 307, '<?xml version=': 0, '>': 379, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4265333', 'n_tokens_mistral': 3129, 'n_tokens_neox': 3085, 'n_words': 575}