M4 · Tabelle, anagrafiche, articoli (v0.4.0) #121

Merged
Alby96 merged 12 commits from feat/37-tabelle-anagrafiche into main 2026-11-12 13:03:38 +01:00
Owner

Chiusura della milestone M4 — Tabelle, anagrafiche, articoli (v0.4.0).

Contenuto

  • Pacchetto fiscale IT 2026.2/2026.3 (ADR 0025): codici IVA, nature N1-N7, code list FatturaPA 1.9.1, castelletto IVA, bollo, calendario delle scadenze, ritenute, codici tributo F24.
  • Validatori e VIES (#40): partita IVA, codice fiscale con omocodia, IBAN, EAN, e-mail, codice destinatario; ViesClient.
  • Tabelle azienda (ADR 0026, #38, #39): 26 tabelle con un'unica maschera, profilo azienda a schede, esercizi e mesi, cambi BCE.
  • Dati di base (#45, ADR 0028): province e comuni ISTAT con i CAP GeoNames; scripts/seed.sh --base|--demo.
  • Codici automatici e compilazione automatica (#43, ADR 0027).
  • Anagrafiche (#41, ADR 0029): clienti, fornitori e contatti con radar, scheda, controlli, VIES; 21 anagrafiche di esempio.
  • Articoli e listini (#42, ADR 0030): prezzi a validità, listini derivati, aggiornamento massivo, 120 articoli di esempio.
  • Import/export guidato (#44, ADR 0031): CSV/XLSX/JSON con mappatura, validazione riga per riga, report errori, export e modelli; tracciato del piano dei conti (solo verifica fino a M7).
  • Chiusura (#46): 10 screenshot reali nella wiki, pagine M4 complete, CHANGELOG.md 0.4.0, STATUS, Roadmap.

Definition of Done

  • Build senza warning, check-packages.sh OK.
  • Test: 631 verdi in locale, 21 di PostgreSQL saltati (girano in CI).
  • docs/DATA-MODEL.md aggiornato (generatore senza differenze).
  • Immagine costruita in locale (VERSION=0.4.0) e avviata da zero con SQLite: /health ready, 543 righe di dati di esempio, nessun avviso.

Restano aperte

  • #45 solo per le banche ABI/CAB (manca una fonte con licenza compatibile).
  • #35 (PNG dei mockup ad alta risoluzione), non bloccante.
  • Profilo dell'azienda demo vuoto: da completare prima dei documenti di M5 (annotato in CHANGELOG e STATUS).

Closes #37, closes #38, closes #39, closes #40, closes #41, closes #42, closes #43, closes #44, closes #46. Refs #45.

Dopo il merge: tag v0.4.0 su main, immagine dal workflow di rilascio e release con le note del CHANGELOG.

🤖 Generated with Claude Code

Chiusura della milestone **M4 — Tabelle, anagrafiche, articoli** (`v0.4.0`). ## Contenuto - **Pacchetto fiscale** `IT 2026.2/2026.3` (ADR 0025): codici IVA, nature N1-N7, code list FatturaPA 1.9.1, castelletto IVA, bollo, calendario delle scadenze, ritenute, codici tributo F24. - **Validatori e VIES** (#40): partita IVA, codice fiscale con omocodia, IBAN, EAN, e-mail, codice destinatario; `ViesClient`. - **Tabelle azienda** (ADR 0026, #38, #39): 26 tabelle con un'unica maschera, profilo azienda a schede, esercizi e mesi, cambi BCE. - **Dati di base** (#45, ADR 0028): province e comuni ISTAT con i CAP GeoNames; `scripts/seed.sh --base|--demo`. - **Codici automatici e compilazione automatica** (#43, ADR 0027). - **Anagrafiche** (#41, ADR 0029): clienti, fornitori e contatti con radar, scheda, controlli, VIES; 21 anagrafiche di esempio. - **Articoli e listini** (#42, ADR 0030): prezzi a validità, listini derivati, aggiornamento massivo, 120 articoli di esempio. - **Import/export guidato** (#44, ADR 0031): CSV/XLSX/JSON con mappatura, validazione riga per riga, report errori, export e modelli; tracciato del piano dei conti (solo verifica fino a M7). - **Chiusura** (#46): 10 screenshot reali nella wiki, pagine M4 *complete*, `CHANGELOG.md` 0.4.0, STATUS, Roadmap. ## Definition of Done - Build senza warning, `check-packages.sh` OK. - Test: 631 verdi in locale, 21 di PostgreSQL saltati (girano in CI). - `docs/DATA-MODEL.md` aggiornato (generatore senza differenze). - Immagine costruita in locale (`VERSION=0.4.0`) e avviata da zero con SQLite: `/health` ready, 543 righe di dati di esempio, nessun avviso. ## Restano aperte - #45 solo per le banche ABI/CAB (manca una fonte con licenza compatibile). - #35 (PNG dei mockup ad alta risoluzione), non bloccante. - Profilo dell'azienda demo vuoto: da completare prima dei documenti di M5 (annotato in CHANGELOG e STATUS). Closes #37, closes #38, closes #39, closes #40, closes #41, closes #42, closes #43, closes #44, closes #46. Refs #45. Dopo il merge: tag `v0.4.0` su `main`, immagine dal workflow di rilascio e release con le note del CHANGELOG. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Alby96 added this to the M4 — Tabelle, anagrafiche, articoli · v0.4.0 milestone 2026-11-12 12:26:28 +01:00
Alby96 added 12 commits 2026-11-12 12:26:28 +01:00
The rest of the product needs tax codes, natures, code lists and VAT rules
without knowing the country. IFiscalPack exposes the parts every country has
(tax code catalog, tax engine, calendar) and optional features by type, so a
module can tell a missing feature from a broken one. FiscalPackCatalog finds
the pack by country; only the composition root names the Italian pack, as an
architecture test now checks.

The Italian pack carries the FatturaPA 1.9.1 code lists, VAT natures and base
tax codes with their rules, summary rounding on the total per rate, the stamp
duty rule, VAT deadlines with the August and holiday shifts, withholding kinds,
basic depreciation rules and F24 codes. ADR 0025 records the design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parties need their identifiers checked before they reach documents. IBAN, EAN
and e-mail checks are international and live in Core. The Italian VAT number,
fiscal code (with calculator, decoder and omocodia) and SDI recipient code are
Italian, so they sit in the Italian pack behind ITaxIdentifierRules, as the
non-negotiable rule of SPEC 1.10 wins over the class list of SPEC 21 (ADR 0025).
IBankDirectory reads ABI and CAB from an Italian IBAN; its bank list arrives
with the base data.

ViesClient calls the VIES REST service and never reports a number as invalid
when the service could not answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the company tables of SPEC 11.1 behind one generic service so that every
table gets the same rules, history, cache and CSV import/export, plus the
company profile, fiscal years with monthly lock and the base-data seeder.

- 26 coded tables, exchange rates, company profile, fiscal years and periods:
  entities, maps and migrations 010-014
- TableService + TableCatalog: unique codes, per-table rules (VAT codes are
  checked by the fiscal pack), delete or disable when in use, single default,
  CSV export/import all-or-nothing, cache with cross-instance invalidation
- CompanyProfileService (Italian identifiers through the pack),
  FiscalYearService with the date check used by every dated record
- EcbRatesClient and the ECB rates system task; CsvReader
- ISeeder/SeedRunner with the data version in company settings; base tables
  from the pack (IBaseTablesTemplate) and an embedded ISO country list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gives the company tables of the previous commit their screens, so a company
can be configured from the browser, and makes the base data runnable outside
the web server.

- one generic editor for the 26 coded tables (/tabelle/<slug>), described in
  TableScreens: grid with active/disabled filter, detail with errors and
  warnings, disable instead of delete, CSV export and all-or-nothing import,
  "update from base tables"; index page and menu entries
- company profile in tabs with the fiscal pack checks, fiscal years with
  month lock/unlock, exchange rates with manual rates
- PaymentTermService: installments saved together, percentages must sum to 100
- a new profile proposes the registered company name instead of its code
- seed verb in Khaemhat.Web and scripts/seed.sh --base [--company CODE],
  shipped in the image under /app/scripts
- ADR 0026 (base data only adds missing codes; ISTAT and ABI/CAB lists come
  as separate datasets), wiki, CHANGELOG, STATUS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parties, items and the CRM archives need codes given by the system without
duplicates, and the address and bank fields should fill themselves; this adds
both before the party and item screens that use them.

- CodeMask ({seq:0000}, {anno}, {categoria}) and code_sequences (migration
  015): one sequence per rule, year and category, taken under a lock in the
  transaction that saves the record, skipping codes written by hand
- CodeRuleService: rules in company settings with the masks of SPEC 11.12,
  validation, preview of the next code, manual code allowed or not
- AutoFillService: municipality from postal code and back, personal tax code,
  VIES, bank and BIC from the IBAN, delivery date on working days, options
  that can be switched off (the ECB job honours its option)
- IBankDirectory.ReadIban gives ABI and CAB even without the ABI list; the
  Italian pack now registers the directory
- Company preferences page (mockup 074) at /tabelle/preferenze, in the menu
- aria-checked now renders true/false on switch rows and profile radios
- ADR 0027, wiki, CHANGELOG, STATUS, DATA-MODEL

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New companies now get the 110 provinces and 7,894 municipalities in force
(ISTAT list of 26/02/2026, CC BY 4.0), so the tax code calculation and the
municipality lookups work without loading anything. The list lives in the
Italian pack behind a new IPlaceDirectory feature and is added by the base
seeder like the rest of the base data: missing codes only, never touching
existing rows. The pack data version moves to IT 2026.3 so existing
companies receive the lists at the next start.

Postal codes are left out: the only candidate source (comuni-json) has no
licence for them and stops at 2020 (ADR 0028).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The municipalities now come with their postal codes, so the lookup from
postal code works on a new company without loading anything. GeoNames
(CC BY 4.0) lists places rather than municipalities: a postal code goes
to a municipality only when the name and the province abbreviation match
exactly one of them (the name alone within Sardinia, whose abbreviations
changed), which covers 7,750 of 7,894 municipalities; the rest are mostly
renamed or merged ones that users complete by hand.

tools/Khaemhat.PlacesTool rebuilds both lists from the ISTAT sheet and
the GeoNames file, framework only, so the yearly update is repeatable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Customers, suppliers, prospects and leads live in one parties archive
with a kind and a subject type (ADR 0029). A customer that also supplies
carries is_also_supplier, so it shows in both radars with one code.

- Three radars (/anagrafiche/clienti, /fornitori, /contatti) with search,
  quick filters and bulk disable/enable; the record has eight tabs
  (main data, addresses, contacts, terms, fiscal and SDI, banks, notes and
  attachments, history) on the MasterDataPage base.
- PartyService saves the whole record in one transaction, checks it with
  the fiscal pack (VAT number, tax code, recipient code, country), treats
  a duplicate VAT number or a consumer without tax code as warnings, fills
  the default recipient code, runs VIES after commit for EU companies, and
  converts prospects/leads (new customer code, old one kept as
  previous_code) and suppliers (become customers that also supply).
- Delete falls back to disable when the party is referenced.
- DemoPartiesSeeder adds 3 salespeople and 21 parties with fictitious but
  formally valid identifiers; SeedAsync now runs demo seeders when asked.
- Test host accepts service overrides so VIES can be stubbed.

Docs: ADR 0029, wiki Anagrafiche and demo data pages, regenerated data
model, CHANGELOG and STATUS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user wants the leading zero to keep signalling that Khaemhat is in
development, so M13 closes as v0.13.0 and M14 as v0.14.0+ instead of
v1.0.0 and v1.1.0+ from SPEC §20. The Gitea milestones were renamed to
match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Items get their own archive and record (mockup 017): codes from the
per-category mask, EAN and NC8 checks, alternative units and bar codes,
suppliers with the usual one, substitutes, notes and history. Only goods
can be stocked; stock itself comes with the warehouse in M6. Costs are
hidden from users without items.cost.read and kept as they were when
those users save. A used item is disabled instead of deleted.

Prices live in one item_prices table, either for a price list or as a
customer's net price, each valid from a date, so documents keep the price
of their day. Derived lists compute a price from their base list with
markup and rounding when they have none of their own. The price grid
(mockup 018) edits every list at one validity date, keeps changes pending
and highlighted until saved, and computes mass updates as a preview.
PriceListService.QuoteAsync gives documents (M5) the price search order
net, list, base, item price with its source.

Parties get the "Articoli e codici" tab: the codes a customer or supplier
uses for our items, found by the item search in that party's documents.

Demo data adds 120 items of a plumbing wholesaler, the PUBB and RIV lists,
last year's prices, suppliers, units, codes and a customer's net prices;
seed --demo [--scale N] loads them from the command line and repeats the
catalogue for performance tests.

ADR 0030 records the decisions; wiki, data model, CHANGELOG and STATUS
are updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Companies starting on Khaemhat need to bring their master data from another
system or a spreadsheet, and the chart of accounts has no Italian exchange
standard, so SPEC 12.12 asks for a guided wizard and an own layout.

- Administration > Import / export: CSV (separator and encoding guessed),
  XLSX (in-house reader, first sheet) and JSON, automatic column mapping with
  aliases, row-by-row check, error report, import confirmation and log entry.
- Rows go through PartyService, ItemService and PriceListService, so the
  import has exactly the rules, error codes and history of the forms; options
  cover existing and missing codes, VIES and city from postal code.
- Export writes the same columns as the import, plus empty templates.
- Opening stock and the chart of accounts (khaemhat-coa layout, natura, tipo,
  flag) are check-only until M6 and M7 add the ledgers to write into.
- PartyService.SaveAsync takes an explicit VIES switch for the import.
- ADR 0031, wiki Import-Export, CHANGELOG and STATUS updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs: close M4 with real screenshots, complete wiki pages and the 0.4.0 changelog (#46)
CI / Build and test (SQLite) (pull_request) Successful in 3m11s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / YAML check (pull_request) Successful in 23s
CI / Docker image (pull_request) Successful in 1m53s
b323d70f83
The milestone's Definition of Done asks for complete wiki pages with real
screenshots, a changelog for everything delivered, an image that builds
locally and a SQLite demo that starts from zero. Ten screenshots taken on a
fresh demo instance now sit next to the mockups; Anagrafiche, Articoli e
listini and Tabelle azienda are complete, Import-Export and Dati di base are
complete for M4, and the preference tabs still to come say which milestone
brings them. The changelog gains its 0.4.0 section, and STATUS, Roadmap,
Changelog and Home point at 0.4.0 and M5.

The screenshots showed that the import preview pushed the outcome column off
the right edge, so its reasons could not be read: the outcome now follows
the line number and the table scrolls sideways. The warnings for values
filled from the postal code no longer repeat the column name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alby96 merged commit e53b14a3c5 into main 2026-11-12 13:03:38 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: BalboSoft/Khaemhat#121