mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactoring: balance sheet report.
refactoring: trial balance sheet report. refactoring: general ledger report. refactoring: journal report. refactoring: P&L report.
This commit is contained in:
45
server/src/interfaces/ARAgingSummaryReport.ts
Normal file
45
server/src/interfaces/ARAgingSummaryReport.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
|
||||
export interface IARAgingSummaryQuery {
|
||||
asDate: Date | string,
|
||||
agingDaysBefore: number,
|
||||
agingPeriods: number,
|
||||
numberFormat: {
|
||||
noCents: number,
|
||||
divideOn1000: number,
|
||||
},
|
||||
customersIds: number[],
|
||||
noneZero: boolean,
|
||||
}
|
||||
|
||||
export interface IAgingPeriod {
|
||||
fromPeriod: Date,
|
||||
toPeriod: Date,
|
||||
beforeDays: number,
|
||||
toDays: number,
|
||||
};
|
||||
|
||||
export interface IAgingPeriodClosingBalance extends IAgingPeriod {
|
||||
closingBalance: number,
|
||||
};
|
||||
|
||||
export interface IAgingPeriodTotal extends IAgingPeriod {
|
||||
total: number,
|
||||
};
|
||||
|
||||
export interface ARAgingSummaryCustomerPeriod {
|
||||
|
||||
}
|
||||
|
||||
export interface ARAgingSummaryCustomerTotal {
|
||||
amount: number,
|
||||
formattedAmount: string,
|
||||
currencyCode: string,
|
||||
}
|
||||
|
||||
export interface ARAgingSummaryCustomer {
|
||||
customerName: string,
|
||||
aging: IAgingPeriodTotal[],
|
||||
total: ARAgingSummaryCustomerTotal,
|
||||
};
|
||||
@@ -10,9 +10,11 @@ export interface IAccountDTO {
|
||||
};
|
||||
|
||||
export interface IAccount {
|
||||
id: number,
|
||||
name: string,
|
||||
slug: string,
|
||||
code: string,
|
||||
index: number,
|
||||
description: string,
|
||||
accountTypeId: number,
|
||||
parentAccountId: number,
|
||||
@@ -20,6 +22,8 @@ export interface IAccount {
|
||||
predefined: boolean,
|
||||
amount: number,
|
||||
currencyCode: string,
|
||||
transactions?: any[],
|
||||
type?: any[],
|
||||
};
|
||||
|
||||
export interface IAccountsFilter extends IDynamicListFilterDTO {
|
||||
|
||||
74
server/src/interfaces/BalanceSheet.ts
Normal file
74
server/src/interfaces/BalanceSheet.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
export interface IBalanceSheetQuery{
|
||||
displayColumnsType: 'total' | 'date_periods',
|
||||
displayColumnsBy: string,
|
||||
fromDate: Date|string,
|
||||
toDate: Date|string,
|
||||
numberFormat: {
|
||||
noCents: boolean,
|
||||
divideOn1000: boolean,
|
||||
},
|
||||
noneZero: boolean,
|
||||
noneTransactions: boolean,
|
||||
basis: 'cash' | 'accural',
|
||||
accountIds: number[],
|
||||
}
|
||||
|
||||
export interface IBalanceSheetStatementService {
|
||||
balanceSheet(tenantId: number, query: IBalanceSheetQuery): Promise<IBalanceSheetStatement>;
|
||||
}
|
||||
|
||||
export interface IBalanceSheetStatementColumns {
|
||||
|
||||
}
|
||||
|
||||
export interface IBalanceSheetStatementData {
|
||||
|
||||
}
|
||||
|
||||
export interface IBalanceSheetStatement {
|
||||
query: IBalanceSheetQuery,
|
||||
columns: IBalanceSheetStatementColumns,
|
||||
data: IBalanceSheetStatementData,
|
||||
}
|
||||
|
||||
export interface IBalanceSheetStructureSection {
|
||||
name: string,
|
||||
sectionType?: string,
|
||||
type: 'section' | 'accounts_section',
|
||||
children?: IBalanceSheetStructureSection[],
|
||||
_accountsTypesRelated?: string[],
|
||||
_forceShow?: boolean,
|
||||
}
|
||||
|
||||
export interface IBalanceSheetAccountTotal {
|
||||
amount: number,
|
||||
formattedAmount: string,
|
||||
currencyCode: string,
|
||||
date?: string|Date,
|
||||
}
|
||||
|
||||
export interface IBalanceSheetAccount {
|
||||
id: number,
|
||||
index: number,
|
||||
name: string,
|
||||
code: string,
|
||||
parentAccountId: number,
|
||||
type: 'account',
|
||||
hasTransactions: boolean,
|
||||
children?: IBalanceSheetAccount[],
|
||||
total: IBalanceSheetAccountTotal,
|
||||
totalPeriods?: IBalanceSheetAccountTotal[],
|
||||
}
|
||||
|
||||
export interface IBalanceSheetSection {
|
||||
name: string,
|
||||
sectionType?: string,
|
||||
type: 'section' | 'accounts_section',
|
||||
children: IBalanceSheetAccount[] | IBalanceSheetSection[],
|
||||
total: IBalanceSheetAccountTotal,
|
||||
totalPeriods?: IBalanceSheetAccountTotal[];
|
||||
|
||||
_accountsTypesRelated?: string[],
|
||||
_forceShow?: boolean,
|
||||
}
|
||||
@@ -43,6 +43,7 @@ export interface IContactAddressDTO {
|
||||
shippingAddressState?: string,
|
||||
};
|
||||
export interface IContact extends IContactAddress{
|
||||
id?: number,
|
||||
contactService: 'customer' | 'vendor',
|
||||
contactType: string,
|
||||
|
||||
|
||||
2
server/src/interfaces/FinancialStatements.ts
Normal file
2
server/src/interfaces/FinancialStatements.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
61
server/src/interfaces/GeneralLedgerSheet.ts
Normal file
61
server/src/interfaces/GeneralLedgerSheet.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
|
||||
export interface IGeneralLedgerSheetQuery {
|
||||
fromDate: Date | string,
|
||||
toDate: Date | string,
|
||||
basis: string,
|
||||
numberFormat: {
|
||||
noCents: boolean,
|
||||
divideOn1000: boolean,
|
||||
},
|
||||
noneTransactions: boolean,
|
||||
accountsIds: number[],
|
||||
};
|
||||
|
||||
export interface IGeneralLedgerSheetAccountTransaction {
|
||||
id: number,
|
||||
amount: number,
|
||||
formattedAmount: string,
|
||||
currencyCode: string,
|
||||
note?: string,
|
||||
transactionType?: string,
|
||||
referenceId?: number,
|
||||
referenceType?: string,
|
||||
date: Date|string,
|
||||
};
|
||||
|
||||
export interface IGeneralLedgerSheetAccountBalance {
|
||||
date: Date|string,
|
||||
amount: number,
|
||||
formattedAmount: string,
|
||||
currencyCode: string,
|
||||
}
|
||||
|
||||
export interface IGeneralLedgerSheetAccount {
|
||||
id: number,
|
||||
name: string,
|
||||
code: string,
|
||||
index: number,
|
||||
parentAccountId: number,
|
||||
transactions: IGeneralLedgerSheetAccountTransaction[],
|
||||
opening: IGeneralLedgerSheetAccountBalance,
|
||||
closing: IGeneralLedgerSheetAccountBalance,
|
||||
}
|
||||
|
||||
export interface IAccountTransaction {
|
||||
id: number,
|
||||
index: number,
|
||||
draft: boolean,
|
||||
note: string,
|
||||
accountId: number,
|
||||
transactionType: string,
|
||||
referenceType: string,
|
||||
referenceId: number,
|
||||
contactId: number,
|
||||
contactType: string,
|
||||
credit: number,
|
||||
debit: number,
|
||||
date: string|Date,
|
||||
createdAt: string|Date,
|
||||
updatedAt: string|Date,
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
export interface IJournalEntry {
|
||||
id: number,
|
||||
index?: number,
|
||||
|
||||
date: Date,
|
||||
@@ -18,6 +19,8 @@ export interface IJournalEntry {
|
||||
};
|
||||
|
||||
export interface IJournalPoster {
|
||||
entries: IJournalEntry[],
|
||||
|
||||
credit(entry: IJournalEntry): void;
|
||||
debit(entry: IJournalEntry): void;
|
||||
|
||||
@@ -26,6 +29,9 @@ export interface IJournalPoster {
|
||||
saveEntries(): void;
|
||||
saveBalance(): void;
|
||||
deleteEntries(): void;
|
||||
|
||||
getAccountBalance(accountId: number, closingDate?: Date | string, dateType?: string): number;
|
||||
getAccountEntries(accountId: number): IJournalEntry[];
|
||||
}
|
||||
|
||||
export type TEntryType = 'credit' | 'debit';
|
||||
|
||||
28
server/src/interfaces/JournalReport.ts
Normal file
28
server/src/interfaces/JournalReport.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { IJournalEntry } from './Journal';
|
||||
|
||||
export interface IJournalReportQuery {
|
||||
fromDate: Date | string,
|
||||
toDate: Date | string,
|
||||
numberFormat: {
|
||||
noCents: boolean,
|
||||
divideOn1000: boolean,
|
||||
},
|
||||
transactionTypes: string | string[],
|
||||
accountsIds: number | number[],
|
||||
fromRange: number,
|
||||
toRange: number,
|
||||
}
|
||||
|
||||
export interface IJournalReportEntriesGroup {
|
||||
id: string,
|
||||
entries: IJournalEntry[],
|
||||
currencyCode: string,
|
||||
credit: number,
|
||||
debit: number,
|
||||
formattedCredit: string,
|
||||
formattedDebit: string,
|
||||
}
|
||||
|
||||
export interface IJournalReport {
|
||||
entries: IJournalReportEntriesGroup[],
|
||||
}
|
||||
58
server/src/interfaces/ProfitLossSheet.ts
Normal file
58
server/src/interfaces/ProfitLossSheet.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
export interface IProfitLossSheetQuery {
|
||||
basis: string,
|
||||
fromDate: Date | string,
|
||||
toDate: Date | string,
|
||||
numberFormat: {
|
||||
noCents: boolean,
|
||||
divideOn1000: boolean,
|
||||
},
|
||||
noneZero: boolean,
|
||||
noneTransactions: boolean,
|
||||
accountsIds: number[],
|
||||
displayColumnsType: 'total' | 'date_periods',
|
||||
displayColumnsBy: string,
|
||||
};
|
||||
|
||||
export interface IProfitLossSheetTotal {
|
||||
amount: number,
|
||||
formattedAmount: string,
|
||||
currencyCode: string,
|
||||
date?: Date|string,
|
||||
};
|
||||
|
||||
export interface IProfitLossSheetAccount {
|
||||
id: number,
|
||||
index: number,
|
||||
name: string,
|
||||
code: string,
|
||||
parentAccountId: number,
|
||||
hasTransactions: boolean,
|
||||
total: IProfitLossSheetTotal,
|
||||
totalPeriods: IProfitLossSheetTotal[],
|
||||
};
|
||||
|
||||
export interface IProfitLossSheetAccountsSection {
|
||||
sectionTitle: string,
|
||||
entryNormal: 'credit',
|
||||
accounts: IProfitLossSheetAccount[],
|
||||
total: IProfitLossSheetTotal,
|
||||
totalPeriods?: IProfitLossSheetTotal[],
|
||||
};
|
||||
|
||||
export interface IProfitLossSheetTotalSection {
|
||||
total: IProfitLossSheetTotal,
|
||||
totalPeriods?: IProfitLossSheetTotal[],
|
||||
};
|
||||
|
||||
export interface IProfitLossSheetStatement {
|
||||
income: IProfitLossSheetAccountsSection,
|
||||
costOfSales: IProfitLossSheetAccountsSection,
|
||||
expenses: IProfitLossSheetAccountsSection,
|
||||
otherExpenses: IProfitLossSheetAccountsSection,
|
||||
|
||||
netIncome: IProfitLossSheetTotalSection;
|
||||
operatingProfit: IProfitLossSheetTotalSection;
|
||||
grossProfit: IProfitLossSheetTotalSection;
|
||||
};
|
||||
37
server/src/interfaces/TrialBalanceSheet.ts
Normal file
37
server/src/interfaces/TrialBalanceSheet.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
export interface ITrialBalanceSheetQuery {
|
||||
fromDate: Date|string,
|
||||
toDate: Date|string,
|
||||
numberFormat: {
|
||||
noCents: boolean,
|
||||
divideOn1000: boolean,
|
||||
},
|
||||
basis: 'cash' | 'accural',
|
||||
noneZero: boolean,
|
||||
noneTransactions: boolean,
|
||||
accountIds: number[],
|
||||
}
|
||||
|
||||
export interface ITrialBalanceAccount {
|
||||
id: number,
|
||||
parentAccountId: number,
|
||||
name: string,
|
||||
code: string,
|
||||
accountNormal: string,
|
||||
hasTransactions: boolean,
|
||||
|
||||
credit: number,
|
||||
debit: number,
|
||||
balance: number,
|
||||
|
||||
formattedCredit: string,
|
||||
formattedDebit: string,
|
||||
formattedBalance: string,
|
||||
}
|
||||
|
||||
export type ITrialBalanceSheetData = IBalanceSheetSection[];
|
||||
|
||||
export interface ITrialBalanceStatement {
|
||||
data: ITrialBalanceSheetData,
|
||||
query: ITrialBalanceSheetQuery,
|
||||
}
|
||||
@@ -28,4 +28,12 @@ export * from './ManualJournal';
|
||||
export * from './Currency';
|
||||
export * from './ExchangeRate';
|
||||
export * from './Media';
|
||||
export * from './SaleEstimate';
|
||||
export * from './SaleEstimate';
|
||||
export * from './FinancialStatements';
|
||||
export * from './BalanceSheet';
|
||||
export * from './TrialBalanceSheet';
|
||||
export * from './GeneralLedgerSheet'
|
||||
export * from './ProfitLossSheet';
|
||||
export * from './JournalReport';
|
||||
|
||||
export * from './ARAgingSummaryReport';
|
||||
Reference in New Issue
Block a user