| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
- <h2 class="bd-title" id="content">
- <span>Etat des comptes</span>
- <a href="/?p=compte-upload&add=<?php echo core::getGet("id") ?>" style="position: absolute; right: 0; margin: 38px 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="plus-square"></span> Charger un CSV</button></a>
- </h2>
- </header>
- <?php
- $banque = banque::getInitialCompte(core::getGet("id"));
- $etatCompte = banque::getEtatCompte(core::getGet("id"));
- echo core::filAriane(array(
- "current" => $banque["label"] . " (" . banque::getEuro($etatCompte["solde"]) . " au " . core::convertDate($etatCompte["date"], FALSE). ")",
- "arbo" => array(
- "Comptes bancaires" => NULL,
- $banque["label"] . " (" . banque::getEuro($etatCompte["solde"]) . " au " . core::convertDate($etatCompte["date"], FALSE) . ")" => "/compte-". core::getGet("id") .".html")
- ));
- //json::create("banque-lignes-".core::getGet("id"));
- ?>
- <div>
- <table
- id="table"
- class="table-striped table-hover table-sm"
- data-toggle="table"
- data-page-size="25"
- data-pagination="true"
- data-show-footer="true"
- data-search="true"
- data-buttons-align="left"
- data-filter-control="true"
- data-flat="true"
- data-sort-name="num"
- data-sort-order="desc"
- data-url="/json.php?file=banque-lignes-<?php echo core::getGet("id") ?>">
- <thead>
- <tr>
- <th data-sortable="true" data-field="num" data-width="20">#</th>
- <th data-sortable="true" data-field="date" data-filter-control="input" data-width="160">Date</th>
- <th data-sortable="true" data-field="label" data-filter-control="input">Label</th>
- <th data-sortable="true" data-formatter="dataFormatter" data-field="debit" data-filter-control="input" data-width="150" data-footer-formatter="debitFormatter">Débit</th>
- <th data-sortable="true" data-formatter="dataFormatter" data-field="credit" data-filter-control="input" data-width="150" data-footer-formatter="creditFormatter">Crédit</th>
- <th data-sortable="true" data-formatter="dataFormatter" data-field="solde" data-filter-control="input" data-width="150">Solde</th>
- </tr>
- </thead>
- </table>
- </div>
- <script>
- let euro = Intl.NumberFormat('de-DE', {
- style: 'currency',
- currency: 'EUR',
- });
- function dataFormatter(value) {
- return euro.format(value);
- }
- function debitFormatter(data) {
- var total = 0;
- data.forEach(function (row) {
- total += parseFloat(row.debit);
- });
- return parseFloat(total) === 0 ? euro.format(0.00) : euro.format(total.toFixed(2));
- }
- function creditFormatter(data) {
- var total = 0;
- data.forEach(function (row) {
- total += parseFloat(row.credit);
- });
- return parseFloat(total) === 0 ? euro.format(0.00) : euro.format(total.toFixed(2));
- }
- </script>
|