2022-04-21 13:08:36 +00:00
|
|
|
import { AccountRootType } from 'models/baseModels/Account/types';
|
2022-05-14 08:46:05 +00:00
|
|
|
import { BaseField, RawValue } from 'schemas/types';
|
2022-04-21 13:08:36 +00:00
|
|
|
|
|
|
|
export type ExportExtension = 'csv' | 'json';
|
|
|
|
|
2022-05-12 10:04:37 +00:00
|
|
|
export interface ReportCell {
|
|
|
|
bold?: boolean;
|
|
|
|
italics?: boolean;
|
|
|
|
align?: 'left' | 'right' | 'center';
|
2022-05-12 14:59:56 +00:00
|
|
|
width?: number;
|
2022-05-12 10:04:37 +00:00
|
|
|
value: string;
|
2022-05-16 06:54:58 +00:00
|
|
|
rawValue: RawValue | undefined | Date;
|
|
|
|
indent?: number;
|
|
|
|
color?: 'red' | 'green';
|
2022-04-21 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
2022-05-16 06:54:58 +00:00
|
|
|
export interface ReportRow {
|
|
|
|
cells: ReportCell[];
|
|
|
|
level?: number;
|
|
|
|
isGroup?: boolean;
|
|
|
|
folded?: boolean;
|
|
|
|
foldedBelow?: boolean;
|
|
|
|
}
|
2022-05-12 10:04:37 +00:00
|
|
|
export type ReportData = ReportRow[];
|
|
|
|
export interface ColumnField extends BaseField {
|
2022-05-12 14:59:56 +00:00
|
|
|
align?: 'left' | 'right' | 'center';
|
2022-05-12 10:04:37 +00:00
|
|
|
width?: number;
|
2022-04-21 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type BalanceType = 'Credit' | 'Debit';
|
|
|
|
export type Periodicity = 'Monthly' | 'Quarterly' | 'Half Yearly' | 'Yearly';
|
|
|
|
export interface FinancialStatementOptions {
|
|
|
|
rootType: AccountRootType;
|
|
|
|
fromDate: string;
|
|
|
|
toDate: string;
|
|
|
|
balanceMustBe?: BalanceType;
|
|
|
|
periodicity?: Periodicity;
|
|
|
|
accumulateValues?: boolean;
|
|
|
|
}
|
2022-05-14 08:46:05 +00:00
|
|
|
|
|
|
|
export interface RawLedgerEntry {
|
|
|
|
name: string;
|
|
|
|
account: string;
|
|
|
|
date: string;
|
|
|
|
debit: string;
|
|
|
|
credit: string;
|
|
|
|
referenceType: string;
|
|
|
|
referenceName: string;
|
|
|
|
party: string;
|
|
|
|
reverted: number;
|
|
|
|
reverts: string;
|
|
|
|
[key: string]: RawValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface LedgerEntry {
|
|
|
|
index?: string;
|
|
|
|
name: number;
|
|
|
|
account: string;
|
|
|
|
date: Date | null;
|
|
|
|
debit: number | null;
|
|
|
|
credit: number | null;
|
|
|
|
balance: number | null;
|
|
|
|
referenceType: string;
|
|
|
|
referenceName: string;
|
|
|
|
party: string;
|
|
|
|
reverted: boolean;
|
|
|
|
reverts: string;
|
|
|
|
}
|
|
|
|
|
2022-05-16 06:54:58 +00:00
|
|
|
export type GroupedMap = Map<string, LedgerEntry[]>;
|