Operation processes on invoices

This commit is contained in:
2026-02-13 00:11:51 +01:00
parent 882752472e
commit fd403f8520
44 changed files with 1635 additions and 42 deletions

View File

@@ -46,7 +46,7 @@ const costUnit = ref(null)
const { data, loading, error, request, download } = useAjax()
if (props.deep_jump_id > 0) {
open_invoice_list(props.deep_jump_id, 'new', props.deep_jump_id_sub)
// open_invoice_list(props.deep_jump_id, 'new', props.deep_jump_id_sub)
}
async function costUnitDetails(costUnitId) {
@@ -79,17 +79,8 @@ async function editTreasurers(costUnitId) {
}
}
async function open_invoice_list(cost_unit_id, endpoint, invoice_id) {
const url = '' // `/wp-json/mareike/invoices/list-${endpoint}?invoice_id=${invoice_id}&cost_unit_id=${cost_unit_id}
try {
const response = await fetch(url, { method: 'GET' })
if (!response.ok) throw new Error('Fehler beim Laden')
invoices.value = await response.json()
current_cost_unit.value = cost_unit_id
invoice_id = invoice_id
showInvoiceList.value = true
} catch (err) {
}
function loadInvoices(cost_unit_id) {
window.location.href = '/cost-unit/' + cost_unit_id;
}
async function denyNewRequests(costUnitId) {
@@ -182,7 +173,7 @@ async function export_payouts(cost_unit_id) {
<th>Unbearbeitet</th>
<td>{{ costUnit.countNewInvoices }}</td>
<td rowspan="4" style="vertical-align: top;">
<input v-if="!costUnit.archived" type="button" value="Abrechnungen bearbeiten" />
<input v-if="!costUnit.archived" type="button" value="Abrechnungen bearbeiten" @click="loadInvoices(costUnit.id)" />
<input v-else type="button" value="Abrechnungen einsehen" />
<br />
<input v-if="!costUnit.archived" type="button" value="Genehmigte Abrechnungen exportieren" style="margin-top: 10px;" />