Alby96andClaude Opus 5.5 ddd2273f7e feat: document engine with kinds, states, atomic numbering and fulfilment (#47)
One engine for sales, purchases and warehouse documents (ADR 0032). Each document
type now carries a kind that decides its family of tables, life cycle, effects,
accepted lines, the kinds it fulfils and its permissions, so company-defined types
work without code.

- Six families of header and line tables plus document_links; document_types gets
  document_kind (seeded types filled by the migration and the Italian template),
  document_numerators gets last_date.
- DocumentStateMachine with the order, invoice and simple life cycles and the
  actions each state admits; issued invoices are immutable and are cancelled with
  a reason only before the file reaches the exchange system.
- DocumentNumberingService numbers at confirmation inside the transaction under
  the numerator lock (advisory lock on PostgreSQL, write lock on SQLite): no
  duplicates, a rollback gives the number back, out-of-sequence dates refused on
  gap-free numerators, the new year's numerator created on first use, gap report.
- DocumentEngine, the generic DocumentService<THeader, TLine> and
  DocumentCopyService: save, confirm or issue, cancel, close, reopen, delete,
  duplicate and transform; links are recorded at confirmation and removed at
  cancellation, and FulfillmentCalculator recomputes quantities and states.
- Tests: rules in Core, concurrent numbering on SQLite and PostgreSQL (data tests,
  run on PostgreSQL 18 locally), order to delivery notes to deferred invoice on a
  real instance. Wiki (Vendite, Tabelle azienda), CHANGELOG, STATUS, DATA-MODEL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 15:30:24 +01:00

Khaemhat

Khaemhat

Gestionale ERP + CRM per piccole e medie imprese italiane, scritto da zero in C# 14 su .NET 10 con interfaccia Blazor Server, PostgreSQL (o SQLite per demo e test) e nessuna libreria esterna. Si installa solo con Docker: l'unico artefatto distribuito è l'immagine nel registro pacchetti di Gitea.

Stato: sviluppo avviato. M0 (struttura, immagine Docker, CI) consegna la versione 0.0.1 con una pagina "in costruzione"; le funzioni arrivano milestone dopo milestone. Vedi docs/STATUS.md e la Roadmap.

Il nome viene da Khaemhat (Mahu), scriba reale e sovrintendente al doppio granaio dell'Alto e del Basso Egitto sotto Amenhotep III: un contabile e un magazziniere dell'antichità. Vedi Origine del nome.

Cosa farà

  • Anagrafiche, articoli, listini, tabelle; vendite e acquisti con motore documenti unico; magazzino.
  • Contabilità generale, IVA, F24, LIPE, ritenute, bollo, cespiti, Intrastat, chiusura e bilancio CEE.
  • Scadenzario, incassi e pagamenti, RiBa/SDD/SEPA, riconciliazione bancaria, solleciti.
  • Fatturazione elettronica FatturaPA con canali SDI (PEC integrata, SdICoop, intermediari).
  • CRM (lead, pipeline, attività, campagne, ticket), automazioni, API REST e server MCP.
  • Più aziende sulla stessa istanza (un database di sistema + un database per azienda), moduli attivabili con licenza, temi chiaro/scuro, dashboard a widget.

Installazione

docker pull gitea.encke-hake.ts.net/balbosoft/khaemhat:<versione>

Sviluppo

Serve l'SDK .NET 10 (global.json); Docker solo per costruire e provare l'immagine.

scripts/build.sh          # allowlist dei pacchetti + build con warning come errori
scripts/test.sh           # tutti i test (PostgreSQL con KHAEMHAT_TEST_PG, Redis con KHAEMHAT_TEST_REDIS)
scripts/run-dev.sh        # avvio locale su http://localhost:5080 con SQLite in .data/dev
docker build -f docker/Dockerfile -t khaemhat:dev .

Processo, rami e Definition of Done in docs/DEVELOPMENT.md.

Documentazione

Cosa Dove
Wiki (guida utente e amministratore) https://gitea.encke-hake.ts.net/BalboSoft/Khaemhat/wiki (sorgente in docs/wiki/)
Specifica normativa docs/SPEC.md
Regole operative ed emendamenti CLAUDE.md
Processo di sviluppo docs/DEVELOPMENT.md
Architettura, dati, moduli, API, MCP docs/ARCHITECTURE.md, docs/DATA-MODEL.md, docs/MODULES.md, docs/API.md, docs/MCP.md
Installazione e sicurezza docs/DEPLOY.md, docs/SECURITY.md
Decisioni architetturali docs/adr/
Mockup docs/mockups/
Novità CHANGELOG.md

Pianificazione

Il lavoro è organizzato in issue raggruppate per milestone (M0-M14) e nei progetti Khaemhat 1.0 — Sviluppo e Khaemhat 1.1+ — Fase 2.

S
Description
Gestionale ERP e CRM
Readme
27 MiB
0 Stars 1 Watchers 0 Forks
2026-11-13 20:43:53 +01:00
Languages
C# 78.2%
HTML 19.3%
CSS 1.8%
Shell 0.3%
JavaScript 0.3%