Sfoglia il codice sorgente

Merge pull request #83 from andrewdwallo/fix/group-by-error

fix #82
3.x
Andrew Wallo 10 mesi fa
parent
commit
2352c1416f
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 18 aggiunte e 2 eliminazioni
  1. 18
    2
      app/Services/AccountService.php

+ 18
- 2
app/Services/AccountService.php Vedi 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…
Annulla
Salva