UNPKG

@fin.cx/skr

Version:

SKR03 and SKR04 German accounting standards for double-entry bookkeeping

99 lines (98 loc) 2.39 kB
import type { IInvoice, TInvoiceFormat, TInvoiceDirection } from './skr.invoice.entity.js'; /** * Adapter for @fin.cx/einvoice library * Handles parsing, validation, and format conversion of e-invoices */ export declare class InvoiceAdapter { private logger; constructor(); private readonly MAX_XML_SIZE; private readonly MAX_PDF_SIZE; /** * Parse an invoice from file or buffer */ parseInvoice(file: Buffer | string, direction: TInvoiceDirection): Promise<IInvoice>; /** * Validate an invoice using multi-level validation */ private validateInvoice; /** * Map EN16931 Business Terms to internal invoice model */ private mapToInternalModel; /** * Map party information */ private mapParty; /** * Map bank account information */ private mapBankAccount; /** * Map invoice lines */ private mapInvoiceLines; /** * Map VAT category */ private mapVATCategory; /** * Get exemption reason for VAT category */ private getExemptionReason; /** * Map VAT breakdown */ private mapVATBreakdown; /** * Map allowances and charges */ private mapAllowancesCharges; /** * Map line-level allowances and charges */ private mapLineAllowancesCharges; /** * Map payment terms */ private mapPaymentTerms; /** * Parse skonto terms from payment terms text */ private parseSkontoTerms; /** * Map payment means */ private mapPaymentMeans; /** * Classify tax scenario based on invoice data */ private classifyTaxScenario; /** * Check if country is in EU */ private isEUCountry; /** * Map e-invoice format from library format */ private mapEInvoiceFormat; /** * Calculate content hash for the invoice */ private calculateContentHash; /** * Convert invoice to different format */ convertFormat(invoice: IInvoice, targetFormat: TInvoiceFormat): Promise<string>; /** * Generate invoice from internal data */ generateInvoice(invoiceData: Partial<IInvoice>, format: TInvoiceFormat): Promise<{ xml: string; pdf?: Buffer; }>; /** * Map internal invoice to EN16931 Business Terms */ private mapToBusinessTerms; }