Feature: Gebuchte Bankbuchungen verlinken auf Beleg; Belegnummer in Statuszeile
This commit is contained in:
parent
aa0dd01e66
commit
d7cc7c2661
2 changed files with 10 additions and 2 deletions
|
|
@ -50,10 +50,12 @@ class BankTransaction
|
||||||
)['n'] ?? 0);
|
)['n'] ?? 0);
|
||||||
|
|
||||||
$rows = Database::fetchAll(
|
$rows = Database::fetchAll(
|
||||||
"SELECT bt.*, bib.filename AS batch_filename, bif.name AS format_name
|
"SELECT bt.*, bib.filename AS batch_filename, bif.name AS format_name,
|
||||||
|
b.id AS beleg_id, b.beleg_nr
|
||||||
FROM bank_transactions bt
|
FROM bank_transactions bt
|
||||||
JOIN bank_import_batches bib ON bt.batch_id = bib.id
|
JOIN bank_import_batches bib ON bt.batch_id = bib.id
|
||||||
JOIN bank_import_formats bif ON bib.format_id = bif.id
|
JOIN bank_import_formats bif ON bib.format_id = bif.id
|
||||||
|
LEFT JOIN belege b ON b.id = bt.beleg_id
|
||||||
WHERE $whereStr
|
WHERE $whereStr
|
||||||
ORDER BY bt.wertstellung DESC, bt.id DESC
|
ORDER BY bt.wertstellung DESC, bt.id DESC
|
||||||
LIMIT ? OFFSET ?",
|
LIMIT ? OFFSET ?",
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,11 @@ $months = ['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','D
|
||||||
$wert = (float)$row['wert'];
|
$wert = (float)$row['wert'];
|
||||||
$isPlus = $wert >= 0;
|
$isPlus = $wert >= 0;
|
||||||
$color = $isPlus ? 'var(--color-success)' : 'var(--color-danger)';
|
$color = $isPlus ? 'var(--color-success)' : 'var(--color-danger)';
|
||||||
|
$ziel = ($row['status'] === 'gebucht' && !empty($row['beleg_id']))
|
||||||
|
? '/belege/' . (int)$row['beleg_id']
|
||||||
|
: '/bank/' . (int)$row['id'];
|
||||||
?>
|
?>
|
||||||
<tr style="cursor:pointer" onclick="window.location='/bank/<?= (int)$row['id'] ?>'">
|
<tr style="cursor:pointer" onclick="window.location='<?= $ziel ?>'">
|
||||||
<td class="td-mono"><?= $h(View::formatDate($row['wertstellung'])) ?></td>
|
<td class="td-mono"><?= $h(View::formatDate($row['wertstellung'])) ?></td>
|
||||||
<td>
|
<td>
|
||||||
<div><?= $h($row['buchungstext']) ?></div>
|
<div><?= $h($row['buchungstext']) ?></div>
|
||||||
|
|
@ -103,6 +106,9 @@ $months = ['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','D
|
||||||
};
|
};
|
||||||
?>
|
?>
|
||||||
<span class="badge <?= $badgeClass ?>"><?= $h(ucfirst($row['status'])) ?></span>
|
<span class="badge <?= $badgeClass ?>"><?= $h(ucfirst($row['status'])) ?></span>
|
||||||
|
<?php if ($row['status'] === 'gebucht' && !empty($row['beleg_nr'])): ?>
|
||||||
|
<div class="text-muted text-sm" style="margin-top:.25rem"><?= $h($row['beleg_nr']) ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td onclick="event.stopPropagation()">
|
<td onclick="event.stopPropagation()">
|
||||||
<?php if ($row['status'] !== 'ignoriert'): ?>
|
<?php if ($row['status'] !== 'ignoriert'): ?>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue