Simplyfied the array structure of the form values and added error messages.
This commit is contained in:
@@ -12,25 +12,26 @@
|
||||
<h2>Allgemeine Buchungsinformationen</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>{{ Form::label('date', 'Datum') }}</td>
|
||||
<td>{{ Form::date('date', $booking->date) }}</td>
|
||||
<td>{{ Form::label('booking[date]', 'Datum') }}</td>
|
||||
<td>{{ Form::date('booking[date]', $booking->date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ Form::label('booking_reference', 'Buchungstext') }}</td>
|
||||
<td>{{ Form::text('booking_reference', $booking->reference) }}</td>
|
||||
<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>
|
||||
<td>{{ Form::label('booking[person_or_company]', 'Person / Firma') }}</td>
|
||||
<td>{{ Form::text('booking[person_or_company]', $booking->person_or_company) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ Form::label('note', 'Anmerkung') }}</td>
|
||||
<td>{{ Form::textarea('note', $booking->note) }}</td>
|
||||
<td>{{ Form::label('booking[note]', 'Anmerkung') }}</td>
|
||||
<td>{{ Form::textarea('booking[note]', $booking->note) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Teilbuchungen</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Buchungstext</th>
|
||||
<th>Betrag</th>
|
||||
<th>Konto</th>
|
||||
<th>Personenkonto</th>
|
||||
@@ -38,11 +39,26 @@
|
||||
</tr>
|
||||
@foreach ($booking->subBookings as $subBooking)
|
||||
<tr>
|
||||
<td>{{ Form::text('amount', $subBooking->amount) }}</td>
|
||||
<td>
|
||||
{{
|
||||
Form::text(
|
||||
"sub_booking[$subBooking->id][reference]",
|
||||
$subBooking->reference
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
Form::text(
|
||||
"sub_booking[$subBooking->id][amount]",
|
||||
$subBooking->amount
|
||||
)
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'account_type_id',
|
||||
"sub_booking[$subBooking->id][account_type_id]",
|
||||
$accountTypeArray,
|
||||
$subBooking->account_type_id,
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
@@ -52,7 +68,7 @@
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'person_target_id',
|
||||
"sub_booking[$subBooking->id][person_target_id]",
|
||||
$openTargetsArray,
|
||||
$subBooking->person_target_id,
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
@@ -62,7 +78,7 @@
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'project_id',
|
||||
"sub_booking[$subBooking->id][project_id]",
|
||||
$projectsArray,
|
||||
$subBooking->project_id,
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
@@ -72,11 +88,12 @@
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td>{{ Form::text('amount') }}</td>
|
||||
<td>{{ Form::text('sub_booking[0][reference]') }}</td>
|
||||
<td>{{ Form::text('sub_booking[0][amount]') }}</td>
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'account_type_id',
|
||||
'sub_booking[0][account_type_id]',
|
||||
$accountTypeArray,
|
||||
'placeholder',
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
@@ -86,7 +103,7 @@
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'person_target_id',
|
||||
'sub_booking[0][person_target_id]',
|
||||
$openTargetsArray,
|
||||
'placeholder',
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
@@ -96,7 +113,7 @@
|
||||
<td>
|
||||
{{
|
||||
Form::select(
|
||||
'project_id',
|
||||
'sub_booking[0][project_id]',
|
||||
$projectsArray,
|
||||
'placeholder',
|
||||
['placeholder' => 'Hier auswählen ...']
|
||||
@@ -105,7 +122,13 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<button type="submit" id="submit">Speichern</button>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user