Implemented deletion of bookings.

This commit is contained in:
Lukas Halbritter
2018-10-05 19:38:47 +02:00
parent 72252ab2c6
commit f58b193c4e
3 changed files with 57 additions and 3 deletions
+43
View File
@@ -0,0 +1,43 @@
@extends('layout.master')
@section('title', 'Buchung löschen')
@section('subnav')
<a href='{{ url()->previous() }}'>Zurück</a>
@endsection
@section('content')
<h2>@yield('title')</h2>
<form action='/bookings/{{ $booking->id }}' method='post'>
{{ method_field('delete') }}
{{ csrf_field() }}
<p>Soll folgende Buchung und alle ihre Teilbuchungen wirklich gelöscht
werden?</p>
<table border='1'>
<tr>
<th>Datum</th>
<th>Positionen</th>
<th>Person / Firma</th>
<th>Betrag</th>
</tr>
<tr>
<td>{{ $booking->date }}</td>
<td>{{ $booking->reference }}</td>
<td>{{ $booking->person_or_company }}</td>
<td align='right'>{{ formatAmount($booking->signedAmount(), true, true) }}</td>
</tr>
@foreach($booking->subBookings as $subBooking)
<tr>
<td></td>
<td>{{ $subBooking->reference }}</td>
<td></td>
<td align='right'>{{ formatAmount($subBooking->signedAmount(), true, true) }}</td>
</tr>
@endforeach
</table>
<button type="submit" id="submit">Ja</button>
</form>
@endsection
+8 -1
View File
@@ -14,6 +14,7 @@
</h4>
<table border='1'>
<tr>
<th></th>
<th></th>
<th>ID</th>
<th>Datum</th>
@@ -28,6 +29,7 @@
@if (date('Y') > $year
or (date('Y') == $year and date('m') >= $month))
<tr style='color: red; font-weight: bold'>
<td></td>
<td></td>
<td></td>
<td>{{ startOfMonth($year, $month) }}</td>
@@ -47,6 +49,9 @@
v
@endif
</td>
<td>
<a href='/bookings/{{ $booking->id }}/delete'>x</a>
</td>
<td>
<a href='/bookings/{{ $booking->id }}/edit'>
{{ $booking->id }}
@@ -82,6 +87,7 @@
<td>+</td>
<td></td>
<td></td>
<td></td>
<td>{{ $subBooking->reference }}</td>
<td></td>
<td align='right'>
@@ -110,6 +116,7 @@
@if (date('Y') > $year
or (date('Y') == $year and date('m') >= $month))
<tr style='color: #000080; font-weight: bold'>
<td></td>
<td></td>
<td></td>
<td>
@@ -136,7 +143,7 @@
<td></td>
</tr>
<tr>
@for ($i = 0; $i < 9; $i++)
@for ($i = 0; $i < 10; $i++)
<td>&nbsp;</td>
@endfor
</tr>