Renomme HT/TTC, réduit leur largeur, ajoute une colonne TVA au grand livre
HT/TTC passent de "Montant HT"/"Montant TTC" à "HT"/"TTC" (5% de large au lieu de 6,2%), avec une nouvelle colonne TVA entre les deux (3,5%, affichée en %, arrondie à 2 décimales -- les lignes migrées portent parfois un taux rétro-calculé à 4 décimales, voir figli_compta_ledger_update_8005()). field_tva était déjà exposé sans changement de requête JSON:API (pas de sparse fieldset ici). Piège de spécificité CSS : .amount:not(.compte-col) (déjà en place pour Écart) compte comme 2 classes à cause de :not(), donc un simple .figli-ht-col à une classe perdait systématiquement contre elle -- recombiné en .amount.figli-ht-col pour égaler/dépasser sa spécificité.
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
|
||||
const API_BASE = '/jsonapi/node/ligne_comptable';
|
||||
const EUR = new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' });
|
||||
// Not style: 'percent' -- that expects a fraction (0.10) and field_tva
|
||||
// stores a plain rate (10), which style: 'percent' would otherwise
|
||||
// silently read as 1000%.
|
||||
const PCT = new Intl.NumberFormat('fr-FR', { minimumFractionDigits: 0, maximumFractionDigits: 2 });
|
||||
const MONTHS = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'];
|
||||
const TYPE_LABELS = {
|
||||
entree: 'Entrée client',
|
||||
@@ -365,6 +369,7 @@
|
||||
facture: attrs.field_numero_facture || null,
|
||||
libelle: attrs.field_notes || attrs.title,
|
||||
montant_ht: montantHt,
|
||||
tva: attrs.field_tva !== null && attrs.field_tva !== undefined ? parseFloat(attrs.field_tva) : null,
|
||||
montant_ttc: attrs.field_montant_ttc !== null && attrs.field_montant_ttc !== undefined ? parseFloat(attrs.field_montant_ttc) : null,
|
||||
parCompte,
|
||||
somme,
|
||||
@@ -668,6 +673,13 @@
|
||||
formatEur(v) {
|
||||
return v === null || v === undefined ? '' : EUR.format(v);
|
||||
},
|
||||
// Historical lines can carry a backfilled, non-round rate (e.g.
|
||||
// 12.6414 -- see figli_compta_ledger_update_8005()'s docblock for
|
||||
// why); rounded to 2 decimals for display, same as every amount
|
||||
// column here, rather than showing the full stored precision.
|
||||
formatPct(v) {
|
||||
return v === null || v === undefined ? '' : PCT.format(v) + ' %';
|
||||
},
|
||||
// Écart between this ouverture row's year and the previous year's
|
||||
// calculated closing balance -- restricted to whichever compte(s)
|
||||
// this specific row's répartition actually touches (ouverture lines
|
||||
|
||||
Reference in New Issue
Block a user