import * as plugins from './plugins.js'; import type { TAccountType, TSKRType, IAccountData } from './skr.types.js'; export declare class Account extends plugins.nosqldb.SmartDataDbDoc { id: string; accountNumber: string; accountName: string; accountClass: number; accountGroup: number; accountSubgroup: number; accountType: TAccountType; skrType: TSKRType; description: string; vatRate: number; balance: number; debitTotal: number; creditTotal: number; isActive: boolean; isSystemAccount: boolean; isAutomaticAccount: boolean; /** * An individual account of the books (Individualkonto, * `Account.declareIndividualAccount`): the DATEV account it belongs to and * takes its type from; unset = an account of the chart or a custom account. */ parentAccountNumber?: string; /** the securities role an individual account's declaration names; unset = none */ securitiesRole?: plugins.chartdata.TSecuritiesRole; /** what an individual account's declaration changes of what it takes from its parent; unset = nothing */ overrides?: plugins.chartdata.IIndividualAccountOverrides; createdAt: Date; updatedAt: Date; constructor(data?: Partial); static createAccount(data: IAccountData): Promise; static getAccountByNumber(accountNumber: string, skrType: TSKRType): Promise; /** * Declare an individual account of the books (Individualkonto) on a number * DATEV leaves free after the account it belongs to. @fin.cx/chartdata * checks the declaration together with the individual accounts already * declared for the chart (`booksChartOf`) and refuses it with its * `IndividualAccountsError` (`problems`: a number DATEV assigns, one that * does not follow its parent, one declared already, …); a number another * account of the chart's books holds is refused too. Nothing is stored for * a refused declaration. The account takes its parent's type and is no * system account; the declaration is stored on it * (`getIndividualAccountDeclarations`). */ static declareIndividualAccount(skrType: TSKRType, declaration: plugins.chartdata.IIndividualAccountDeclaration): Promise; /** * The declarations of the individual accounts stored for a chart, by * account number: what `IAccountPolicy.individualAccounts` takes. Inactive * individual accounts are declarations too — their numbers stay taken. */ static getIndividualAccountDeclarations(skrType: TSKRType): Promise; static getAccountsByClass(accountClass: number, skrType: TSKRType): Promise; static getAccountsByType(accountType: TAccountType, skrType: TSKRType): Promise; static searchAccounts(searchTerm: string, skrType?: TSKRType): Promise; /** * Check if account number is in debtor range (10000-69999) * Debtor accounts (Debitorenkonten) are individual customer accounts */ static isInDebtorRange(accountNumber: string): boolean; /** * Check if account number is in creditor range (70000-99999) * Creditor accounts (Kreditorenkonten) are individual vendor accounts */ static isInCreditorRange(accountNumber: string): boolean; /** * Check if account is an automatic account (Automatikkonto) * Automatic accounts like 1400/1600 cannot be posted to directly */ static isAutomaticAccount(accountNumber: string, skrType: TSKRType): boolean; /** * Validate account for posting - throws error if account cannot be posted to */ static validateAccountForPosting(accountNumber: string, skrType: TSKRType): Promise; /** * Check if this account instance is a debtor account */ isDebtorAccount(): boolean; /** * Check if this account instance is a creditor account */ isCreditorAccount(): boolean; updateBalance(debitAmount?: number, creditAmount?: number): Promise; deactivate(): Promise; activate(): Promise; getNormalBalance(): 'debit' | 'credit'; beforeSave(): Promise; }