| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- $jsonTarget = "/json.php?file=banque-lignes-".core::getGet("id");
- if(debug::isFile("debug")){
- debug::log(debug::getBadge($jsonTarget, "OUVRIR LE JSON : ".$jsonTarget), "JSON chargé en arrière plan");
- }
- ?>
- <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>
- </h2>
- <?php if(access::ifAccesss("compte-upload")){ ?>
- <div class="fix-container-button-nav">
- <a href="/?p=compte-upload&add=<?php echo core::getGet("id") ?>"><button type="submit" class="btn btn-outline-success btn-sm"><?php icon::getFont(["icon" => "bi bi-file-earmark-plus"]) ?> Charger un CSV</button></a>
- </div>
- <?php } ?>
- </header>
- <?php
- $banque = banque::getInitialCompte(core::getGet("id"));
- $etatCompte = banque::getEtatCompte(core::getGet("id"));
- echo core::filAriane(array(
- "current" => $banque["label"],
- "arbo" => array(
- "Comptes bancaires" => NULL,
- $banque["label"] => "/compte-". core::getGet("id") .".html")
- ));
- ?>
- <div class="bd-callout bd-callout-info">
- <h4>Note</h4>
- <p>La dernier import des données du compte a été réalisée le <span class="fw-bold"><?php echo core::convertDate(banque::lastRecord(core::getGet("id"))) ?></span> et à cette même date le solde était de <span class="fw-bold"><?php echo banque::getEuro($etatCompte["solde"]) ?></span></p>
- </div>
- <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-buttons-align="left"
- data-filter-control="true"
- data-flat="true"
- data-sort-name="num"
- data-sort-order="desc"
- data-url="<?php echo $jsonTarget ?>">
- <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>
|