using Khaemhat.Fiscal.Abstractions; namespace Khaemhat.Fiscal.Italy; /// /// 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. /// public sealed class IncomingInvoiceRulesIt : IIncomingInvoiceRules { private static readonly HashSet Invoices = new(StringComparer.Ordinal) { "TD01", "TD02", "TD03", "TD05", "TD06", "TD24", "TD25", "TD26", "TD27" }; private static readonly HashSet CreditNotes = new(StringComparer.Ordinal) { "TD04", "TD08" }; /// public string? DocumentTypeCode(string formatType) { var type = formatType?.Trim().ToUpperInvariant() ?? string.Empty; return Invoices.Contains(type) ? "FF" : CreditNotes.Contains(type) ? "NCF" : null; } }