Added AccountType method numberAndName().

Fixed bug in bookings.index view: There is no error anymore when a booking has
no project assigned.
This commit is contained in:
Lukas Halbritter
2018-10-04 19:53:59 +02:00
parent e80481f860
commit f8eb022403
2 changed files with 32 additions and 10 deletions
+7 -7
View File
@@ -3,7 +3,7 @@
@section('title', 'Kassenbuch')
@section('subnav')
<a href='/bookings/create'>Neue Buchung</a>
@endsection
@section('content')
@@ -60,12 +60,11 @@
</td>
<td>
@if ($booking->isSimple())
{{ $booking->accountType()->number . ' - ' .
$booking->accountType()->name }}
{{ $booking->accountType()->numberAndName() }}
@endif
</td>
<td>
@if ($booking->isSimple())
@if ($booking->isSimple() and $booking->project() !== null)
{{ $booking->project()->name }}
@endif
</td>
@@ -89,11 +88,12 @@
@endif
</td>
<td>
{{ $subBooking->accountType->number . ' - ' .
$subBooking->accountType->name }}
{{ $subBooking->accountType->numberAndName() }}
</td>
<td>
{{ $subBooking->project->name }}
@if ($subBooking->project !== null)
{{ $subBooking->project->name }}
@endif
</td>
</tr>
@endforeach