Note (2026-04-24): After this document was written,
legal_entitywas renamed totenantand the oldtenantwas renamed toorganization. Read references to these terms with the pre-rename meaning.
Replace the current two-field inline editing for line-item debit account, credit account, and cost center with a single picker control per field, populated from legal-entity master data.
This design covers:
This design does not cover:
The current line-item UI renders debit and credit account as two separate editable fields each: one for :number and one for :name. Issue #358 requires replacing that with a single field, preferably backed by master data. Cost centers should follow the same transport and picker pattern.
Use an HTMX endpoint that returns an editor fragment on demand.
The initial document detail page will not preload GL accounts or cost centers into the HTML. When the user activates one of the supported fields, HTMX requests a field-specific editor fragment from the backend. That fragment includes:
The endpoint returns only one category per request:
gl-accounts for debit/credit account fieldscost-centers for cost center fieldsUse client-side filtering only.
Assumption: each legal entity will remain below roughly 500 items per category, so loading the full category dataset into the editor fragment is acceptable.
Filtering is case-insensitive substring matching over:
numbernameemployee for cost centers when presentThere is no server-side search and no fuzzy search in this design.
Use a custom single-field combobox, not a native <select> or <datalist>.
The combobox is loaded via HTMX and then filters locally in JavaScript against the embedded dataset.
[{:number "4000"
:name "Travel Expense"}]
[{:number "CC-100"
:name "Operations"
:employee "Max Mustermann"}]
Notes:
id.number is the business key used by the picker.search-text.Each supported field is rendered as a single combined display value.
Examples:
4000 Travel Expense120000 KreditorenCC-100 Operations - Max MustermannClicking the field swaps the display node via HTMX for an editor fragment.
The fragment contains:
Typing into the input filters the dataset locally in JavaScript.
Matching rules:
numbernameemployee when presentSelecting a result commits the structured fields, not the combined display string.
For GL accounts, selection writes:
:number:nameFor cost centers, selection writes:
:number:name:employee when present on the selected optionCancelling closes the editor and restores the display view without changing data.
No GL accounts available or No cost centers available.number, the UI renders both in source order. This is treated as a master-data quality problem, not a picker-level validation concern.<select> and <datalist>.Add coverage for:
numbernameemployee for cost centers