/** * UStVA period extraction: one period's account movements plus the EXACT * scenario Bemessungsgrundlagen (igE / §13b) taken from taxScenario-tagged * journal entries. The result feeds @fin.cx/tax `computeUstva()` directly — * movements as `IAccountMovementInput[]`, scenarioBases as * `IScenarioBaseInput`. * * Base extraction per tagged entry: sum of (debit - credit) over the lines * with the scenario's key (94/91, 19/18) where the entry has any, else over * the lines that sit neither on a policy VAT account nor on a personal * account (>= 10000) (a tax booked as stated, whose base has no key); never * a line against a policy VAT account (the key-less correction of a * deduction excluded in part or wholly, expense against input tax). For the recipe * shapes that is exactly the net expense line; Stornos flip sides and cancel. * A § 13b base goes into the field of its line's paragraph * (`reverseChargeParagraph`): Abs. 1 Kz 46, Abs. 2 Nr. 3 Kz 73, Abs. 2 Kz 84; * a line without one into Kz 46, as before the paragraph was recorded. Every * extracted base is cross-checked against the entry's own pair of input and * output VAT — disagreement lands in `warnings`. An entry without the tag * (a payment whose Skonto lowers a § 13b or intra-Community base) gives the * lines with the scenario's key: 19 Kz 89, 18 Kz 93, 94 and 91 by paragraph. * The query loads only those two kinds of entry: the tagged ones and those * with a line keyed 19, 18, 94 or 91. * * The policy's individual accounts (`individualAccounts`) come along, so * `computeUstva()` counts a movement on one where its UStVA mapping places it. */ import type * as plugins from './plugins.js'; import type { IAccountPolicy } from './core/index.js'; import type { TSKRType } from './skr.types.js'; export interface IUstvaMovement { accountNumber: string; /** debitCents - creditCents over the period */ signedCents: number; } export interface IUstvaScenarioBases { /** igE 19 % net bases (Kz 89) */ intraEuAcquisitionStandardCents: number; /** igE 7 % net bases (Kz 93) */ intraEuAcquisitionReducedCents: number; /** * § 13b Abs. 1 bases (Kz 46): the lines with `reverseChargeParagraph` * `abs_1`, and every § 13b base line without a paragraph, which an entry * posted before the paragraph was recorded, or one whose tax was booked as * stated (no key, so no paragraph), carries; reclassify those manually * where they fall under Abs. 2. */ reverseChargeServicesEuCents: number; /** § 13b Abs. 2 Nr. 3 bases, Umsätze under the GrEStG (Kz 73): the lines with `reverseChargeParagraph` `abs_2_nr_3` */ reverseChargeRealEstateCents: number; /** the other § 13b Abs. 2 bases, Nr. 1, 2, 4 to 12 (Kz 84): the lines with `reverseChargeParagraph` `abs_2` */ reverseChargeOtherCents: number; } export interface IUstvaPeriodData { movements: IUstvaMovement[]; scenarioBases: IUstvaScenarioBases; /** * the policy's individual accounts (`IAccountPolicy.individualAccounts`; the * books' declarations under `SkrApi`), empty where it has none: @fin.cx/tax * `computeUstva()` takes them as `individualAccounts` and counts a movement * on one where its UStVA mapping places it */ individualAccounts: plugins.chartdata.IIndividualAccountDeclaration[]; /** tagged igE/§13b entries examined */ taggedEntryCount: number; /** extraction anomalies — review before filing */ warnings: string[]; } export declare function getUstvaPeriodData(skrType: TSKRType, policy: IAccountPolicy, options: { dateFrom: Date; dateTo: Date; }): Promise;