Add sous-traitant, salaire/stage, and charges local pro ligne types
Three new field_type_ligne values (config/sync +
figli_compta_ledger.install for fresh-install parity), wired through
every place that enumerates the type list: LedgerActionsController's
inline type-change endpoint, home.js's type dropdown/badge, dashboard.js's
per-type chart, home.css's badge colors.
Sous-traitant is linkable to field_entree_liee (pays out against a
client's work, like versement/achat); salaire/stage and charges local
pro are not (structural costs, like charge). Turns out 13 lines
already carried "salaire_stage" and 1 "sous_traitant" as raw field
values from the historical migration -- list_string doesn't enforce
allowed_values at the storage level, so they saved fine but had no
label and weren't selectable in the UI until now.
Also fixes a real bug this surfaced: filtering /lignes by a sparse
type (e.g. "Autre") silently broke the sliding window -- so few rows
matched that the table no longer overflowed, so it never fired another
'scroll' event, so loadOlder()/loadNewer() never ran again ("les lignes
antérieures ne chargent plus"). Added ensureScrollable(), which keeps
extending the window in both directions whenever a thinning filter
(compte/client/type/écarts) leaves too little to scroll, and widened
the trim cap while filtering (MAX_LOADED_MONTHS_FILTERED) since the
normal 30-month cap actively fights a sparse filter -- extending one
end and immediately trimming the other nets out to nearly the same
slice every round. Bounded by a round counter rather than "did the
window stop moving": addMonths() uses Date#setMonth(), which isn't
invertible for month-end dates, so the window can drift indefinitely
in tiny steps without ever exactly repeating.
Verified: filtering by "Autre" now finds 24 matches (was stuck at 1)
and the view becomes scrollable within ~17s, settling cleanly rather
than hanging.
This commit is contained in:
@@ -215,6 +215,9 @@ html.gin--dark-mode #figli-home-app {
|
||||
#figli-home-app .type-achat { background: #1d4ed81a; color: #3b6fe0; }
|
||||
#figli-home-app .type-hebergement { background: #0e91821a; color: #0e9182; }
|
||||
#figli-home-app .type-ouverture { background: #7c3aed1a; color: #9061f0; }
|
||||
#figli-home-app .type-sous_traitant { background: #c9312b1a; color: #c9312b; }
|
||||
#figli-home-app .type-salaire_stage { background: #0891b21a; color: #0891b2; }
|
||||
#figli-home-app .type-charges_local_pro { background: #65a30d1a; color: #65a30d; }
|
||||
#figli-home-app .type-autre { background: #6b72801a; color: var(--figli-text-light); }
|
||||
|
||||
/* Click-to-edit type badge -- swaps for a native <select> in place
|
||||
|
||||
Reference in New Issue
Block a user