Andrew Wallo 5 months ago
parent
commit
420ded8387
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      app/Services/AccountService.php

+ 1
- 1
app/Services/AccountService.php View File

123
                 'journal_entries.type',
123
                 'journal_entries.type',
124
                 'journal_entries.amount',
124
                 'journal_entries.amount',
125
                 'journal_entries.description',
125
                 'journal_entries.description',
126
-                DB::raw('journal_entries.amount * IF(journal_entries.type = "debit", 1, -1) AS signed_amount')
126
+                DB::raw("journal_entries.amount * CASE WHEN journal_entries.type = 'debit' THEN 1 ELSE -1 END AS signed_amount")
127
             )
127
             )
128
                 ->whereBetween('transactions.posted_at', [$startDate, $endDate])
128
                 ->whereBetween('transactions.posted_at', [$startDate, $endDate])
129
                 ->join('transactions', 'transactions.id', '=', 'journal_entries.transaction_id')
129
                 ->join('transactions', 'transactions.id', '=', 'journal_entries.transaction_id')

Loading…
Cancel
Save