Fetches field_flag alongside the existing entrée/versement data (same JSON:API include list, same buildRows() shape as home.js's flags/ hasFlag). Two changes: - Rows already shown in the reste-à-verser/sur-versé/non-liés tables get the same amber left-edge accent + tag badges as /lignes when they're also flagged. - New "Lignes signalées" section lists every flagged entrée/versement for the selected compte, including ones that don't appear in any of the other tables -- a fully-settled line can still carry a flag for an unrelated reason (e.g. "client injoignable"), which none of the reconciliation-based tables would otherwise surface. Verified live against an isolated test node plus two real flagged lines already present in production data (client had already started using the /lignes signalement feature) -- both the section and the inline badges render correctly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
149 lines
8.1 KiB
Twig
149 lines
8.1 KiB
Twig
{#
|
|
Dashboard par compte associé (freelance) : un compte à la fois, choisi
|
|
dans le sélecteur. Se concentre sur entrée client / versement freelance
|
|
uniquement -- l'objectif principal est de faire ressortir les versements
|
|
pas (encore) compensés par une entrée, pas de donner une vue comptable
|
|
complète (voir /dashboard pour ça).
|
|
|
|
{% verbatim %} ci-dessous : syntaxe Vue, pas Twig -- voir
|
|
figli-compta-dashboard.html.twig pour la même remarque.
|
|
#}
|
|
<nav class="figli-page-nav">
|
|
<a href="{{ path('figli_compta_ledger.home') }}" class="{{ current_route == 'figli_compta_ledger.home' ? 'is-active' : '' }}">Grand livre</a>
|
|
<a href="{{ path('figli_compta_ledger.dashboard') }}" class="{{ current_route == 'figli_compta_ledger.dashboard' ? 'is-active' : '' }}">Dashboard</a>
|
|
<a href="{{ path('figli_compta_ledger.dashboard_compte') }}" class="{{ current_route == 'figli_compta_ledger.dashboard_compte' ? 'is-active' : '' }}">Par compte</a>
|
|
</nav>
|
|
{% verbatim %}
|
|
<div id="figli-dashboard-app">
|
|
<p v-if="loading">Chargement des données…</p>
|
|
<p v-else-if="error" class="figli-error">Erreur de chargement du tableau de bord : {{ error }}</p>
|
|
<template v-else>
|
|
<div class="figli-compte-selector">
|
|
<label for="figli-compte-select">Compte associé</label>
|
|
<select id="figli-compte-select" :value="selectedCompte" @change="selectCompte($event.target.value)">
|
|
<option v-for="c in comptes" :key="c" :value="c">{{ c }}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="figli-summary-row">
|
|
<div class="figli-summary-card">
|
|
<div class="figli-summary-label">Solde actuel</div>
|
|
<div class="figli-summary-value" :class="soldeActuel < 0 ? 'is-negative' : 'is-positive'">{{ formatEurRound(soldeActuel) }}</div>
|
|
</div>
|
|
<div class="figli-summary-card" :class="{'is-alert': totalResteAVerser > 0.01}">
|
|
<div class="figli-summary-label">Reste à verser</div>
|
|
<div class="figli-summary-value" :class="totalResteAVerser > 0.01 ? 'is-negative' : ''">{{ formatEurRound(totalResteAVerser) }}</div>
|
|
</div>
|
|
<div class="figli-summary-card" v-if="totalSurVerse > 0.01">
|
|
<div class="figli-summary-label">Sur-versé</div>
|
|
<div class="figli-summary-value is-negative">{{ formatEurRound(totalSurVerse) }}</div>
|
|
</div>
|
|
<div class="figli-summary-card" :class="{'is-alert': totalNonLies > 0.01}" v-if="versementsNonLies.length">
|
|
<div class="figli-summary-label">Versements non liés</div>
|
|
<div class="figli-summary-value is-negative">{{ formatEurRound(totalNonLies) }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<section class="figli-chart-section">
|
|
<h2>Reste à verser -- entrées non (entièrement) compensées</h2>
|
|
<p class="figli-note">Pour {{ selectedCompte }} : entrées client dont la part attribuée n'a pas encore été entièrement reversée. Triées de la plus ancienne à la plus récente.</p>
|
|
<table v-if="resteAVerserPositif.length" class="figli-recon-table">
|
|
<thead>
|
|
<tr><th>Date</th><th>Client</th><th>Libellé</th><th>Attribué</th><th>Déjà versé</th><th>Reste à verser</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="r in resteAVerserPositif" :key="r.entree.id" :class="{'figli-flag-row': r.entree.hasFlag}">
|
|
<td>{{ formatDate(r.entree.date) }}</td>
|
|
<td><a :href="ligneHref(r.entree.client)">{{ r.entree.client || '—' }}</a></td>
|
|
<td>{{ r.entree.libelle || '—' }}<span v-for="f in r.entree.flags" :key="f" class="figli-flag-badge">{{ f }}</span></td>
|
|
<td>{{ formatEur(r.montantAttribue) }}</td>
|
|
<td>{{ formatEur(r.dejaVerse) }}</td>
|
|
<td class="is-negative">{{ formatEur(r.residual) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
<tfoot>
|
|
<tr><td colspan="5">Total</td><td class="is-negative">{{ formatEurRound(totalResteAVerser) }}</td></tr>
|
|
</tfoot>
|
|
</table>
|
|
<p v-else class="figli-note">Rien en attente -- toutes les entrées de ce compte sont compensées.</p>
|
|
</section>
|
|
|
|
<section class="figli-chart-section" v-if="surVerseRows.length">
|
|
<h2>Entrées sur-versées</h2>
|
|
<p class="figli-note">Le montant versé pour ces entrées dépasse la part attribuée à {{ selectedCompte }} -- à vérifier.</p>
|
|
<table class="figli-recon-table">
|
|
<thead>
|
|
<tr><th>Date</th><th>Client</th><th>Libellé</th><th>Attribué</th><th>Versé</th><th>Sur-versé</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="r in surVerseRows" :key="r.entree.id" :class="{'figli-flag-row': r.entree.hasFlag}">
|
|
<td>{{ formatDate(r.entree.date) }}</td>
|
|
<td><a :href="ligneHref(r.entree.client)">{{ r.entree.client || '—' }}</a></td>
|
|
<td>{{ r.entree.libelle || '—' }}<span v-for="f in r.entree.flags" :key="f" class="figli-flag-badge">{{ f }}</span></td>
|
|
<td>{{ formatEur(r.montantAttribue) }}</td>
|
|
<td>{{ formatEur(r.dejaVerse) }}</td>
|
|
<td class="is-negative">{{ formatEur(-r.residual) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section class="figli-chart-section" v-if="versementsNonLies.length">
|
|
<h2>Versements sans entrée liée</h2>
|
|
<p class="figli-note">Versements de {{ selectedCompte }} qui ne pointent vers aucune entrée client -- ni "reste à verser" ni "sur-versé" ci-dessus ne les couvre.</p>
|
|
<table class="figli-recon-table">
|
|
<thead>
|
|
<tr><th>Date</th><th>Client</th><th>Libellé</th><th>Montant</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="r in versementsNonLies" :key="r.id" :class="{'figli-flag-row': r.hasFlag}">
|
|
<td>{{ formatDate(r.date) }}</td>
|
|
<td><a :href="ligneHref(r.client)">{{ r.client || '—' }}</a></td>
|
|
<td>{{ r.libelle || '—' }}<span v-for="f in r.flags" :key="f" class="figli-flag-badge">{{ f }}</span></td>
|
|
<td class="is-negative">{{ formatEur(r.parCompte[selectedCompte]) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section class="figli-chart-section" v-if="lignesSignalees.length">
|
|
<h2>Lignes signalées</h2>
|
|
<p class="figli-note">Entrées et versements de {{ selectedCompte }} portant un signalement (voir la colonne "Signalement" dans le grand livre) -- indépendant du solde, une ligne déjà réglée peut quand même être signalée pour une autre raison.</p>
|
|
<table class="figli-recon-table">
|
|
<thead>
|
|
<tr><th>Date</th><th>Type</th><th>Client</th><th>Libellé</th><th>Signalement</th><th>Montant</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="r in lignesSignalees" :key="r.id" class="figli-flag-row">
|
|
<td>{{ formatDate(r.date) }}</td>
|
|
<td>{{ r.type === 'entree' ? 'Entrée' : 'Versement' }}</td>
|
|
<td><a :href="ligneHref(r.client)">{{ r.client || '—' }}</a></td>
|
|
<td>{{ r.libelle || '—' }}</td>
|
|
<td><span v-for="f in r.flags" :key="f" class="figli-flag-badge">{{ f }}</span></td>
|
|
<td :class="r.parCompte[selectedCompte] < 0 ? 'is-negative' : ''">{{ formatEur(r.parCompte[selectedCompte]) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section class="figli-chart-section">
|
|
<h2>Entrées vs versements par année</h2>
|
|
<p class="figli-note">Part de {{ selectedCompte }} dans les entrées client (vert) et ses versements (rouge), année par année.</p>
|
|
<year-bars-chart :years="entreeVsVersementYears" :format-value="formatEurRound"></year-bars-chart>
|
|
</section>
|
|
|
|
<section class="figli-chart-section">
|
|
<h2>Évolution du solde</h2>
|
|
<p class="figli-note">Solde de clôture de {{ selectedCompte }}, année par année (ouverture comprise).</p>
|
|
<year-bars-chart :years="evolutionSoldeYears" :format-value="formatEurRound"></year-bars-chart>
|
|
</section>
|
|
|
|
<section class="figli-chart-section" v-if="topClientsItems.length">
|
|
<h2>Top clients</h2>
|
|
<p class="figli-note">Clients ayant généré le plus d'entrées attribuées à {{ selectedCompte }}, toutes années confondues.</p>
|
|
<h-bar-chart :items="topClientsItems" :format-value="formatEurRound"></h-bar-chart>
|
|
</section>
|
|
</template>
|
|
</div>
|
|
{% endverbatim %}
|