diff --git a/app/Domains/Event/Views/Partials/BankStatementImport.vue b/app/Domains/Event/Views/Partials/BankStatementImport.vue index b5f391e..eb7d861 100644 --- a/app/Domains/Event/Views/Partials/BankStatementImport.vue +++ b/app/Domains/Event/Views/Partials/BankStatementImport.vue @@ -4,6 +4,7 @@ import {toast} from 'vue3-toastify' import FullScreenModal from "../../../../Views/Components/FullScreenModal.vue"; import LoadingModal from "../../../../Views/Components/LoadingModal.vue"; import Icon from "../../../../Views/Components/Icon.vue"; +import RichSelectBox from "../../../../Views/Components/RichSelectBox.vue"; import {useAjax} from "../../../../../resources/js/components/ajaxHandler.js"; /** @@ -41,6 +42,39 @@ const participantsByIdentifier = computed( () => Object.fromEntries(participants.value.map(participant => [participant.identifier, participant])), ) +/** + * Die Auswahlliste für alle Zeilen -- einmal gebaut, nicht je Zeile. + * + * Getrennt nach an- und abgemeldet, weil die Entscheidung unterschiedlich weit trägt: Eine Buchung + * auf eine abgemeldete Anmeldung zieht eine Erstattung nach sich. Als Fließtext in einer Zeile ging + * das unter, als Gruppenüberschrift steht es da. + */ +const participantOptions = computed(() => { + const options = [{value: '', label: '— ignorieren —'}] + + for (const participant of participants.value) { + const state = participant.isSettled ? 'vollständig bezahlt' : participant.amountOpen + ' offen' + + options.push(participant.isSignedOff + ? { + value: participant.identifier, + label: participant.name, + description: 'abgemeldet am ' + participant.signedOffAt + ' · ' + state, + group: 'Abgemeldete Teilis', + icon: 'user-slash', + muted: true, + } + : { + value: participant.identifier, + label: participant.name, + description: state, + group: 'Angemeldete Teilis', + }) + } + + return options +}) + function isAssigned(row) { return (assignment.value[row.rowNumber] ?? '') !== '' } @@ -140,16 +174,6 @@ function reset() { if (fileInput.value) fileInput.value.value = '' } -function optionLabel(participant) { - const state = participant.isSettled - ? 'vollständig bezahlt' - : participant.amountOpen + ' offen' - - return participant.isSignedOff - ? participant.name + ' — abgemeldet, ' + state - : participant.name + ' — ' + state -} - function assignedParticipant(row) { return participantsByIdentifier.value[assignment.value[row.rowNumber]] ?? null } @@ -257,13 +281,10 @@ function signedOffOf(row) {