From 93d6aacbaef1a236051142eb27cf65fffb83dbce Mon Sep 17 00:00:00 2001 From: fds2610-bot Date: Fri, 15 May 2026 20:47:17 +0200 Subject: [PATCH] Feature: Lieferantenname im Buchungsjournal unter Belegnr. anzeigen und in Suche einbeziehen --- src/Models/Booking.php | 9 +++++++-- src/Views/bookings/journal.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Models/Booking.php b/src/Models/Booking.php index 522beb1..5b18989 100644 --- a/src/Models/Booking.php +++ b/src/Models/Booking.php @@ -44,7 +44,8 @@ class Booking $params[] = (int)$filter['konto']; } if (!empty($filter['search'])) { - $where[] = 'bk.buchungstext LIKE ?'; + $where[] = '(bk.buchungstext LIKE ? OR s.name LIKE ?)'; + $params[] = '%' . $filter['search'] . '%'; $params[] = '%' . $filter['search'] . '%'; } @@ -53,13 +54,15 @@ class Booking k.kontonummer as kategorie_nr, k.bezeichnung as kategorie_name, z.kontonummer as zahlungs_nr, z.bezeichnung as zahlungs_name, bl.beleg_nr, fy.year as fiscal_year_nr, - a.anlage_nr, a.bezeichnung as anlage_bezeichnung + a.anlage_nr, a.bezeichnung as anlage_bezeichnung, + s.name as supplier_name FROM bookings bk JOIN accounts k ON bk.kategorie_konto_id = k.id JOIN accounts z ON bk.zahlungskonto_id = z.id JOIN belege bl ON bk.beleg_id = bl.id JOIN fiscal_years fy ON bk.fiscal_year_id = fy.id LEFT JOIN assets a ON bk.asset_id = a.id + LEFT JOIN suppliers s ON bl.supplier_id = s.id WHERE ' . implode(' AND ', $where) . ' ORDER BY bk.buchungs_datum DESC, bk.id DESC LIMIT ? OFFSET ?'; @@ -71,6 +74,8 @@ class Booking $countSql = 'SELECT COUNT(*) as cnt FROM bookings bk JOIN fiscal_years fy ON bk.fiscal_year_id = fy.id + JOIN belege bl ON bk.beleg_id = bl.id + LEFT JOIN suppliers s ON bl.supplier_id = s.id WHERE ' . implode(' AND ', $where); $countParams = array_slice($params, 0, -2); $total = (int)(Database::fetchOne($countSql, $countParams)['cnt'] ?? 0); diff --git a/src/Views/bookings/journal.php b/src/Views/bookings/journal.php index 47673f5..34d3c91 100644 --- a/src/Views/bookings/journal.php +++ b/src/Views/bookings/journal.php @@ -3,7 +3,7 @@
-