From 3068f445633473a6309ca1723e8459b5d784695f Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Mon, 27 Jul 2026 20:16:53 +0200 Subject: [PATCH] implementet automatic including of the price --- Web/app.py | 1 + Web/templates/library_borrowings_admin.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Web/app.py b/Web/app.py index f0179cf..a90c332 100755 --- a/Web/app.py +++ b/Web/app.py @@ -3157,6 +3157,7 @@ def library_loans_admin(): 'damage_text': (damage_reports[0].get('description', '') if damage_reports else ''), 'available': bool(item_doc.get('Verfuegbar', False)), 'last_updated': fmt_dt(item_doc.get('LastUpdated')), + 'acquisition_costs': fmt_money(item_doc.get('Anschaffungskosten')) }) return render_template( diff --git a/Web/templates/library_borrowings_admin.html b/Web/templates/library_borrowings_admin.html index 719f51d..4fdb2b2 100644 --- a/Web/templates/library_borrowings_admin.html +++ b/Web/templates/library_borrowings_admin.html @@ -530,6 +530,8 @@ const itemCode = row.dataset.itemCode || ''; const itemCost = row.dataset.itemCost || ''; + document.getElementById("damage-invoice-amount").value = "{{ item.acquisition_costs }}"; + damageInvoiceForm.action = "{{ url_for('admin_create_invoice', borrow_id='__BORROW_ID__') }}".replace('__BORROW_ID__', borrowId); damageInvoiceItem.value = itemName; damageInvoiceBorrower.value = borrower;