Direct payments for invoices

Events can be moved to archive and moved back
Fixed validation
This commit is contained in:
2026-05-12 16:04:15 +02:00
parent e2fb616565
commit 0cf9602958
42 changed files with 851 additions and 132 deletions
@@ -0,0 +1,76 @@
<script setup>
import { ref } from 'vue';
import AppLayout from "../../../../resources/js/layouts/AppLayout.vue";
import ShadowedBox from "../../../Views/Components/ShadowedBox.vue";
import { toast } from 'vue3-toastify';
import axios from 'axios';
const props = defineProps({
events: Array,
});
const events = ref([...props.events]);
async function unarchiveEvent(eventId) {
try {
const response = await axios.post(`/api/v1/event/details/${eventId}/unarchive`);
if (response.data.status === 'success') {
events.value = events.value.filter(e => e.id !== eventId);
toast.success('Veranstaltung wurde aus dem Archiv geholt.');
} else {
toast.error('Fehler beim Wiederherstellen der Veranstaltung.');
}
} catch {
toast.error('Ein unerwarteter Fehler ist aufgetreten.');
}
}
</script>
<template>
<AppLayout title="Archivierte Veranstaltungen">
<div style="width: 95%; margin: 20px auto;">
<h1 style="font-size: 1.5rem; font-weight: 700; margin-bottom: 20px;">Archivierte Veranstaltungen</h1>
<div
v-if="events.length === 0"
style="text-align: center; color: #6b7280; padding: 40px 0;"
>
Es sind keine archivierten Veranstaltungen vorhanden.
</div>
<ShadowedBox
v-for="event in events"
:key="event.id"
style="padding: 20px; margin-bottom: 16px;"
>
<div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;">
<div>
<h2 style="margin: 0 0 4px 0; font-size: 1.1rem; font-weight: 600;">{{ event.name }}</h2>
<span style="color: #6b7280; font-size: 0.875rem;">
{{ event.postalCode }} {{ event.location }}
&nbsp;·&nbsp;
{{ event.eventBegin }} {{ event.eventEnd }}
</span>
</div>
<button
@click="unarchiveEvent(event.id)"
style="
padding: 8px 20px;
background-color: #f59e0b;
color: white;
border: none;
border-radius: 8px;
font-weight: 600;
font-size: 0.9rem;
cursor: pointer;
white-space: nowrap;
"
>
Aus dem Archiv holen
</button>
</div>
</ShadowedBox>
</div>
</AppLayout>
</template>
@@ -56,6 +56,16 @@
mailCompose.value = true
}
async function archiveEvent() {
const response = await fetch("/api/v1/event/details/" + props.data.event.identifier + "/archive" );
const data = await response.json();
if (data.status === 'success') {
toast.success(data.message)
} else {
toast.error(data.message)
}
}
async function sendPaymentReminder() {
toast.info("Die Nachrichten werden gesendet. Bitte verlasse diese Seite nicht.");
const response = await fetch("/api/v1/event/" + props.data.event.identifier + "/send-payment-reminder/" );
@@ -150,6 +160,7 @@
<label style="font-size: 9pt;" class="link" @click="showEventManagement">Veranstaltungsleitung</label> &nbsp;
<label style="font-size: 9pt;" class="link" @click="showParticipationFees">Teilnahmegebühren</label>
<a style="font-size: 9pt;" class="link" :href="'/cost-unit/' + props.data.event.costUnit.id">Ausgabenübersicht</a>
<a v-if="!dynamicProps.event.registrationAllowed && !dynamicProps.event.archived" style="color: #ff0000; font-size: 9pt;" class="link" @click="archiveEvent">Archivieren</a>
</div>
</div>