Adds the company tables of the electronic invoice and the services that drive them: the builder turns an issued document into the FatturaPA model, the service generates, checks and sends the file through the channel chosen by the routing rules (with a fallback) and applies the SDI notifications to the e-invoice and its document. The channel settings keep their secrets protected and out of the audit trail; a job reads the PEC mailbox and the intermediaries every 15 minutes, storing supplier invoices in the inbox and acknowledging a message only once all its files are kept. The inbox registers received invoices through the purchase import, and the conservation export packs a period with a SHA-256 index. A rejected invoice can now be corrected and generated again; the courtesy PDF embeds the XML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
709bb13532
commit
fb12411404
24 files changed
+4016
-10
No files matched your search
@@ -64,7 +64,7 @@ public sealed class DocumentRulesTests
|
||||
|
||||
Assert.AreEqual(DocumentStatus.SdiDelivered, status);
|
||||
CollectionAssert.AreEqual(new[] { DocumentAction.Copy }, DocumentStateMachine.Actions(Invoice, DocumentStatus.SdiDelivered).ToArray());
|
||||
foreach (var issued in DocumentStateMachine.States(Invoice).Where(s => s != DocumentStatus.Draft))
|
||||
foreach (var issued in DocumentStateMachine.States(Invoice).Where(s => s is not (DocumentStatus.Draft or DocumentStatus.SdiRejected)))
|
||||
{
|
||||
Assert.IsFalse(DocumentStateMachine.IsEditable(Invoice, issued), issued.ToString());
|
||||
Assert.IsFalse(DocumentStateMachine.Allows(Invoice, issued, DocumentAction.Delete), issued.ToString());
|
||||
@@ -72,6 +72,8 @@ public sealed class DocumentRulesTests
|
||||
|
||||
Assert.IsTrue(DocumentStateMachine.Allows(Invoice, DocumentStatus.SdiGenerated, DocumentAction.Cancel));
|
||||
Assert.IsTrue(DocumentStateMachine.Allows(Invoice, DocumentStatus.SdiRejected, DocumentAction.Cancel));
|
||||
Assert.IsTrue(DocumentStateMachine.IsEditable(Invoice, DocumentStatus.SdiRejected), "A rejected invoice is corrected and sent again.");
|
||||
Assert.IsFalse(DocumentStateMachine.Allows(Invoice, DocumentStatus.SdiRejected, DocumentAction.Delete));
|
||||
Assert.IsFalse(DocumentStateMachine.Allows(Invoice, DocumentStatus.SdiSent, DocumentAction.Cancel));
|
||||
Assert.IsFalse(DocumentStateMachine.Allows(Invoice, DocumentStatus.Draft, DocumentAction.Confirm), "Invoices are issued, not confirmed.");
|
||||
Assert.AreEqual(DocumentStatus.SdiGenerated, DocumentStateMachine.Apply(Invoice, DocumentStatus.SdiRejected, DocumentAction.GenerateXml));
|
||||
|
||||
@@ -86,6 +86,7 @@ public sealed class MappingTests
|
||||
"gl_open_items", "gl_recurring_entries", "vat_settlements", "vat_settlement_lines", "tax_payments", "withholdings", "vat_register_prints",
|
||||
"payments", "payment_lines", "remittances", "remittance_lines", "sdd_mandates", "bank_statements", "bank_statement_lines",
|
||||
"bank_match_rules", "dunning_levels", "dunning_letters",
|
||||
"e_invoices", "e_invoice_notifications", "e_invoice_inbox", "e_invoice_channels", "e_invoice_routing", "e_invoice_conservation",
|
||||
];
|
||||
CollectionAssert.AreEquivalent(expected, registry.Maps.Select(m => m.Table).ToArray());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user