diff --git a/app/Http/Controllers/Banking/Transactions.php b/app/Http/Controllers/Banking/Transactions.php index bfa13b243..fcc639375 100644 --- a/app/Http/Controllers/Banking/Transactions.php +++ b/app/Http/Controllers/Banking/Transactions.php @@ -28,7 +28,7 @@ class Transactions extends Controller $request_type = !request()->has('type') ? ['income', 'expense'] : request('type'); $categories = Category::enabled()->type($request_type)->orderBy('name')->pluck('name', 'id'); - $transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']); + $transactions = Transaction::with(['account', 'category', 'contact', 'bill:id', 'invoice.id'])->collect(['paid_at'=> 'desc']); return view('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories')); } diff --git a/resources/views/banking/transactions/index.blade.php b/resources/views/banking/transactions/index.blade.php index 71b61c88e..7218078c9 100644 --- a/resources/views/banking/transactions/index.blade.php +++ b/resources/views/banking/transactions/index.blade.php @@ -46,7 +46,21 @@ {{ trans_choice('general.' . Str::plural($item->type), 1) }} {{ $item->category->name }} {{ $item->description }} + @if(!is_null(data_get($item, 'bill.id'))) + + + @money($item->amount, $item->currency_code, true) + + + @elseif(!is_null(data_get($item, 'invoice.id'))) + + + @money($item->amount, $item->currency_code, true) + + + @else @money($item->amount, $item->currency_code, true) + @endif @endforeach