UNPKG

@fin.cx/skr

Version:

SKR03 and SKR04 German accounting standards for double-entry bookkeeping

70 lines (69 loc) 2.13 kB
import type { TSKRType } from './skr.types.js'; import type { IInvoice, IInvoiceLine, IBookingRules, TTaxScenario, IVATCategory } from './skr.invoice.entity.js'; /** * Maps invoice data to SKR accounts * Handles both SKR03 and SKR04 account mappings */ export declare class SKRInvoiceMapper { private logger; private skrType; private readonly SKR03_ACCOUNTS; private readonly SKR04_ACCOUNTS; private readonly CATEGORY_MAPPINGS; constructor(skrType: TSKRType); /** * Get account mappings for current SKR type */ private getAccounts; /** * Map invoice to booking rules */ mapInvoiceToSKR(invoice: IInvoice, customMappings?: Partial<IBookingRules>): IBookingRules; /** * Map invoice line to SKR account */ mapInvoiceLineToAccount(line: IInvoiceLine, invoice: IInvoice, bookingRules: IBookingRules): string; /** * Map revenue account based on VAT rate and scenario */ private mapRevenueAccount; /** * Map expense account based on product category and vendor */ private mapExpenseAccount; /** * Detect product category from description */ private detectProductCategory; /** * Get VAT account for given VAT category and rate */ getVATAccount(vatCategory: IVATCategory, direction: 'input' | 'output', taxScenario: TTaxScenario): string; /** * Get control account for party */ getControlAccount(invoice: IInvoice, bookingRules: IBookingRules): string; /** * Check if account is a control account */ private isControlAccount; /** * Get skonto accounts */ getSkontoAccounts(invoice: IInvoice): { skontoAccount: string; vatCorrectionAccount: string; }; /** * Validate account number format */ validateAccountNumber(accountNumber: string): boolean; /** * Get account description */ getAccountDescription(accountNumber: string): string; /** * Calculate booking confidence score */ calculateConfidence(invoice: IInvoice, bookingRules: IBookingRules): number; }