Files
pollux/resources/views/bookings/index.blade.php
T

165 lines
6.2 KiB
PHP

@extends('layout.master')
@section('title', 'Kassenbuch')
@section('subnav')
<li class="nav-item ml-auto">
<a href='/bookings/create' class="btn btn-outline-success">Neue Buchung</a>
<a href='/reports/balances/{{ $year }}' class="btn btn-outline-warning">HS-Rechnung</a>
<a href='/reports/scopes/compact/{{ $year }}' class="btn
btn-outline-warning">Abrechnung</a>
</li>
@endsection
@section('content')
<div class="d-flex justify-content-between h4 mb-5 mt-4">
<a href='/bookings/year-{{ $year - 1 }}'>
<i class="fas fa-chevron-left"></i> {{ $year - 1 }}
</a>
<strong>1. Januar {{ $year }} - 31. Dezember {{ $year }}</strong>
<a href='/bookings/year-{{ $year + 1 }}'>
{{ $year + 1 }} <i class="fas fa-chevron-right"></i>
</a>
</div>
<table class='table table-striped table-bordered'>
<tr>
<th>Datum</th>
<th>Positionen</th>
<th>Person / Firma</th>
<th>Ausgang (S)</th>
<th>Eingang (H)</th>
<th>Konto</th>
<th>Projekt</th>
<th></th>
</tr>
@for ($month = 1; $month <= 12; $month++)
@if ((
date('Y') > $year
or (date('Y') == $year
and date('m') >= $month)
) and (
$firstDate['Y'] < $year
or $firstDate['Y'] == $year
and $firstDate['m'] <= $month
))
<tr style='color: red; font-weight: bold'>
<td>{{ startOfMonth($year, $month) }}</td>
<td>Saldo</td>
<td></td>
<td></td>
<td>{!! formatAmount($sums[$month - 1]['balance']) !!}</td>
<td></td>
<td></td>
<td></td>
</tr>
@endif
@if (isset($bookings[$month]))
@foreach($bookings[$month] as $booking)
<tr>
<td>{{ formatDate($booking->date) }}</td>
<td>{{ $booking->reference }}</td>
<td>{{ $booking->person_or_company }}</td>
<td align='right'>
@if ($booking->signedAmount() < 0)
{!! formatAmount($booking->signedAmount()) !!}
@endif
</td>
<td align='right'>
@if ($booking->signedAmount() >= 0)
{!! formatAmount($booking->signedAmount()) !!}
@endif
</td>
<td>
@if ($booking->isSimple())
{{ $booking->accountType()->numberAndName() }}
@endif
</td>
<td>
@if ($booking->isSimple() and $booking->project() !== null)
{{ $booking->project()->name }}
@endif
</td>
<td>
<div class='btn-group' role='group' aria-label='Basic example'>
<a href='/bookings/{{ $booking->id }}/edit' class='btn btn-success'>
<i class='fas fa-edit'></i>
</a>
<a href='/bookings/{{ $booking->id }}/delete' class='btn btn-danger'>
<i class="fas fa-trash"></i>
</a>
</div>
</td>
</tr>
@if (!$booking->isSimple())
@foreach ($booking->subBookings as $subBooking)
<tr>
<td></td>
<td>{{ $subBooking->reference }}</td>
<td></td>
<td align='right'>
@if ($subBooking->signedAmount() < 0)
{!! formatAmount($subBooking->signedAmount()) !!}
@endif
</td>
<td align='right'>
@if ($subBooking->signedAmount() >= 0)
{!! formatAmount($subBooking->signedAmount()) !!}
@endif
</td>
<td>
{{ $subBooking->accountType->numberAndName() }}
</td>
<td>
@if ($subBooking->project !== null)
{{ $subBooking->project->name }}
@endif
</td>
<td></td>
</tr>
@endforeach
@endif
@endforeach
@endif
@if ((
date('Y') > $year
or (date('Y') == $year
and date('m') >= $month)
) and (
$firstDate['Y'] < $year
or $firstDate['Y'] == $year
and $firstDate['m'] <= $month
))
<tr style='color: #000080; font-weight: bold'>
<td>
{{ endOfMonth($year, $month) }}
</td>
<td>Monatsabschluss</td>
<td></td>
<td>{!! formatAmount($sums[$month]['expeditures']) !!}</td>
<td>{!! formatAmount($sums[$month]['incomes']) !!}</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style='color: red; font-weight: bold'>
<td>
{{ endOfMonth($year, $month) }}
</td>
<td>Saldo</td>
<td></td>
<td>{!! formatAmount($sums[$month]['balance']) !!}</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
@for ($i = 0; $i < 8; $i++)
<td>&nbsp;</td>
@endfor
</tr>
@endif
@endfor
</table>
@endsection