Add field_numero_facture (N° Facture), a Facture column, and backfill existing content

New plain string field on ligne_comptable, positioned after Client in
both form and view displays. Added as a "Facture" column in both the
main table and the entrée/sortie drill-down modal, right after Type.

Backfilled via figli_compta_ledger_update_8002() by extracting an
invoice number from field_notes (or title, same fallback the front-end
libellé already uses) wherever the pattern is unambiguous: literal F,
optional _/-, 2-8 digits, optional "-digits" continuations for a
compound reference (e.g. "F2549-50-51"), optional 0-3 trailing
uppercase letters (e.g. "F250427A"), with a hard boundary right after --
not immediately followed by more letters/digits/underscore. That last
part is what skips "F58_260506_FIGLI" or "F_2601_FIGLI_EPAU": no way to
tell whether the trailing "_xxx" belongs to the reference or is an
unrelated client/description code glued on, so those are left blank
rather than guessed, per explicit instruction to skip when unsure.

Verified the pattern against every existing ligne_comptable's
notes/title before writing the migration: 319 confident matches with no
false positives found on manual review of the full list, 1236 left
blank. Applied via drush updb, config exported.
This commit is contained in:
2026-09-05 22:37:34 +02:00
parent 852eda2056
commit b6540e56c7
7 changed files with 151 additions and 13 deletions
@@ -9,6 +9,7 @@ dependencies:
- field.field.node.ligne_comptable.field_montant_ht
- field.field.node.ligne_comptable.field_montant_ttc
- field.field.node.ligne_comptable.field_notes
- field.field.node.ligne_comptable.field_numero_facture
- field.field.node.ligne_comptable.field_repartition
- field.field.node.ligne_comptable.field_type_ligne
- node.type.ligne_comptable
@@ -75,6 +76,14 @@ content:
rows: 5
placeholder: ''
third_party_settings: { }
field_numero_facture:
type: string_textfield
weight: 3
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_repartition:
type: paragraphs
weight: 5
@@ -9,6 +9,7 @@ dependencies:
- field.field.node.ligne_comptable.field_montant_ht
- field.field.node.ligne_comptable.field_montant_ttc
- field.field.node.ligne_comptable.field_notes
- field.field.node.ligne_comptable.field_numero_facture
- field.field.node.ligne_comptable.field_repartition
- field.field.node.ligne_comptable.field_type_ligne
- node.type.ligne_comptable
@@ -76,6 +77,15 @@ content:
third_party_settings: { }
weight: 6
region: content
field_numero_facture:
type: string
label: above
settings:
link_to_entity: false
link_rel: canonical
third_party_settings: { }
weight: 3
region: content
field_repartition:
type: entity_reference_revisions_entity_view
label: above
@@ -0,0 +1,19 @@
uuid: f090cb6f-56d8-44cf-b18c-9f81fd3fd518
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_numero_facture
- node.type.ligne_comptable
id: node.ligne_comptable.field_numero_facture
field_name: field_numero_facture
entity_type: node
bundle: ligne_comptable
label: 'N° Facture'
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
@@ -0,0 +1,21 @@
uuid: 6819b88a-a788-471f-bae0-a363bb9a1670
langcode: en
status: true
dependencies:
module:
- node
id: node.field_numero_facture
field_name: field_numero_facture
entity_type: node
type: string
settings:
max_length: 64
case_sensitive: false
is_ascii: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false