fix for the cost button in the damaged items cost
Release Inventarsystem / release-docker (push) Successful in 2m16s
Release Inventarsystem / release-docker (push) Successful in 2m16s
This commit is contained in:
@@ -542,7 +542,7 @@
|
||||
const itemName = row.dataset.itemName || '';
|
||||
const borrower = row.dataset.userName || '';
|
||||
const itemCode = row.dataset.itemCode || '';
|
||||
const itemCost = row.dataset.itemCost || '';
|
||||
const itemCost = row.dataset.acquisition_costs || '';
|
||||
|
||||
form.action = "{{ url_for('admin_create_invoice', borrow_id='__BORROW_ID__') }}".replace('__BORROW_ID__', borrowId);
|
||||
|
||||
@@ -555,7 +555,7 @@
|
||||
|
||||
// Original-Preis im Button als data-Attribut hinterlegen
|
||||
if (replaceBtn) {
|
||||
replaceBtn.dataset.price = String(itemCost).replace(' EUR', '').trim();
|
||||
replaceBtn.dataset.acquisition_costs = String(itemCost).replace(' EUR', '').trim();
|
||||
}
|
||||
|
||||
inputReason.value = description || `Schaden gemeldet für ${itemName}`;
|
||||
@@ -574,8 +574,8 @@
|
||||
// Event-Listener für den Ersetzen-Button
|
||||
if (damageInvoiceReplaceBtn) {
|
||||
damageInvoiceReplaceBtn.addEventListener('click', function() {
|
||||
if (this.dataset.price) {
|
||||
damageInvoiceAmount.value = this.dataset.price;
|
||||
if (this.dataset.acquisition_costs) {
|
||||
damageInvoiceAmount.value = this.dataset.acquisition_costs;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user