Transferred the loading of the arrays for the booking forms into a own separate
method. Impemented the booking.edit view and controller method. Fixed the bug in the bookings.index view that only months with cashflow are listed.
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('subnav')
|
||||
<a href='{{ url()->previous() }}'>Zurück</a>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>@yield('title')</h1>
|
||||
<form action="/bookings/{{ $booking->id }}" method='post'>
|
||||
{{ method_field('patch') }}
|
||||
{{ csrf_field() }}
|
||||
<h2>Allgemeine Buchungsinformationen</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>{{ Form::label('date', 'Datum') }}</td>
|
||||
<td>{{ Form::date('date', $booking->date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ Form::label('booking_reference', 'Buchungstext') }}</td>
|
||||
<td>{{ Form::text('booking_reference', $booking->reference) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ Form::label('person_or_company', 'Person / Firma') }}</td>
|
||||
<td>{{ Form::text('person_or_company', $booking->person_or_company) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ Form::label('note', 'Anmerkung') }}</td>
|
||||
<td>{{ Form::textarea('note', $booking->note) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Teilbuchungen</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Betrag</th>
|
||||
<th>Konto</th>
|
||||
<th>Personenkonto</th>
|
||||
<th>Projekt</th>
|
||||
</tr>
|
||||
@foreach ($booking->subBookings as $subBooking)
|
||||
<tr>
|
||||
<td>{{ Form::text('amount', $subBooking->amount) }}</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'account_type_id',
|
||||
$accountTypeArray,
|
||||
$subBooking->account_type_id,
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'person_target_id',
|
||||
$openTargetsArray,
|
||||
$subBooking->person_target_id,
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'project_id',
|
||||
$projectsArray,
|
||||
$subBooking->project_id,
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td>{{ Form::text('amount') }}</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'account_type_id',
|
||||
$accountTypeArray,
|
||||
'placeholder',
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'person_target_id',
|
||||
$openTargetsArray,
|
||||
'placeholder',
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'project_id',
|
||||
$projectsArray,
|
||||
'placeholder',
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<button type="submit" id="submit">Speichern</button>
|
||||
</form>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user