M6 · Acquisti e Magazzino (v0.6.0) #125

Merged
Alby96 merged 9 commits from feat/55-acquisti-magazzino into main 2026-11-12 22:38:11 +01:00
Owner

Ciclo passivo completo e magazzino che si aggiorna da solo con i documenti.

Cosa c'è

  • Movimenti di magazzino dai documenti confermati, nella stessa transazione; costo medio ponderato ricalcolato dalla storia degli articoli (anche per documenti con data passata); impegnato e ordinato dai residui degli ordini; il prezzo della fattura fornitore corregge il costo del carico (#59, ADR 0035).
  • Ordini fornitori, ricevimenti, fatture e note di credito fornitore nelle maschere dei documenti, con protocollo IVA alla conferma, rifiuto del doppio numero del fornitore e avviso sulle differenze di prezzo rispetto a ordine e ricevimento (#55, #56, #58).
  • Autofatture e integrazioni TD16-TD29: il pacchetto italiano indica quale serve e la scadenza, Crea autofattura prepara la bozza, Acquisti → Autofatture elenca quelle da emettere.
  • Fatture elettroniche ricevute (#57): lettore FatturaPA e .p7m (CMS scritto in casa); import di XML/P7M/ZIP in bozza, con fornitore trovato o creato, articoli e codici IVA abbinati, doppioni rifiutati, file allegato.
  • Magazzino (#60): giacenze per deposito con stati e indicatori, movimenti di un articolo, inventario fisico con import dei conteggi e rettifiche INVP/INVN, proposta di riordino con ordini in bozza per fornitore, valorizzazione a data con classi ABC, ricostruzione manuale e settimanale, widget Sottoscorta.
  • Import Giacenze iniziali che scrive il movimento APE; dati di esempio di acquisti e magazzino.
  • Documentazione (#61): wiki Acquisti e Magazzino complete con schermate reali, Guida all'uso aggiornata, ADR 0035, CHANGELOG.md 0.6.0, docs/STATUS.md.

Verifica

  • dotnet build -c Release -warnaserror: pulita.
  • Test: 709 verdi in locale, 23 di PostgreSQL saltati (girano in CI).
  • Controllo nel browser sull'azienda demo (giacenze, movimenti, valorizzazione, inventario, riordino, ricevimenti, fatture con differenze e autofattura, import), con correzioni di layout emerse dal controllo.

Dopo il merge

Tag v0.6.0, immagine e release: da fare dopo il via del titolare.

Closes #55
Closes #56
Closes #57
Closes #58
Closes #59
Closes #60
Closes #61

🤖 Generated with Claude Code

Ciclo passivo completo e magazzino che si aggiorna da solo con i documenti. ## Cosa c'è - **Movimenti di magazzino** dai documenti confermati, nella stessa transazione; costo medio ponderato ricalcolato dalla storia degli articoli (anche per documenti con data passata); impegnato e ordinato dai residui degli ordini; il prezzo della fattura fornitore corregge il costo del carico (#59, ADR 0035). - **Ordini fornitori, ricevimenti, fatture e note di credito fornitore** nelle maschere dei documenti, con protocollo IVA alla conferma, rifiuto del doppio numero del fornitore e avviso sulle differenze di prezzo rispetto a ordine e ricevimento (#55, #56, #58). - **Autofatture e integrazioni** TD16-TD29: il pacchetto italiano indica quale serve e la scadenza, *Crea autofattura* prepara la bozza, *Acquisti → Autofatture* elenca quelle da emettere. - **Fatture elettroniche ricevute** (#57): lettore FatturaPA e `.p7m` (CMS scritto in casa); import di XML/P7M/ZIP in bozza, con fornitore trovato o creato, articoli e codici IVA abbinati, doppioni rifiutati, file allegato. - **Magazzino** (#60): giacenze per deposito con stati e indicatori, movimenti di un articolo, inventario fisico con import dei conteggi e rettifiche INVP/INVN, proposta di riordino con ordini in bozza per fornitore, valorizzazione a data con classi ABC, ricostruzione manuale e settimanale, widget *Sottoscorta*. - Import *Giacenze iniziali* che scrive il movimento `APE`; dati di esempio di acquisti e magazzino. - **Documentazione** (#61): wiki *Acquisti* e *Magazzino* complete con schermate reali, *Guida all'uso* aggiornata, ADR 0035, `CHANGELOG.md` 0.6.0, `docs/STATUS.md`. ## Verifica - `dotnet build -c Release -warnaserror`: pulita. - Test: 709 verdi in locale, 23 di PostgreSQL saltati (girano in CI). - Controllo nel browser sull'azienda demo (giacenze, movimenti, valorizzazione, inventario, riordino, ricevimenti, fatture con differenze e autofattura, import), con correzioni di layout emerse dal controllo. ## Dopo il merge Tag `v0.6.0`, immagine e release: da fare dopo il via del titolare. Closes #55 Closes #56 Closes #57 Closes #58 Closes #59 Closes #60 Closes #61 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Alby96 added this to the M6 — Acquisti e Magazzino · v0.6.0 milestone 2026-11-12 22:29:00 +01:00
Alby96 added 8 commits 2026-11-12 22:29:00 +01:00
The import of supplier e-invoices needs a reading layer that turns a
received file into plain records, whatever form the file arrives in.

- Fiscal.Abstractions: IIncomingInvoiceReader, an optional pack feature,
  with the IncomingInvoiceFile records and the incoming.* error codes the
  import service and screens build on.
- Infrastructure: CmsSignedData, a minimal CMS SignedData (CAdES .p7m)
  reader on System.Formats.Asn1, since System.Security.Cryptography.Pkcs
  is a separate package. It accepts DER, BER with indefinite lengths and
  chunked content, base64 text and nested envelopes; it checks the
  message digest and the RSA (PKCS#1, PSS) or ECDSA signature with the
  embedded certificate and reports signer, tax code, validity and signing
  time. No trust chain or revocation check: no trusted list offline.
- Fiscal.Italy: FatturaPaReader for FPR12/FPA12 v1.2.x and FSM10, matched
  by local name, DTD prohibited and no resolver, BOM/windows-1252/missing
  declaration tolerated, batches as one invoice per body, attachments
  decoded; registered in ItalyFiscalPack.
- Tests build every sample and signed envelope in code (AsnWriter and
  self-signed certificates), nothing downloaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Confirmed delivery notes, invoices that move goods, supplier receipts and
warehouse movements now write stock movements in the same transaction;
cancelling removes them. Each change re-runs the history of the items
touched, so balances per warehouse, committed and ordered quantities and
the average and last cost stay consistent even when an old document is
cancelled. Supplier invoices give their cost to the receipts they invoice.
Immediate invoices, supplier invoices and credit notes get their warehouse
reasons; the self-invoice types TD20-TD29 join the base tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The document radars and records now serve /acquisti and /magazzino too:
supplier orders, receipts, supplier invoices and credit notes, self-invoices
and warehouse movements, with the supplier in place of the customer, the
supplier's number and date, the protocol and VAT date of registered invoices,
and reason and warehouses of a movement. Supplier invoices take their
protocol from the purchase numbering, refuse a second document with the same
supplier number in the same year and show price differences against their
order or receipt. The Italian pack advises the self-invoice a received
invoice needs (TD16-TD19, TD28) with its deadline, and the purchase service
drafts it with the ordinary rate. A credit note of an invoice now moves its
goods back instead of being skipped as already moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A physical stock take freezes the book quantity and cost of a warehouse at a
date, takes counts typed or read from a scanner file, and posts the gains and
losses as INVP/INVN movements at that date. The reorder proposal lists the
items whose available and ordered quantity no longer covers the reorder point
and turns the accepted lines into draft supplier orders, one per supplier.
The warehouse can be rebuilt from its documents on demand and every Sunday
night, as a safety net after imports or corrections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stock, stock take and reorder screens under /magazzino, with valuation, rebuild and the
movements of an item; the understock dashboard widget. Supplier e-invoices (XML, p7m, ZIP)
become draft purchase invoices with supplier, items and tax codes matched, the file attached
and duplicates refused; the TD code mapping stays in the Italian fiscal pack. Purchase
invoices show price differences against the order and the self-invoice still to issue,
with a pending list on the self-invoice screen. The opening stock import now writes an
opening movement. The demo company gets purchases, an opening stock, a pending
self-invoice and a stock take being counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seen while checking M6 in the browser: the stock take toolbar crowded the panel title,
the reorder and stock take tables ran past their panel, and the movements dialog cut
the balance column. Confirmed supplier receipts have no number of their own and showed
"Bozza"; they now read "Senza numero". The self-invoice advice no longer doubles the
full stop, and a single price difference reads in the singular.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs: purchases and warehouse guide with screenshots, ADR 0035 and the 0.6.0 changelog (#61)
CI / Build and test (SQLite) (pull_request) Canceled after 0s
CI / PostgreSQL 16 integration (pull_request) Canceled after 0s
CI / PostgreSQL 17 integration (pull_request) Canceled after 0s
CI / Docker image (pull_request) Canceled after 0s
CI / YAML check (pull_request) Canceled after 0s
4b759ee96e
The Acquisti and Magazzino wiki pages now describe what M6 delivers, with real
screenshots of the demo company: stock, item movements, valuation, stock take, reorder
proposal, receipts, price differences, e-invoice import and pending self-invoices. The
user guide gains the buying and warehouse steps; the pages that said "arriva con M6"
(sales, items, dashboard, import, scheduled jobs, demo data) are brought up to date.
ADR 0035 records how documents post to the warehouse, the recomputed weighted average,
the invoice cost correction, the rebuild, the stock take, the base tables of existing
companies and where the Italian self-invoice and import rules live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alby96 added 1 commit 2026-11-12 22:36:47 +01:00
docs: record M6 as closed (v0.6.0) and M7 as the current milestone (#61)
CI / Build and test (SQLite) (pull_request) Failing after 45s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / Docker image (pull_request) Skipped
CI / YAML check (pull_request) Successful in 1m1s
7f8cb57a08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alby96 merged commit 838362bfe1 into main 2026-11-12 22:38:11 +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#125