diff --git a/app/Services/GeneralJournalEntryService.php b/app/Services/GeneralJournalEntryService.php index 3e2d1f9..8056c0c 100644 --- a/app/Services/GeneralJournalEntryService.php +++ b/app/Services/GeneralJournalEntryService.php @@ -46,7 +46,7 @@ public function index(array $params): array DB::raw('0 as withdrawal_amount'), DB::raw('COALESCE(journal_entries.total_debit, 0) as debit_amount'), DB::raw('COALESCE(journal_entries.total_credit, 0) as credit_amount'), - DB::raw("CASE WHEN journal_entries.id IS NOT NULL THEN 'linked' ELSE 'manual' END as source"), + DB::raw("'linked' as source"), 'deposits.created_at', 'deposits.updated_at', DB::raw('journal_entries.id as journal_entry_id'), @@ -73,7 +73,7 @@ public function index(array $params): array 'withdrawals.amount as withdrawal_amount', DB::raw('COALESCE(journal_entries.total_debit, 0) as debit_amount'), DB::raw('COALESCE(journal_entries.total_credit, 0) as credit_amount'), - DB::raw("CASE WHEN journal_entries.id IS NOT NULL THEN 'linked' ELSE 'manual' END as source"), + DB::raw("'linked' as source"), 'withdrawals.created_at', 'withdrawals.updated_at', DB::raw('journal_entries.id as journal_entry_id'), @@ -170,12 +170,10 @@ public function index(array $params): array return [ 'data' => $items->toArray(), - 'meta' => [ - 'current_page' => $page, - 'last_page' => (int) ceil($totalCount / $perPage), - 'per_page' => $perPage, - 'total' => $totalCount, - ], + 'current_page' => $page, + 'last_page' => (int) ceil($totalCount / $perPage), + 'per_page' => $perPage, + 'total' => $totalCount, ]; }