Skip to content

Commit

Permalink
close #2221 Fixed: Account Show wrong show transction date
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Aug 11, 2021
1 parent c0ebf80 commit d763f99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions app/Http/Controllers/Banking/Accounts.php
Expand Up @@ -34,16 +34,14 @@ public function index()
*/
public function show(Account $account)
{
$limit = (int) request('limit', setting('default.list_limit', '25'));

// Handle transactions
$transactions = Transaction::with('account', 'category')->where('account_id', $account->id)->collect('paid_at');

$transfers = Transfer::with('transaction')->all()->filter(function ($transfer) use($account) {
if ($transfer->expense_account->id == $account->id || $transfer->income_account->id == $account->id) {
return true;
}

return false;
})->sortByDesc(function ($transfer) {
return $transfer->expense_transaction->paid_at;
Expand Down
4 changes: 2 additions & 2 deletions resources/views/banking/accounts/show.blade.php
Expand Up @@ -216,7 +216,7 @@
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-sm-3"><a href="{{ route($item->route_name, $item->route_id) }}">@date($item->issued_at)</a></td>
<td class="col-sm-3"><a href="{{ route($item->route_name, $item->route_id) }}">@date($item->paid_at)</a></td>
<td class="col-sm-3">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-3">{{ $item->type_title }}</td>
<td class="col-sm-3">{{ $item->category->name }}</td>
Expand Down Expand Up @@ -257,7 +257,7 @@
</tr>
@endforeach
</tbody>
</table>
</table>
</div>

<div class="card-footer py-4 table-action">
Expand Down

0 comments on commit d763f99

Please sign in to comment.