Add solde totals footer row + fix JSON:API pagination duplicate bug

- tfoot row: sum per compte (créditeur/débiteur colored) for the
  currently filtered rows, plus HT/TTC/écart totals
- Fixed a real bug: fetchAllLignes() paginated without a unique sort key
  (field_date_ligne alone, many ties), which let Drupal's JSON:API return
  the same row on two pages -- silently inflating totals (Bachir showed
  -3115,38€ instead of -3013,56€). Now sorts by
  field_date_ligne,drupal_internal__nid (home) / drupal_internal__nid
  (dashboard), plus a defensive client-side de-dup by node id either way.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-03 23:04:33 +02:00
co-authored by Claude Sonnet 5
parent 41ab7445f7
commit 2ebfa3b413
4 changed files with 64 additions and 4 deletions
@@ -86,6 +86,15 @@
</tr>
</template>
</tbody>
<tfoot>
<tr class="figli-totals-row">
<td colspan="4">Solde (créditeur / débiteur) — {{ filteredRows.length }} lignes filtrées</td>
<td class="amount">{{ formatEur(footerTotals.montant_ht) }}</td>
<td class="amount">{{ formatEur(footerTotals.montant_ttc) }}</td>
<td v-for="c in allComptes" :key="c" class="amount compte-col" :class="soldeClass(footerTotals.parCompte[c])">{{ formatEur(footerTotals.parCompte[c]) }}</td>
<td class="amount" :class="soldeClass(footerTotals.ecart)">{{ formatEur(footerTotals.ecart) }}</td>
</tr>
</tfoot>
</table>
</div>
</div>