- Anlage-Spalte in allen Buchungstabellen verlinkt jetzt auf /assets/{id}/edit
- bk.asset_id in UstvaCalculator und EuerCalculator-Queries ergänzt
- Fallback-Anzeige: Bezeichnung wenn anlage_nr leer ist
- Migration 032: anlage_nr für bestehende Anlagegüter nachgenerieren
- README: Feature Anlagevermögen dokumentiert
89 lines
3.8 KiB
PHP
89 lines
3.8 KiB
PHP
<?php
|
||
use Steuerkram\View;
|
||
$h = fn($v) => View::h($v);
|
||
$fmt = fn($v) => number_format((float)$v, 2, ',', '.') . ' €';
|
||
?>
|
||
|
||
<div class="card">
|
||
<div class="card-header">
|
||
<div>
|
||
<div class="card-title">
|
||
<?= $h($konto['kontonummer'] ?? '') ?> – <?= $h($konto['bezeichnung'] ?? '') ?>
|
||
</div>
|
||
<div class="text-muted text-sm">EÜR <?= $h($year) ?></div>
|
||
</div>
|
||
<a href="/tax/euer/<?= $h($year) ?>" class="btn btn-secondary btn-sm">← Zurück zur EÜR</a>
|
||
</div>
|
||
|
||
<?php if (empty($bookings)): ?>
|
||
<div class="card-body">
|
||
<p class="text-muted">Keine Buchungen für dieses Konto in <?= $h($year) ?>.</p>
|
||
</div>
|
||
<?php else: ?>
|
||
<div class="table-wrap">
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Datum</th>
|
||
<th>Beleg</th>
|
||
<th>Buchungstext</th>
|
||
<th>Zahlungskonto</th>
|
||
<th class="td-right">Netto</th>
|
||
<th class="td-right">USt</th>
|
||
<th class="td-right">Brutto</th>
|
||
<th>Anlage</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<?php
|
||
$sumNetto = 0.0;
|
||
$sumUst = 0.0;
|
||
$sumBrutto = 0.0;
|
||
foreach ($bookings as $b):
|
||
$netto = (float)$b['betrag_netto'];
|
||
$ust = (float)$b['betrag_ust'];
|
||
$brutto = (float)$b['betrag_brutto'];
|
||
$sumNetto += $netto;
|
||
$sumUst += $ust;
|
||
$sumBrutto += $brutto;
|
||
?>
|
||
<tr<?= $b['is_reversal'] ? ' style="font-style:italic;color:#888"' : '' ?>>
|
||
<td class="td-mono text-sm"><?= $h($b['buchungs_datum']) ?></td>
|
||
<td>
|
||
<?php if ($b['beleg_id']): ?>
|
||
<a href="/belege/<?= (int)$b['beleg_id'] ?>"><?= $h($b['beleg_nr'] ?? '#' . $b['beleg_id']) ?></a>
|
||
<?php else: ?>
|
||
<span class="text-muted">–</span>
|
||
<?php endif; ?>
|
||
</td>
|
||
<td><?= $h($b['buchungstext']) ?></td>
|
||
<td class="text-sm text-muted">
|
||
<?= $h($b['zahlungs_nr']) ?> <?= $h($b['zahlungs_name']) ?>
|
||
</td>
|
||
<td class="td-right td-mono"><?= $fmt($netto) ?></td>
|
||
<td class="td-right td-mono"><?= $fmt($ust) ?></td>
|
||
<td class="td-right td-mono"><?= $fmt($brutto) ?></td>
|
||
<td class="td-mono text-sm">
|
||
<?php if (!empty($b['anlage_nr'])): ?>
|
||
<a href="/assets/<?= (int)$b['asset_id'] ?>/edit" title="<?= $h($b['anlage_bezeichnung']) ?>"><?= $h($b['anlage_nr']) ?></a>
|
||
<?php elseif (!empty($b['anlage_bezeichnung'])): ?>
|
||
<a href="/assets/<?= (int)$b['asset_id'] ?>/edit"><?= $h($b['anlage_bezeichnung']) ?></a>
|
||
<?php else: ?>
|
||
<span class="text-muted">–</span>
|
||
<?php endif; ?>
|
||
</td>
|
||
</tr>
|
||
<?php endforeach; ?>
|
||
</tbody>
|
||
<tfoot>
|
||
<tr style="font-weight:700;border-top:2px solid #000">
|
||
<td colspan="5">Summe (<?= count($bookings) ?> Buchungen)</td>
|
||
<td class="td-right td-mono"><?= $fmt($sumNetto) ?></td>
|
||
<td class="td-right td-mono"><?= $fmt($sumUst) ?></td>
|
||
<td class="td-right td-mono"><?= $fmt($sumBrutto) ?></td>
|
||
</tr>
|
||
</tfoot>
|
||
</table>
|
||
</div>
|
||
<?php endif; ?>
|
||
</div>
|