@accounter/server
Version:
38 lines (37 loc) • 2.34 kB
TypeScript
import type { IGetFinancialEntitiesByIdsResult } from '../../financial-entities/types.js';
import type { IGetLedgerRecordsByDatesResult } from '../../ledger/types.js';
import type { CommentaryProto } from '../types.js';
export type LedgerRecordDecorations = Partial<{
credit_entity_sort_code1: number;
credit_entity_sort_code2: number;
debit_entity_sort_code1: number;
debit_entity_sort_code2: number;
}>;
export type DecoratedLedgerRecord = IGetLedgerRecordsByDatesResult & LedgerRecordDecorations;
export declare function decorateLedgerRecords(ledgerRecords: IGetLedgerRecordsByDatesResult[], financialEntitiesDict: Map<string, IGetFinancialEntitiesByIdsResult>): DecoratedLedgerRecord[];
export declare function updateRecords(amountsByEntity: Map<number, {
amount: number;
records: Map<string, number>;
}>, amount: number, sortCode: number, financialEntityId: string): void;
export declare function amountBySortCodeValidation(unfilteredRecords: DecoratedLedgerRecord[], validation: (sortCode: number) => boolean, negate?: boolean): CommentaryProto;
export declare function amountByFinancialEntityIdValidation(unfilteredRecords: DecoratedLedgerRecord[], validation: (financialEntityId: string) => boolean, negate?: boolean): number;
export declare function getProfitLossReportAmounts(decoratedLedgerRecords: DecoratedLedgerRecord[]): {
revenueAmount: number;
revenueRecords: import("../types.js").CommentaryRecordProto[];
costOfSalesAmount: number;
costOfSalesRecords: import("../types.js").CommentaryRecordProto[];
grossProfitAmount: number;
researchAndDevelopmentExpensesAmount: number;
researchAndDevelopmentExpensesRecords: import("../types.js").CommentaryRecordProto[];
marketingExpensesAmount: number;
marketingExpensesRecords: import("../types.js").CommentaryRecordProto[];
managementAndGeneralExpensesAmount: number;
managementAndGeneralExpensesRecords: import("../types.js").CommentaryRecordProto[];
operatingProfitAmount: number;
financialExpensesAmount: number;
financialExpensesRecords: import("../types.js").CommentaryRecordProto[];
otherIncomeAmount: number;
otherIncomeRecords: import("../types.js").CommentaryRecordProto[];
profitBeforeTaxAmount: number;
profitBeforeTaxRecords: import("../types.js").CommentaryRecordProto[];
};