Explorar el Código

Merge pull request #146 from andrewdwallo/development-3.x

Development 3.x
3.x
Andrew Wallo hace 5 meses
padre
commit
79d5e2f972
No account linked to committer's email address
Se han modificado 1 ficheros con 18 adiciones y 18 borrados
  1. 18
    18
      app/Services/AccountService.php

+ 18
- 18
app/Services/AccountService.php Ver fichero

@@ -299,17 +299,17 @@ class AccountService
299 299
             })
300 300
             ->whereIn('journal_entries.account_id', $accountIds)
301 301
             ->selectRaw('
302
-            SUM(CASE
303
-                WHEN transactions.posted_at < ? AND journal_entries.type = "debit" THEN journal_entries.amount
304
-                WHEN transactions.posted_at < ? AND journal_entries.type = "credit" THEN -journal_entries.amount
305
-                ELSE 0
306
-            END) AS totalStartingBalance,
307
-            SUM(CASE
308
-                WHEN transactions.posted_at BETWEEN ? AND ? AND journal_entries.type = "debit" THEN journal_entries.amount
309
-                WHEN transactions.posted_at BETWEEN ? AND ? AND journal_entries.type = "credit" THEN -journal_entries.amount
310
-                ELSE 0
311
-            END) AS totalNetMovement
312
-        ', [
302
+                SUM(CASE
303
+                    WHEN transactions.posted_at < ? AND journal_entries.type = \'debit\' THEN journal_entries.amount
304
+                    WHEN transactions.posted_at < ? AND journal_entries.type = \'credit\' THEN -journal_entries.amount
305
+                    ELSE 0
306
+                END) AS totalStartingBalance,
307
+                SUM(CASE
308
+                    WHEN transactions.posted_at BETWEEN ? AND ? AND journal_entries.type = \'debit\' THEN journal_entries.amount
309
+                    WHEN transactions.posted_at BETWEEN ? AND ? AND journal_entries.type = \'credit\' THEN -journal_entries.amount
310
+                    ELSE 0
311
+                END) AS totalNetMovement
312
+            ', [
313 313
                 $startDate,
314 314
                 $startDate,
315 315
                 $startDate,
@@ -340,13 +340,13 @@ class AccountService
340 340
                     ->where('transactions.posted_at', '<', $startDate);
341 341
             })
342 342
             ->whereIn('journal_entries.account_id', $accountIds)
343
-            ->selectRaw('
344
-            SUM(CASE
345
-                WHEN transactions.posted_at < ? AND journal_entries.type = "debit" THEN journal_entries.amount
346
-                WHEN transactions.posted_at < ? AND journal_entries.type = "credit" THEN -journal_entries.amount
347
-                ELSE 0
348
-            END) AS totalStartingBalance
349
-        ', [
343
+            ->selectRaw("
344
+                SUM(CASE
345
+                    WHEN transactions.posted_at < ? AND journal_entries.type = 'debit' THEN journal_entries.amount
346
+                    WHEN transactions.posted_at < ? AND journal_entries.type = 'credit' THEN -journal_entries.amount
347
+                    ELSE 0
348
+                END) AS totalStartingBalance
349
+            ", [
350 350
                 $startDate,
351 351
                 $startDate,
352 352
             ])

Loading…
Cancelar
Guardar