Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fcabc8638 |
+1
-1
@@ -3157,7 +3157,7 @@ def library_loans_admin():
|
|||||||
'damage_text': (damage_reports[0].get('description', '') if damage_reports else ''),
|
'damage_text': (damage_reports[0].get('description', '') if damage_reports else ''),
|
||||||
'available': bool(item_doc.get('Verfuegbar', False)),
|
'available': bool(item_doc.get('Verfuegbar', False)),
|
||||||
'last_updated': fmt_dt(item_doc.get('LastUpdated')),
|
'last_updated': fmt_dt(item_doc.get('LastUpdated')),
|
||||||
'acquisition_costs': fmt_money(item_doc.get('Anschaffungskosten'))
|
'acquisition_costs': item_doc.get('Anschaffungskosten', "")
|
||||||
})
|
})
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
|
|||||||
@@ -520,7 +520,16 @@
|
|||||||
window.openDamageReportPrompt = openDamageReportPrompt;
|
window.openDamageReportPrompt = openDamageReportPrompt;
|
||||||
|
|
||||||
function openDamageInvoiceModal(row, description) {
|
function openDamageInvoiceModal(row, description) {
|
||||||
if (!damageInvoiceModal || !damageInvoiceForm) {
|
const modal = document.getElementById('damage-invoice-modal');
|
||||||
|
const form = document.getElementById('damage-invoice-form');
|
||||||
|
const inputItem = document.getElementById('damage-invoice-item');
|
||||||
|
const inputBorrower = document.getElementById('damage-invoice-borrower');
|
||||||
|
const inputCode = document.getElementById('damage-invoice-code');
|
||||||
|
const inputAmount = document.getElementById('damage-invoice-amount');
|
||||||
|
const inputReason = document.getElementById('damage-invoice-reason');
|
||||||
|
|
||||||
|
if (!modal || !form) {
|
||||||
|
console.error("Modal oder Formular nicht gefunden.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,25 +539,29 @@
|
|||||||
const itemCode = row.dataset.itemCode || '';
|
const itemCode = row.dataset.itemCode || '';
|
||||||
const itemCost = row.dataset.itemCost || '';
|
const itemCost = row.dataset.itemCost || '';
|
||||||
|
|
||||||
document.getElementById("damage-invoice-amount").value = "{{ item.acquisition_costs }}";
|
form.action = "{{ url_for('admin_create_invoice', borrow_id='__BORROW_ID__') }}".replace('__BORROW_ID__', borrowId);
|
||||||
|
|
||||||
damageInvoiceForm.action = "{{ url_for('admin_create_invoice', borrow_id='__BORROW_ID__') }}".replace('__BORROW_ID__', borrowId);
|
inputItem.value = itemName;
|
||||||
damageInvoiceItem.value = itemName;
|
inputBorrower.value = borrower;
|
||||||
damageInvoiceBorrower.value = borrower;
|
inputCode.value = itemCode;
|
||||||
damageInvoiceCode.value = itemCode;
|
|
||||||
damageInvoiceAmount.value = String(itemCost).replace(' EUR', '').trim();
|
inputAmount.value = String(itemCost).replace(' EUR', '').trim();
|
||||||
damageInvoiceReason.value = description || `Schaden gemeldet für ${itemName}`;
|
|
||||||
damageInvoiceModal.style.display = 'block';
|
inputReason.value = description || `Schaden gemeldet für ${itemName}`;
|
||||||
damageInvoiceAmount.focus();
|
|
||||||
|
modal.style.display = 'block';
|
||||||
|
inputAmount.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeDamageInvoiceModal() {
|
||||||
|
const modal = document.getElementById('damage-invoice-modal');
|
||||||
|
if (modal) {
|
||||||
|
modal.style.display = 'none';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.openDamageInvoiceModal = openDamageInvoiceModal;
|
window.openDamageInvoiceModal = openDamageInvoiceModal;
|
||||||
|
window.closeDamageInvoiceModal = closeDamageInvoiceModal;
|
||||||
function closeDamageInvoiceModal() {
|
|
||||||
if (damageInvoiceModal) {
|
|
||||||
damageInvoiceModal.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (damageInvoiceModal) {
|
if (damageInvoiceModal) {
|
||||||
damageInvoiceModal.addEventListener('click', function(event) {
|
damageInvoiceModal.addEventListener('click', function(event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user