mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +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:
18
server/src/repositories/JournalRepository.ts
Normal file
18
server/src/repositories/JournalRepository.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IBalanceSheetQuery } from 'interfaces';
|
||||
import TenantRepository from 'repositories/TenantRepository';
|
||||
|
||||
|
||||
export default class JournalRepository extends TenantRepository {
|
||||
|
||||
balanceSheet(query: IBalanceSheetQuery) {
|
||||
|
||||
// Accounts dependency graph.
|
||||
const accountsGraph = Account.toDependencyGraph(balanceSheetAccounts);
|
||||
|
||||
// Load all entries that associated to the given accounts.
|
||||
const journalEntriesCollected = Account.collectJournalEntries(balanceSheetAccounts);
|
||||
|
||||
const journalEntries = new JournalPoster(accountsGraph);
|
||||
journalEntries.loadEntries(journalEntriesCollected);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user