import { type ILedgerEntryInput, type ITrialBalance } from './core.ledger.js'; import { type IReportOptions } from './core.reports.types.js'; export interface IMonthlyTrialBalance { month: string; balance: ITrialBalance; } export interface IUstVerprobungReturn { month: string; kennzahlen: Array<{ kennzahl: number; kind: 'baseEur' | 'taxCents'; value: number; }>; } export interface IUstVerprobungOptions extends IReportOptions { returns?: readonly IUstVerprobungReturn[]; taxationMethod?: 'soll' | 'ist'; } export interface IUstVerprobungRate { month: string; ratePercent: number; revenueCents: number; expectedVatCents: number; bookedVatCents: number; bookedDifferenceCents: number; mappedBaseCents: number; mappedVatCents: number; mappedDifferenceCents: number; filedBaseCents: number | null; filedVatCents: number | null; filedDifferenceCents: number | null; filedBaseDifferenceCents: number | null; revenueAccounts: Array<{ accountNumber: string; cents: number; }>; vatAccounts: Array<{ accountNumber: string; cents: number; }>; } /** Why an amount of revenue or output VAT takes no rate; stable, for callers to branch on. */ export type TUstVerprobungUnresolvedCode = /** revenue without a rate in the chart, a BU key or the journal's VAT metadata */ 'revenue_rate_unknown' /** output VAT on an account the policy assigns no domestic sales rate */ | 'output_vat_unassigned'; export interface IUstVerprobungUnresolved { month: string; accountNumber: string; cents: number; code: TUstVerprobungUnresolvedCode; /** the code in words, for a reader; branch on `code` */ reason: string; } export interface IUstVerprobung { taxationMethod: 'soll' | 'ist'; rates: IUstVerprobungRate[]; differences: IUstVerprobungRate[]; unresolved: IUstVerprobungUnresolved[]; isComplete: boolean; } /** * The USt-Verprobung: per month and rate, the revenue against the output VAT * booked for the rate, against the base of the rate's Kennzahl as the chart * maps the accounts, and against an advance return handed in. Entries count * each line as the account it declares as in the VAT return * (`IJournalLineDraft.declaresAs`), in the VAT month the entry is declared in * (`ILedgerEntryInput.vatPeriod`, else the month of its date): its revenue, * its VAT and the period's bounds alike. Monthly trial balances, which have * no lines, count by their accounts in their month. */ export declare function computeUstVerprobung(input: readonly ILedgerEntryInput[] | readonly IMonthlyTrialBalance[], options: IUstVerprobungOptions): IUstVerprobung;