ecarts de 0.01€ visible dans le tableau

This commit is contained in:
2026-09-09 21:42:17 +02:00
parent 5eca3804bf
commit 6e1c421e5b
3 changed files with 25 additions and 6 deletions
@@ -172,7 +172,13 @@ class LedgerRowsController extends ControllerBase {
'parCompte' => (object) $parCompte,
'somme' => $somme,
'ecart' => $ecart,
'hasError' => abs($ecart) > 0.01,
// "Écart visible" == non-zero to the centime. The presave/validation
// BLOCKING threshold stays at > 0.01 (tolerated rounding noise is
// savable), but a 0.01 écart is still a real mismatch and must be
// shown in the table -- at > 0.01 here it displayed nothing at all.
// 0.005 (not 0.0) keeps float representations of stored centimes
// from misclassifying.
'hasError' => abs($ecart) > 0.005,
'linkable' => in_array($type, self::LINKABLE_TYPES, TRUE),
'entreeLieeIds' => array_map(fn ($n) => $n->uuid(), $entreeLieeNodes),
'entreeLieeLabels' => array_map(fn ($n) => $n->getTitle() ?: $n->uuid(), $entreeLieeNodes),