diff --git a/config/sync/field.field.node.ligne_comptable.field_tva.yml b/config/sync/field.field.node.ligne_comptable.field_tva.yml index 2501fe3..38dde8d 100644 --- a/config/sync/field.field.node.ligne_comptable.field_tva.yml +++ b/config/sync/field.field.node.ligne_comptable.field_tva.yml @@ -15,7 +15,7 @@ required: false translatable: true default_value: - - value: 0.0 + value: 10.0 default_value_callback: '' settings: min: null diff --git a/web/modules/custom/figli_compta_ledger/css/ledger-form.css b/web/modules/custom/figli_compta_ledger/css/ledger-form.css index 3abb417..968a660 100644 --- a/web/modules/custom/figli_compta_ledger/css/ledger-form.css +++ b/web/modules/custom/figli_compta_ledger/css/ledger-form.css @@ -148,10 +148,16 @@ html.gin--dark-mode .figli-ledger-form { figli_compta_ledger_node_presave()) -- a faint fill and full opacity (overriding the browser's default half-transparent disabled look, which would make the computed number harder to read) instead of the - plain white/transparent of an editable field. */ + plain white/transparent of an editable field. -webkit-text-fill-color + specifically: Chromium renders disabled/autofilled input text through + this property instead of `color` -- left alone, it defaults to a + fixed grey that's illegible against either theme's --flform-bg-subtle + (near-invisible dark-grey-on-dark-grey in dark mode, the actual bug + reported; same risk in light mode against a light fill). */ .figli-ledger-form input:disabled.form-element { background: var(--flform-bg-subtle); color: var(--flform-text); + -webkit-text-fill-color: var(--flform-text); opacity: 1; cursor: default; } diff --git a/web/modules/custom/figli_compta_ledger/figli_compta_ledger.install b/web/modules/custom/figli_compta_ledger/figli_compta_ledger.install index b18675c..8a0e947 100644 --- a/web/modules/custom/figli_compta_ledger/figli_compta_ledger.install +++ b/web/modules/custom/figli_compta_ledger/figli_compta_ledger.install @@ -388,13 +388,13 @@ function figli_compta_ledger_update_8003() { function figli_compta_ledger_update_8004() { _figli_field('node', 'ligne_comptable', 'field_tva', 'TVA (%)', 'decimal', ['precision' => 8, 'scale' => 4, 'min' => 0]); - // New lines default to 0% rather than blank -- the common case (every - // type other than charge/entrée/achat/hébergement with a real invoice) - // has no VAT at all, so this is one less field associates need to - // touch for most lines. + // New lines default to 10% (taux intermédiaire) rather than blank -- + // most new lines associates enter do carry VAT, so this saves a click + // on the common case instead of silently defaulting to "no VAT" for + // every line unless someone remembers to change it. $field_tva = FieldConfig::loadByName('node', 'ligne_comptable', 'field_tva'); if ($field_tva && $field_tva->getDefaultValueLiteral() === []) { - $field_tva->setDefaultValue(0)->save(); + $field_tva->setDefaultValue(10)->save(); } // Weights are plain integers -- entity_display component config diff --git a/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module b/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module index ca6f009..3f03610 100644 --- a/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module +++ b/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module @@ -141,7 +141,11 @@ function figli_compta_ledger_form_alter(&$form, FormStateInterface $form_state, $current = $tva_field['#default_value'] ?? NULL; $rate_default = 'autre'; if ($current === NULL || $current === '') { - $rate_default = '0'; + // 10 % (taux intermédiaire), not 0 -- most new lines associates + // enter do carry VAT, so this saves a click on the common case + // instead of silently defaulting to "no VAT" for every line + // unless someone remembers to change it. + $rate_default = '10'; } else { foreach (array_keys($taux_officiels) as $rate) {