<commit_before><?php
use_helper('Date');
?>
<h2>Historique des factures de <?php echo $societe->getRaisonSociale() ?></h2>
<?php if (count($factures)): ?>
<table class="table table-striped">
    <thead>
        <tr>
            <th class="col-xs-1">Type</th>
            <th class="col-xs-1">Document</th>
            <th class="col-xs-1">Numéro</th>
            <th class="col-xs-3">Date de facturation</th>
            <th class="col-xs-1"></th>
            <th class="col-xs-1 text-right">Montant&nbsp;HT</th>
            <th class="col-xs-1 text-right">Montant&nbsp;TTC</th>
            <th class="col-xs-3"></th>
        </tr>
    </thead>
    <tbody>
        <?php $fc = FactureClient::getInstance(); ?>
        <?php foreach ($factures->getRawValue() as $facture): ?>
            <?php $f = $fc->find($facture->id); ?>
            <?php $date = $date = format_date($facture->value[FactureSocieteView::VALUE_DATE_FACTURATION], 'dd/MM/yyyy') . ' (créée le ' . $fc->getDateCreation($facture->id) . ')'; ?>
            <tr>
                <td><?php if ($f->isAvoir()): ?>AVOIR<?php else: ?>FACTURE<?php endif; ?></td>
                <td><?php if ($f->isFactureDRM()): ?>DRM<?php elseif($f->isFactureSV12()): ?>SV12<?php elseif($f->isFactureDivers()): ?>Libre<?php endif; ?></td>
                <td>N°&nbsp;<?php echo $f->numero_piece_comptable ?></td>
                <td><?php echo $date; ?></td>
                <td><?php if($f->isRedressee()): ?><span class="label label-warning">Redressée</span><?php endif;?></td>
                <td class="text-right"><?php echo echoFloat($f->total_ht); ?>&nbsp;€</td>
                <td class="text-right"><?php echo echoFloat($f->total_ttc); ?>&nbsp;€</td>
                <td class="text-right">
                    <div class="btn-group text-left">
                    <?php if ($f->isRedressable() && $sf_user->hasCredential(AppUser::CREDENTIAL_ADMIN)): ?>
                        <a onclick="return confirm('Êtes-vous sur de vouloir annuler cette facture en créant un avoir ?');" href="<?php echo url_for("facture_defacturer", array("id" => $f->_id)) ?>" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-repeat"></span>&nbsp;Défacturer</a>
                    <?php endif; ?>
                    <a href="<?php echo url_for("facture_pdf", array("id" => $f->_id)) ?>" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-file"></span>&nbsp;Visualiser</a>
                    </div>
                    <?php if($sf_user->hasCredential(AppUser::CREDENTIAL_ADMIN)): ?>
                    &nbsp;&nbsp;<span style="opacity: 0.8;" data-toggle="tooltip" title="La facture a été téléchargée par l'opérateur" class="glyphicon glyphicon-eye-open <?php if(!$f->isTelechargee()): ?>invisible<?php endif; ?>"></span>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table><commit_msg>adaptation du listing facture pour le paiement<commit_after><?php
