Files
Khaemhat/src/Khaemhat.Fiscal.Italy/IncomingInvoiceRulesIt.cs
T
Alby96andClaude Opus 5.5 ced689b297 feat: warehouse and purchase screens, e-invoice import, demo purchases (#55 #56 #57 #58 #60)
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>
2026-11-12 22:01:32 +01:00

23 lines
1.1 KiB
C#

using Khaemhat.Fiscal.Abstractions;
namespace Khaemhat.Fiscal.Italy;
/// <summary>
/// The types of a received FatturaPA and the purchase document that registers them: invoices, deposits, fee notes,
/// debit notes and deferred invoices (TD01, TD02, TD03, TD05, TD06, TD24, TD25, TD26, TD27) as supplier invoice FF,
/// credit notes (TD04, TD08) as supplier credit note NCF. The self-invoice types TD16-TD23, TD28 and TD29 are issued by
/// the company itself and are not purchases.
/// </summary>
public sealed class IncomingInvoiceRulesIt : IIncomingInvoiceRules
{
private static readonly HashSet<string> Invoices = new(StringComparer.Ordinal) { "TD01", "TD02", "TD03", "TD05", "TD06", "TD24", "TD25", "TD26", "TD27" };
private static readonly HashSet<string> CreditNotes = new(StringComparer.Ordinal) { "TD04", "TD08" };
/// <inheritdoc />
public string? DocumentTypeCode(string formatType)
{
var type = formatType?.Trim().ToUpperInvariant() ?? string.Empty;
return Invoices.Contains(type) ? "FF" : CreditNotes.Contains(type) ? "NCF" : null;
}
}