feat: general ledger closing balance with accounts row

This commit is contained in:
Ahmed Bouhuolia
2024-06-06 18:42:07 +02:00
parent 5dbfd36415
commit 10fcf94c92
4 changed files with 99 additions and 31 deletions

View File

@@ -71,7 +71,9 @@ export class GeneralLedgerRepository {
* Initialize the accounts.
*/
public async initAccounts() {
this.accounts = await this.repositories.accountRepository.all();
this.accounts = await this.repositories.accountRepository
.all()
.orderBy('name', 'ASC');
}
/**
@@ -94,11 +96,13 @@ export class GeneralLedgerRepository {
* Initialize the G/L transactions from/to the given date.
*/
public async initTransactions() {
this.transactions = await this.repositories.transactionsRepository.journal({
fromDate: this.filter.fromDate,
toDate: this.filter.toDate,
branchesIds: this.filter.branchesIds,
});
this.transactions = await this.repositories.transactionsRepository
.journal({
fromDate: this.filter.fromDate,
toDate: this.filter.toDate,
branchesIds: this.filter.branchesIds,
})
.orderBy('date', 'ASC');
// Transform array transactions to journal collection.
this.transactionsLedger = Ledger.fromTransactions(this.transactions);
}