diff --git a/src/Controllers/BelegController.php b/src/Controllers/BelegController.php index 8a4448d..9a70468 100644 --- a/src/Controllers/BelegController.php +++ b/src/Controllers/BelegController.php @@ -7,6 +7,7 @@ namespace Steuerkram\Controllers; use Steuerkram\Models\Beleg; use Steuerkram\Models\Booking; use Steuerkram\Models\Account; +use Steuerkram\Models\Asset; use Steuerkram\Models\Supplier; use Steuerkram\Config; use Steuerkram\View; @@ -198,6 +199,7 @@ class BelegController $integrity = Beleg::verifyIntegrity((int)$params['id']); $accounts = Account::all(['aktiv' => 1]); $suppliers = Supplier::all(); + $assets = Asset::all(); $svc = new KontierungsvorschlagService(); $kiAktiv = $svc->isEnabled(); @@ -214,6 +216,7 @@ class BelegController 'bookings' => $bookings, 'integrity' => $integrity, 'accounts' => $accounts, + 'assets' => $assets, 'kiAktiv' => $kiAktiv, 'kiVorschlag' => $kiVorschlag, ]), diff --git a/src/Views/belege/detail.php b/src/Views/belege/detail.php index a37633e..5fbab21 100644 --- a/src/Views/belege/detail.php +++ b/src/Views/belege/detail.php @@ -380,7 +380,7 @@ $suppliers = $suppliers ?? []; data-target="kategorie_konto_id" autocomplete="off" style="margin-bottom:.3rem" value=""> + @@ -488,6 +491,185 @@ $suppliers = $suppliers ?? []; + + + + [ + 'id' => (int)$a['id'], + 'lfd_nr' => (int)$a['lfd_nr'], + 'bezeichnung' => $a['bezeichnung'], + 'anschaffungsdatum' => $a['anschaffungsdatum'], + 'anschaffungskosten' => (float)$a['anschaffungskosten'], + 'account_id' => $a['account_id'] !== null ? (int)$a['account_id'] : null, +], $assets ?? []), JSON_HEX_TAG); +?> + + +