Andrew Wallo 10 months ago
parent
commit
0455ee5ae1
1 changed files with 18 additions and 2 deletions
  1. 18
    2
      app/Services/AccountService.php

+ 18
- 2
app/Services/AccountService.php View File

170
                 $join->on('transactions.id', '=', 'journal_entries.transaction_id')
170
                 $join->on('transactions.id', '=', 'journal_entries.transaction_id')
171
                     ->where('transactions.posted_at', '<=', $endDate);
171
                     ->where('transactions.posted_at', '<=', $endDate);
172
             })
172
             })
173
-            ->groupBy('accounts.id')
173
+            ->groupBy([
174
+                'accounts.id',
175
+                'accounts.name',
176
+                'accounts.category',
177
+                'accounts.type',
178
+                'accounts.subtype_id',
179
+                'accounts.currency_code',
180
+                'accounts.code',
181
+            ])
174
             ->with(['subtype:id,name,inverse_cash_flow']);
182
             ->with(['subtype:id,name,inverse_cash_flow']);
175
 
183
 
176
         if (! empty($accountIds)) {
184
         if (! empty($accountIds)) {
230
                     ->whereNotNull('bank_accounts.bank_account_id')
238
                     ->whereNotNull('bank_accounts.bank_account_id')
231
                     ->whereColumn('je.transaction_id', 'journal_entries.transaction_id');
239
                     ->whereColumn('je.transaction_id', 'journal_entries.transaction_id');
232
             })
240
             })
233
-            ->groupBy('accounts.id')
241
+            ->groupBy([
242
+                'accounts.id',
243
+                'accounts.name',
244
+                'accounts.category',
245
+                'accounts.type',
246
+                'accounts.subtype_id',
247
+                'accounts.currency_code',
248
+                'accounts.code',
249
+            ])
234
             ->with(['subtype:id,name,inverse_cash_flow']);
250
             ->with(['subtype:id,name,inverse_cash_flow']);
235
 
251
 
236
         if (! empty($accountIds)) {
252
         if (! empty($accountIds)) {

Loading…
Cancel
Save