use_helper('Date');
?>
<h2>Historique des factures de <?php echo $societe->getRaisonSociale() ?></h2>
<?php if (count($factures)): ?>
<table class="table table-striped">
    <thead>
        <tr>
            <th class="col-xs-1">Type</th>
            <th class="col-xs-1">Document</th>
            <th class="col-xs-1">Numéro</th>
            <th class="col-xs-3">Date de facturation</th>
            <th class="col-xs-1"></th>
            <?php if(FactureConfiguration::getInstance()->getPaiementsActif()): ?>
              <th class="col-xs-1 text-right">Montant&nbsp;TTC</th>
              <th class="col-xs-1 text-right">Montant&nbsp;payé</th>
            <?php else: ?>
              <th class="col-xs-1 text-right">Montant&nbsp;HT</th>
              <th class="col-xs-1 text-right">Montant&nbsp;TTC</th>
            <?php endif; ?>
            <th class="col-xs-3"></th>
        </tr>
    </thead>
    <tbody>
        <?php $fc = FactureClient::getInstance(); ?>
        <?php foreach ($factures->getRawValue() as $facture): ?>
            <?php $f = $fc->find($facture->id); ?>
            <?php $date = $date = format_date($facture->value[FactureSocieteView::VALUE_DATE_FACTURATION], 'dd/MM/yyyy') . ' (créée le ' . $fc->getDateCreation($facture->id) . ')'; ?>
            <tr>
                <td><?php if ($f->isAvoir()): ?>AVOIR<?php else: ?>FACTURE<?php endif; ?></td>
                <td><?php if ($f->isFactureDRM()): ?>DRM<?php elseif($f->isFactureSV12()): ?>SV12<?php elseif($f->isFactureDivers()): ?>Libre<?php endif; ?></td>
                <td>N°&nbsp;<?php echo $f->numero_piece_comptable ?></td>
                <td><?php echo $date; ?></td>
                <td><?php if($f->isRedressee()): ?><span class="label label-warning">Redressée</span><?php endif;?></td>
                <?php if(FactureConfiguration::getInstance()->getPaiementsActif()): ?>
                  <td class="text-right"><?php echo echoFloat($f->total_ttc); ?>&nbsp;€</td>
                    <td class="text-right"><?php echo echoFloat($f->getMontantPaiement()); ?>&nbsp;€</td>
                <?php else: ?>
                  <td class="text-right"><?php echo echoFloat($f->total_ht); ?>&nbsp;€</td>
                  <td class="text-right"><?php echo echoFloat($f->total_ttc); ?>&nbsp;€</td>
                <?php endif; ?>
                <td class="text-right">
                    <div class="btn-group text-left">
                        <?php if(FactureConfiguration::getInstance()->getPaiementsActif()): ?>
                          <button type="button" class="btn btn-default btn-default-step btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-cog"></span>&nbsp;<span class="caret"></span></button>
                          <ul class="dropdown-menu dropdown-menu-right">
                              <?php if ($f->isRedressable() && $sf_user->hasCredential(AppUser::CREDENTIAL_ADMIN)): ?>
                                <li><a onclick="return confirm('Êtes-vous sur de vouloir annuler cette facture en créant un avoir ?');" href="<?php echo url_for("facture_defacturer", array("id" => $f->_id)) ?>"><span class="glyphicon glyphicon-repeat"></span>&nbsp;Défacturer</a></li>
                              <?php else: ?>
                                <li  class="disabled"><a href=""><span class="glyphicon glyphicon-repeat"></span>&nbsp;Défacturer</a></li>
                              <?php endif; ?>
                              <?php if ($f->isAvoir()): ?>
                                <li  class="disabled"><a href="">Saisir / modifier les paiements</a></li>
                              <?php else: ?>
                                <li><a href="<?php echo url_for("facture_paiements", array("id" => $f->_id)) ?>">Saisir / modifier les paiements</a></li>
                              <?php endif; ?>
                          </ul>
                        <?php else: ?>
                          <?php if ($f->isRedressable() && $sf_user->hasCredential(AppUser::CREDENTIAL_ADMIN)): ?>
                          <a onclick="return confirm('Êtes-vous sur de vouloir annuler cette facture en créant un avoir ?');" href="<?php echo url_for("facture_defacturer", array("id" => $f->_id)) ?>" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-repeat"></span>&nbsp;Défacturer</a>
                          <?php endif; ?>
                        <?php endif; ?>
                    <a href="<?php echo url_for("facture_pdf", array("id" => $f->_id)) ?>" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-file"></span>&nbsp;Visualiser</a>
                    </div>
                    <?php if($sf_user->hasCredential(AppUser::CREDENTIAL_ADMIN)): ?>
                    &nbsp;&nbsp;<span style="opacity: 0.8;" data-toggle="tooltip" title="La facture a été téléchargée par l'opérateur" class="glyphicon glyphicon-eye-open <?php if(!$f->isTelechargee()): ?>invisible<?php endif; ?>"></span>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
{'fraction_non_alphanumeric': 0.1987179487179487, 'fraction_numerical': 0.004191321499013806, 'mean_word_length': 2.2912778904665316, 'pattern_counts': {'":': 0, '<': 232, '<?xml version=': 0, '>': 290, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7491503', 'n_tokens_mistral': 2601, 'n_tokens_neox': 2537, 'n_words': 467}