Skip to content

Commit

Permalink
Merge pull request #83 from andrewdwallo/fix/group-by-error
Browse files Browse the repository at this point in the history
fix #82
  • Loading branch information
andrewdwallo authored Dec 4, 2024
2 parents 9902962 + 0455ee5 commit 2352c14
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/Services/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ public function getAccountBalances(string $startDate, string $endDate, array $ac
$join->on('transactions.id', '=', 'journal_entries.transaction_id')
->where('transactions.posted_at', '<=', $endDate);
})
->groupBy('accounts.id')
->groupBy([
'accounts.id',
'accounts.name',
'accounts.category',
'accounts.type',
'accounts.subtype_id',
'accounts.currency_code',
'accounts.code',
])
->with(['subtype:id,name,inverse_cash_flow']);

if (! empty($accountIds)) {
Expand Down Expand Up @@ -230,7 +238,15 @@ public function getCashFlowAccountBalances(string $startDate, string $endDate, a
->whereNotNull('bank_accounts.bank_account_id')
->whereColumn('je.transaction_id', 'journal_entries.transaction_id');
})
->groupBy('accounts.id')
->groupBy([
'accounts.id',
'accounts.name',
'accounts.category',
'accounts.type',
'accounts.subtype_id',
'accounts.currency_code',
'accounts.code',
])
->with(['subtype:id,name,inverse_cash_flow']);

if (! empty($accountIds)) {
Expand Down

0 comments on commit 2352c14

Please sign in to comment.