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