Compare commits
30
Commits
5beb2b1d97
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e9ea0cfd5 | ||
|
|
bcebe2ebed | ||
|
|
a43fd9cedf | ||
|
|
a5e4e55df5 | ||
|
|
c4ca101594 | ||
|
|
985c9ce07e | ||
|
|
790e8e1dbc | ||
|
|
ef6284d5cc | ||
|
|
328825293a | ||
|
|
4e981c140b | ||
|
|
8940cb275b | ||
|
|
b668c7e805 | ||
|
|
ddfaab1501 | ||
|
|
70a57d10f5 | ||
|
|
6301c342e4 | ||
|
|
025035190d | ||
|
|
651b6147bf | ||
|
|
ae13841699 | ||
|
|
91dca31c11 | ||
|
|
40d5634764 | ||
|
|
350c8dd0d0 | ||
|
|
d07980dd1f | ||
|
|
b9795f08f0 | ||
|
|
e730d6db63 | ||
|
|
a6bddf9fa5 | ||
|
|
749d8588da | ||
|
|
4bb64b0053 | ||
|
|
d23e6c3914 | ||
|
|
15690b1da9 | ||
|
|
c1c1a4f143 |
No files matched your search
@@ -16,6 +16,32 @@ Routing, Mails) stehen in `.ai/conventions.md` und werden hier eingebunden — *
|
|||||||
- [Zahlungsmodule](app/EventPaymentModules/CLAUDE.md) — interface-gesteuerte Zahlungsarten (Optionen, Config,
|
- [Zahlungsmodule](app/EventPaymentModules/CLAUDE.md) — interface-gesteuerte Zahlungsarten (Optionen, Config,
|
||||||
Anmelde-Zusammenfassung, GiroCode/Fähigkeits-Interfaces, neues Modul hinzufügen).
|
Anmelde-Zusammenfassung, GiroCode/Fähigkeits-Interfaces, neues Modul hinzufügen).
|
||||||
|
|
||||||
|
## Local Group / Parent Group (Stamm / Bund)
|
||||||
|
|
||||||
|
Technisch heißt es **Local Group** (Mandant/Tenant) und **Parent Group** (übergeordnete Gruppe); „Stamm"/„Bund" sind nur
|
||||||
|
UI-Bezeichnungen.
|
||||||
|
|
||||||
|
- **ParentGroup** (`App\Models\ParentGroup`, Tabelle `parent_groups`, app-weit): `tenants.parent_group_id` ist Pflicht
|
||||||
|
(n:1). `is_fallback` markiert „Ohne Zuordnung" — `Tenant::booted()` setzt sie, wenn nichts angegeben ist; sie ist nie
|
||||||
|
löschbar. Andere nur, solange weder Tenant noch Anmeldung sie nutzt (`AdminParentGroupRepository::isInUse()`).
|
||||||
|
Verwaltung LV-only unter `/admin/parent-groups`; Zuordnung am Tenant im Tab „Allgemeines" und bei der Anlage.
|
||||||
|
- **Event**: `participant_group_type` (Enum `App\Enumerations\ParticipantGroupType`: `local_group` | `parent_group`),
|
||||||
|
gewählt bei der Anlage, in den Einstellungen änderbar nur ohne Anmeldungen. **Einzige Quelle für die Auswahl**:
|
||||||
|
`Event::participantGroupOptions()` — teilnehmende Stämme oder deren Bünde (distinct). Gespeichert wird
|
||||||
|
`event_participants.local_group` (Slug) **oder** `event_participants.parent_group_id`.
|
||||||
|
- **Anzeige**: `EventParticipant::participantGroupName()` → Resource-Feld `participantGroup`; `EventResource` liefert
|
||||||
|
`participantGroupType`, `participantGroupLabel`, `participantGroupOptions` (`{id, name, value}`).
|
||||||
|
- **Bezeichnungen** in `global_settings` (Model `GlobalSetting`, Repository `GlobalSettingRepository`, im Container
|
||||||
|
`scoped` — immer über `app(...)` beziehen), Singular + Plural je Ebene, gepflegt von Hauptadmins unter
|
||||||
|
`/admin/settings`. Gelesen über `ParticipantGroupType::label()/pluralLabel()/labels()`. Texte ohne Artikel formulieren
|
||||||
|
(„Bitte bei „{label}" eine Auswahl treffen."), weil der Artikel vom Wort abhängt.
|
||||||
|
|
||||||
|
## eFZ-Prüfung pro Veranstaltung
|
||||||
|
|
||||||
|
`events.coc_check_required` (Default `true`, Checkbox in `CommonSettings.vue`, Resource-Feld `cocCheckRequired`). Ist
|
||||||
|
sie aus, liefert `CertificateOfConductionCheckCommand` ohne API-Aufruf `not_required`, und `SignUpCommand` belegt
|
||||||
|
`efz_status` mit `not_required` vor. Wirkt nur auf neue Anmeldungen, bestehende Status bleiben.
|
||||||
|
|
||||||
## Umsatzsteuer / Steuerinformationen
|
## Umsatzsteuer / Steuerinformationen
|
||||||
|
|
||||||
Rechtlich korrekter Begriff ist **Umsatzsteuer (USt)**, nicht MwSt. Ziel: tagesbasierte Anmelde-Rechnungen („Teilnahme
|
Rechtlich korrekter Begriff ist **Umsatzsteuer (USt)**, nicht MwSt. Ziel: tagesbasierte Anmelde-Rechnungen („Teilnahme
|
||||||
|
|||||||
+29010
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\CreateParentGroup;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
|
||||||
|
class CreateParentGroupAction
|
||||||
|
{
|
||||||
|
public function __construct(private CreateParentGroupRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): CreateParentGroupResponse
|
||||||
|
{
|
||||||
|
$response = new CreateParentGroupResponse();
|
||||||
|
|
||||||
|
$name = trim($this->request->name);
|
||||||
|
|
||||||
|
if ($name === '') {
|
||||||
|
$response->message = 'Bitte einen Namen angeben.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response->parentGroup = ParentGroup::create([
|
||||||
|
'name' => $name,
|
||||||
|
'is_fallback' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->message = sprintf('%s „%s" wurde angelegt.', ParticipantGroupType::ParentGroup->label(), $name);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\CreateParentGroup;
|
||||||
|
|
||||||
|
class CreateParentGroupRequest
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public string $name,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\CreateParentGroup;
|
||||||
|
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
|
||||||
|
class CreateParentGroupResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
public string $message = '';
|
||||||
|
public ?ParentGroup $parentGroup = null;
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Admin\Actions\CreateTenant;
|
namespace App\Domains\Admin\Actions\CreateTenant;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Models\AvailablePaymentMethod;
|
use App\Models\AvailablePaymentMethod;
|
||||||
use App\Models\PaymentMethod;
|
use App\Models\PaymentMethod;
|
||||||
use App\Models\Tenant;
|
use App\Models\Tenant;
|
||||||
@@ -16,10 +17,17 @@ class CreateTenantAction
|
|||||||
{
|
{
|
||||||
$response = new CreateTenantResponse();
|
$response = new CreateTenantResponse();
|
||||||
|
|
||||||
|
if ($this->request->parentGroup === null) {
|
||||||
|
$response->message = sprintf('Bitte bei „%s" eine Auswahl treffen.', ParticipantGroupType::ParentGroup->label());
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
$tenant = Tenant::create([
|
$tenant = Tenant::create([
|
||||||
'name' => $this->request->name,
|
'name' => $this->request->name,
|
||||||
'slug' => $this->request->slug,
|
'slug' => $this->request->slug,
|
||||||
'url' => $this->request->url,
|
'url' => $this->request->url,
|
||||||
|
'parent_group_id' => $this->request->parentGroup->id,
|
||||||
'email' => '',
|
'email' => '',
|
||||||
'email_finance' => '',
|
'email_finance' => '',
|
||||||
'account_name' => '',
|
'account_name' => '',
|
||||||
@@ -46,7 +54,7 @@ class CreateTenantAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
$response->success = true;
|
$response->success = true;
|
||||||
$response->message = 'Stamm wurde angelegt.';
|
$response->message = sprintf('%s wurde angelegt.', ParticipantGroupType::LocalGroup->label());
|
||||||
$response->slug = $tenant->slug;
|
$response->slug = $tenant->slug;
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
|||||||
@@ -2,12 +2,16 @@
|
|||||||
|
|
||||||
namespace App\Domains\Admin\Actions\CreateTenant;
|
namespace App\Domains\Admin\Actions\CreateTenant;
|
||||||
|
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
|
||||||
class CreateTenantRequest
|
class CreateTenantRequest
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public string $name,
|
public string $name,
|
||||||
public string $slug,
|
public string $slug,
|
||||||
public string $url,
|
public string $url,
|
||||||
|
/** Pflicht; null heißt, die übermittelte ID war unbekannt. */
|
||||||
|
public ?ParentGroup $parentGroup,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\DeleteParentGroup;
|
||||||
|
|
||||||
|
class DeleteParentGroupAction
|
||||||
|
{
|
||||||
|
public function __construct(private DeleteParentGroupRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): DeleteParentGroupResponse
|
||||||
|
{
|
||||||
|
$response = new DeleteParentGroupResponse();
|
||||||
|
|
||||||
|
// Die Fallback-Gruppe nimmt Mandanten ohne Zuordnung auf und muss deshalb bestehen bleiben.
|
||||||
|
if ($this->request->parentGroup->is_fallback) {
|
||||||
|
$response->message = sprintf('„%s" kann nicht gelöscht werden.', $this->request->parentGroup->name);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->request->inUse) {
|
||||||
|
$response->message = sprintf(
|
||||||
|
'„%s" ist noch zugeordnet und kann deshalb nicht gelöscht werden.',
|
||||||
|
$this->request->parentGroup->name,
|
||||||
|
);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->request->parentGroup->delete();
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->message = sprintf('„%s" wurde gelöscht.', $this->request->parentGroup->name);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\DeleteParentGroup;
|
||||||
|
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
|
||||||
|
class DeleteParentGroupRequest
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public ParentGroup $parentGroup,
|
||||||
|
/** Ob die Gruppe noch von einem Mandanten oder einer Anmeldung verwendet wird. */
|
||||||
|
public bool $inUse,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\DeleteParentGroup;
|
||||||
|
|
||||||
|
class DeleteParentGroupResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
public string $message = '';
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\RenameParentGroup;
|
||||||
|
|
||||||
|
class RenameParentGroupAction
|
||||||
|
{
|
||||||
|
public function __construct(private RenameParentGroupRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): RenameParentGroupResponse
|
||||||
|
{
|
||||||
|
$response = new RenameParentGroupResponse();
|
||||||
|
|
||||||
|
$name = trim($this->request->name);
|
||||||
|
|
||||||
|
if ($name === '') {
|
||||||
|
$response->message = 'Bitte einen Namen angeben.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Umbenennen ist jederzeit möglich: Mandanten und Anmeldungen verweisen über die ID.
|
||||||
|
$this->request->parentGroup->update(['name' => $name]);
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->message = 'Der Name wurde gespeichert.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\RenameParentGroup;
|
||||||
|
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
|
||||||
|
class RenameParentGroupRequest
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public ParentGroup $parentGroup,
|
||||||
|
public string $name,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\RenameParentGroup;
|
||||||
|
|
||||||
|
class RenameParentGroupResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
public string $message = '';
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\UpdateGlobalSettings;
|
||||||
|
|
||||||
|
use App\Models\GlobalSetting;
|
||||||
|
|
||||||
|
class UpdateGlobalSettingsAction
|
||||||
|
{
|
||||||
|
public function __construct(private UpdateGlobalSettingsRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): UpdateGlobalSettingsResponse
|
||||||
|
{
|
||||||
|
$response = new UpdateGlobalSettingsResponse();
|
||||||
|
|
||||||
|
$values = [
|
||||||
|
GlobalSetting::LOCAL_GROUP_LABEL => trim($this->request->localGroupLabel),
|
||||||
|
GlobalSetting::LOCAL_GROUP_LABEL_PLURAL => trim($this->request->localGroupLabelPlural),
|
||||||
|
GlobalSetting::PARENT_GROUP_LABEL => trim($this->request->parentGroupLabel),
|
||||||
|
GlobalSetting::PARENT_GROUP_LABEL_PLURAL => trim($this->request->parentGroupLabelPlural),
|
||||||
|
];
|
||||||
|
|
||||||
|
// Eine leere Bezeichnung ließe Überschriften und Auswahlfelder ohne Beschriftung zurück.
|
||||||
|
if (in_array('', $values, true)) {
|
||||||
|
$response->message = 'Bitte alle Bezeichnungen ausfüllen.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->request->globalSettings->setMany($values);
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->message = 'Einstellungen wurden gespeichert.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\UpdateGlobalSettings;
|
||||||
|
|
||||||
|
use App\Repositories\GlobalSettingRepository;
|
||||||
|
|
||||||
|
class UpdateGlobalSettingsRequest
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public GlobalSettingRepository $globalSettings,
|
||||||
|
public string $localGroupLabel,
|
||||||
|
public string $localGroupLabelPlural,
|
||||||
|
public string $parentGroupLabel,
|
||||||
|
public string $parentGroupLabelPlural,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Actions\UpdateGlobalSettings;
|
||||||
|
|
||||||
|
class UpdateGlobalSettingsResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
public string $message = '';
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Domains\Admin\Actions\UpdateTenantGeneral;
|
namespace App\Domains\Admin\Actions\UpdateTenantGeneral;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
|
|
||||||
class UpdateTenantGeneralAction
|
class UpdateTenantGeneralAction
|
||||||
{
|
{
|
||||||
public function __construct(private UpdateTenantGeneralRequest $request)
|
public function __construct(private UpdateTenantGeneralRequest $request)
|
||||||
@@ -12,10 +14,17 @@ class UpdateTenantGeneralAction
|
|||||||
{
|
{
|
||||||
$response = new UpdateTenantGeneralResponse();
|
$response = new UpdateTenantGeneralResponse();
|
||||||
|
|
||||||
|
if ($this->request->parentGroup === null) {
|
||||||
|
$response->message = sprintf('Bitte bei „%s" eine Auswahl treffen.', ParticipantGroupType::ParentGroup->label());
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
$this->request->tenant->update([
|
$this->request->tenant->update([
|
||||||
'name' => $this->request->name,
|
'name' => $this->request->name,
|
||||||
'slug' => $this->request->slug,
|
'slug' => $this->request->slug,
|
||||||
'url' => $this->request->url,
|
'url' => $this->request->url,
|
||||||
|
'parent_group_id' => $this->request->parentGroup->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response->success = true;
|
$response->success = true;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Admin\Actions\UpdateTenantGeneral;
|
namespace App\Domains\Admin\Actions\UpdateTenantGeneral;
|
||||||
|
|
||||||
|
use App\Models\ParentGroup;
|
||||||
use App\Models\Tenant;
|
use App\Models\Tenant;
|
||||||
|
|
||||||
class UpdateTenantGeneralRequest
|
class UpdateTenantGeneralRequest
|
||||||
@@ -11,6 +12,8 @@ class UpdateTenantGeneralRequest
|
|||||||
public string $name,
|
public string $name,
|
||||||
public string $slug,
|
public string $slug,
|
||||||
public string $url,
|
public string $url,
|
||||||
|
/** Pflicht; null heißt, die übermittelte ID war unbekannt. */
|
||||||
|
public ?ParentGroup $parentGroup,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class GlobalSettingsGetController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
return response()->json([
|
||||||
|
'groupLabels' => ParticipantGroupType::labels(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Providers\InertiaProvider;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Inertia\Response;
|
||||||
|
|
||||||
|
class GlobalSettingsPageController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(Request $request): Response
|
||||||
|
{
|
||||||
|
return new InertiaProvider('Admin/GlobalSettings', [])->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Admin\Actions\UpdateGlobalSettings\UpdateGlobalSettingsAction;
|
||||||
|
use App\Domains\Admin\Actions\UpdateGlobalSettings\UpdateGlobalSettingsRequest;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class GlobalSettingsUpdateController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$response = new UpdateGlobalSettingsAction(new UpdateGlobalSettingsRequest(
|
||||||
|
globalSettings: $this->globalSettings,
|
||||||
|
localGroupLabel: (string) $request->input('localGroup'),
|
||||||
|
localGroupLabelPlural: (string) $request->input('localGroupPlural'),
|
||||||
|
parentGroupLabel: (string) $request->input('parentGroup'),
|
||||||
|
parentGroupLabelPlural: (string) $request->input('parentGroupPlural'),
|
||||||
|
))->execute();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => $response->success ? 'success' : 'error',
|
||||||
|
'message' => $response->message,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Admin\Actions\CreateParentGroup\CreateParentGroupAction;
|
||||||
|
use App\Domains\Admin\Actions\CreateParentGroup\CreateParentGroupRequest;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ParentGroupCreateController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$response = new CreateParentGroupAction(new CreateParentGroupRequest(
|
||||||
|
name: (string) $request->input('name'),
|
||||||
|
))->execute();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => $response->success ? 'success' : 'error',
|
||||||
|
'message' => $response->message,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Admin\Actions\DeleteParentGroup\DeleteParentGroupAction;
|
||||||
|
use App\Domains\Admin\Actions\DeleteParentGroup\DeleteParentGroupRequest;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ParentGroupDeleteController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(int $id, Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$parentGroup = $this->adminParentGroups->findById($id);
|
||||||
|
|
||||||
|
if ($parentGroup === null) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => 'Eintrag nicht gefunden.'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = new DeleteParentGroupAction(new DeleteParentGroupRequest(
|
||||||
|
parentGroup: $parentGroup,
|
||||||
|
inUse: $this->adminParentGroups->isInUse($parentGroup),
|
||||||
|
))->execute();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => $response->success ? 'success' : 'error',
|
||||||
|
'message' => $response->message,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ParentGroupListApiController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$parentGroups = $this->adminParentGroups->all()->map(fn ($parentGroup) => [
|
||||||
|
'id' => $parentGroup->id,
|
||||||
|
'name' => $parentGroup->name,
|
||||||
|
'isFallback' => $parentGroup->is_fallback,
|
||||||
|
'tenantCount' => $parentGroup->tenants_count,
|
||||||
|
'deletable' => !$parentGroup->is_fallback && !$this->adminParentGroups->isInUse($parentGroup),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json(['parentGroups' => $parentGroups]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
|
use App\Providers\InertiaProvider;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Inertia\Response;
|
||||||
|
|
||||||
|
class ParentGroupListPageController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(Request $request): Response
|
||||||
|
{
|
||||||
|
return new InertiaProvider('Admin/ParentGroupList', [
|
||||||
|
'groupLabels' => ParticipantGroupType::labels(),
|
||||||
|
])->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Admin\Actions\RenameParentGroup\RenameParentGroupAction;
|
||||||
|
use App\Domains\Admin\Actions\RenameParentGroup\RenameParentGroupRequest;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ParentGroupUpdateController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(int $id, Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$parentGroup = $this->adminParentGroups->findById($id);
|
||||||
|
|
||||||
|
if ($parentGroup === null) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => 'Eintrag nicht gefunden.'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = new RenameParentGroupAction(new RenameParentGroupRequest(
|
||||||
|
parentGroup: $parentGroup,
|
||||||
|
name: (string) $request->input('name'),
|
||||||
|
))->execute();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => $response->success ? 'success' : 'error',
|
||||||
|
'message' => $response->message,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ class TenantCreateController extends CommonController
|
|||||||
name: $request->input('name'),
|
name: $request->input('name'),
|
||||||
slug: $request->input('slug'),
|
slug: $request->input('slug'),
|
||||||
url: $request->input('url'),
|
url: $request->input('url'),
|
||||||
|
parentGroup: $this->adminParentGroups->findById((int) $request->input('parent_group_id')),
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = $action->execute();
|
$response = $action->execute();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Admin\Controllers;
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Scopes\CommonController;
|
use App\Scopes\CommonController;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -17,6 +18,12 @@ class TenantGeneralGetController extends CommonController
|
|||||||
'slug' => $tenant->slug,
|
'slug' => $tenant->slug,
|
||||||
'url' => $tenant->url,
|
'url' => $tenant->url,
|
||||||
'is_active_local_group' => $tenant->is_active_local_group,
|
'is_active_local_group' => $tenant->is_active_local_group,
|
||||||
|
'parent_group_id' => $tenant->parent_group_id,
|
||||||
|
'parentGroups' => $this->adminParentGroups->all()->map(fn ($parentGroup) => [
|
||||||
|
'id' => $parentGroup->id,
|
||||||
|
'name' => $parentGroup->name,
|
||||||
|
]),
|
||||||
|
'parentGroupLabel' => ParticipantGroupType::ParentGroup->label(),
|
||||||
'saveEndpoint' => '/api/v1/admin/tenants/' . $slug . '/general',
|
'saveEndpoint' => '/api/v1/admin/tenants/' . $slug . '/general',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class TenantGeneralUpdateController extends CommonController
|
|||||||
name: $request->input('name'),
|
name: $request->input('name'),
|
||||||
slug: $request->input('slug'),
|
slug: $request->input('slug'),
|
||||||
url: $request->input('url'),
|
url: $request->input('url'),
|
||||||
|
parentGroup: $this->adminParentGroups->findById((int) $request->input('parent_group_id')),
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = $action->execute();
|
$response = $action->execute();
|
||||||
|
|||||||
@@ -18,9 +18,17 @@ class TenantListApiController extends CommonController
|
|||||||
'slug' => $tenant->slug,
|
'slug' => $tenant->slug,
|
||||||
'url' => $tenant->url,
|
'url' => $tenant->url,
|
||||||
'is_active_local_group' => $tenant->is_active_local_group,
|
'is_active_local_group' => $tenant->is_active_local_group,
|
||||||
|
'parentGroup' => $tenant->parentGroup?->name,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
return response()->json(['tenants' => $mapped]);
|
// Auswahl für das Anlage-Formular (Pflichtangabe).
|
||||||
|
$parentGroups = $this->adminParentGroups->all()->map(fn ($parentGroup) => [
|
||||||
|
'id' => $parentGroup->id,
|
||||||
|
'name' => $parentGroup->name,
|
||||||
|
'isFallback' => $parentGroup->is_fallback,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json(['tenants' => $mapped, 'parentGroups' => $parentGroups]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Admin\Controllers;
|
namespace App\Domains\Admin\Controllers;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Providers\InertiaProvider;
|
use App\Providers\InertiaProvider;
|
||||||
use App\Scopes\CommonController;
|
use App\Scopes\CommonController;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -11,7 +12,9 @@ class TenantListPageController extends CommonController
|
|||||||
{
|
{
|
||||||
public function __invoke(Request $request): Response
|
public function __invoke(Request $request): Response
|
||||||
{
|
{
|
||||||
$inertiaProvider = new InertiaProvider('Admin/TenantList', []);
|
$inertiaProvider = new InertiaProvider('Admin/TenantList', [
|
||||||
|
'groupLabels' => ParticipantGroupType::labels(),
|
||||||
|
]);
|
||||||
return $inertiaProvider->render();
|
return $inertiaProvider->render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@ namespace App\Domains\Admin\Controllers;
|
|||||||
use App\Models\AvailablePaymentMethod;
|
use App\Models\AvailablePaymentMethod;
|
||||||
use App\Resources\AvailablePaymentMethodResource;
|
use App\Resources\AvailablePaymentMethodResource;
|
||||||
use App\Scopes\CommonController;
|
use App\Scopes\CommonController;
|
||||||
|
use App\ValueObjects\BankStatementRuleset;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
@@ -16,6 +17,10 @@ class TenantPaymentMethodsGetController extends CommonController
|
|||||||
'paymentMethods' => AvailablePaymentMethod::all()
|
'paymentMethods' => AvailablePaymentMethod::all()
|
||||||
->map(fn (AvailablePaymentMethod $method) => new AvailablePaymentMethodResource($method)->toArray($request)),
|
->map(fn (AvailablePaymentMethod $method) => new AvailablePaymentMethodResource($method)->toArray($request)),
|
||||||
'saveEndpoint' => '/api/v1/admin/tenant/payment-methods',
|
'saveEndpoint' => '/api/v1/admin/tenant/payment-methods',
|
||||||
|
// Der app-weite Standard für das Kontoauszug-Format. Das Formular zeigt ihn als
|
||||||
|
// Vorbelegung an, damit erkennbar ist, wovon ein Override abweicht.
|
||||||
|
'statementRulesetDefault' => BankStatementRuleset::default()->toArray(),
|
||||||
|
'statementRulesetCharsets' => BankStatementRuleset::CHARSETS,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ class UserDetailGetController extends CommonController
|
|||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'user' => $userData,
|
'user' => $userData,
|
||||||
'isOwnUser' => auth()->id() === $user->id,
|
'isOwnUser' => currentUser()?->id === $user->id,
|
||||||
'isLvTenant' => $this->tenant->slug === 'lv',
|
'isLvTenant' => $this->tenant->slug === 'lv',
|
||||||
'userRoles' => UserRole::all()->map(fn($role) => ['slug' => $role->slug, 'name' => $role->name]),
|
'userRoles' => UserRole::all()->map(fn($role) => ['slug' => $role->slug, 'name' => $role->name]),
|
||||||
'localGroups' => $this->adminTenants->getActiveLocalGroups()->map(fn($t) => ['slug' => $t->slug, 'name' => $t->name]),
|
'localGroups' => $this->adminTenants->getActiveLocalGroups()->map(fn($t) => ['slug' => $t->slug, 'name' => $t->name]),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class UserToggleActiveController extends CommonController
|
|||||||
|
|
||||||
$action = new ToggleUserActiveAction(new ToggleUserActiveRequest(
|
$action = new ToggleUserActiveAction(new ToggleUserActiveRequest(
|
||||||
user: $user,
|
user: $user,
|
||||||
currentUserId: auth()->id(),
|
currentUserId: currentUser()?->id,
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = $action->execute();
|
$response = $action->execute();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class UserUpdateController extends CommonController
|
|||||||
$action = new UpdateUserAction(new UpdateUserRequest(
|
$action = new UpdateUserAction(new UpdateUserRequest(
|
||||||
user: $user,
|
user: $user,
|
||||||
data: $request->all(),
|
data: $request->all(),
|
||||||
isOwnUser: auth()->id() === $user->id,
|
isOwnUser: currentUser()?->id === $user->id,
|
||||||
isLvTenant: $this->tenant->slug === 'lv',
|
isLvTenant: $this->tenant->slug === 'lv',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Admin\Repositories;
|
||||||
|
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
|
||||||
|
class AdminParentGroupRepository
|
||||||
|
{
|
||||||
|
/** Alle Parent Groups, alphabetisch mit „Ohne Zuordnung" am Ende, mit der Zahl zugeordneter Mandanten. */
|
||||||
|
public function all(): Collection
|
||||||
|
{
|
||||||
|
return ParentGroup::withCount('tenants')
|
||||||
|
->ordered()
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findById(int $id): ?ParentGroup
|
||||||
|
{
|
||||||
|
return ParentGroup::find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ob die Parent Group noch verwendet wird -- von einem Mandanten oder von einer Anmeldung. Anmeldungen sind
|
||||||
|
* mandantengebunden; gezählt wird hier bewusst über alle Mandanten hinweg.
|
||||||
|
*/
|
||||||
|
public function isInUse(ParentGroup $parentGroup): bool
|
||||||
|
{
|
||||||
|
return $parentGroup->tenants()->exists()
|
||||||
|
|| $parentGroup->eventParticipants()->withoutGlobalScopes()->exists();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,8 @@ use App\Domains\Admin\Controllers\DocumentAssetUpdateController;
|
|||||||
use App\Domains\Admin\Controllers\DocumentTemplatesGetController;
|
use App\Domains\Admin\Controllers\DocumentTemplatesGetController;
|
||||||
use App\Domains\Admin\Controllers\DocumentTemplatesPreviewController;
|
use App\Domains\Admin\Controllers\DocumentTemplatesPreviewController;
|
||||||
use App\Domains\Admin\Controllers\DocumentTemplatesUpdateController;
|
use App\Domains\Admin\Controllers\DocumentTemplatesUpdateController;
|
||||||
|
use App\Domains\Admin\Controllers\GlobalSettingsGetController;
|
||||||
|
use App\Domains\Admin\Controllers\GlobalSettingsUpdateController;
|
||||||
use App\Domains\Admin\Controllers\ManagedTenantContactGetController;
|
use App\Domains\Admin\Controllers\ManagedTenantContactGetController;
|
||||||
use App\Domains\Admin\Controllers\ManagedTenantContactUpdateController;
|
use App\Domains\Admin\Controllers\ManagedTenantContactUpdateController;
|
||||||
use App\Domains\Admin\Controllers\ManagedTenantGdprGetController;
|
use App\Domains\Admin\Controllers\ManagedTenantGdprGetController;
|
||||||
@@ -15,6 +17,10 @@ use App\Domains\Admin\Controllers\ManagedTenantPaymentGetController;
|
|||||||
use App\Domains\Admin\Controllers\ManagedTenantPaymentUpdateController;
|
use App\Domains\Admin\Controllers\ManagedTenantPaymentUpdateController;
|
||||||
use App\Domains\Admin\Controllers\ManagedTenantTaxGetController;
|
use App\Domains\Admin\Controllers\ManagedTenantTaxGetController;
|
||||||
use App\Domains\Admin\Controllers\ManagedTenantTaxUpdateController;
|
use App\Domains\Admin\Controllers\ManagedTenantTaxUpdateController;
|
||||||
|
use App\Domains\Admin\Controllers\ParentGroupCreateController;
|
||||||
|
use App\Domains\Admin\Controllers\ParentGroupDeleteController;
|
||||||
|
use App\Domains\Admin\Controllers\ParentGroupListApiController;
|
||||||
|
use App\Domains\Admin\Controllers\ParentGroupUpdateController;
|
||||||
use App\Domains\Admin\Controllers\TenantContactGetController;
|
use App\Domains\Admin\Controllers\TenantContactGetController;
|
||||||
use App\Domains\Admin\Controllers\TenantContactUpdateController;
|
use App\Domains\Admin\Controllers\TenantContactUpdateController;
|
||||||
use App\Domains\Admin\Controllers\TenantCreateController;
|
use App\Domains\Admin\Controllers\TenantCreateController;
|
||||||
@@ -76,6 +82,12 @@ Route::middleware([IdentifyTenant::class, 'auth', AdminRoleMiddleware::class])->
|
|||||||
Route::post('/assets', DocumentAssetUpdateController::class);
|
Route::post('/assets', DocumentAssetUpdateController::class);
|
||||||
Route::delete('/assets/{name}', DocumentAssetDeleteController::class);
|
Route::delete('/assets/{name}', DocumentAssetDeleteController::class);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Bezeichnungen der Gruppen-Ebenen gelten ebenfalls app-weit.
|
||||||
|
Route::prefix('api/v1/admin/settings')->group(function () {
|
||||||
|
Route::get('/', GlobalSettingsGetController::class);
|
||||||
|
Route::post('/', GlobalSettingsUpdateController::class);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::middleware(LvOnlyMiddleware::class)->group(function () {
|
Route::middleware(LvOnlyMiddleware::class)->group(function () {
|
||||||
@@ -97,5 +109,12 @@ Route::middleware([IdentifyTenant::class, 'auth', AdminRoleMiddleware::class])->
|
|||||||
Route::post('/tax', ManagedTenantTaxUpdateController::class);
|
Route::post('/tax', ManagedTenantTaxUpdateController::class);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::prefix('api/v1/admin/parent-groups')->group(function () {
|
||||||
|
Route::get('/list', ParentGroupListApiController::class);
|
||||||
|
Route::post('/create', ParentGroupCreateController::class);
|
||||||
|
Route::post('/{id}', ParentGroupUpdateController::class)->whereNumber('id');
|
||||||
|
Route::delete('/{id}', ParentGroupDeleteController::class)->whereNumber('id');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
use App\Domains\Admin\Controllers\AdminDashboardController;
|
use App\Domains\Admin\Controllers\AdminDashboardController;
|
||||||
use App\Domains\Admin\Controllers\DocumentTemplatesPageController;
|
use App\Domains\Admin\Controllers\DocumentTemplatesPageController;
|
||||||
|
use App\Domains\Admin\Controllers\GlobalSettingsPageController;
|
||||||
|
use App\Domains\Admin\Controllers\ParentGroupListPageController;
|
||||||
use App\Domains\Admin\Controllers\TenantEditPageController;
|
use App\Domains\Admin\Controllers\TenantEditPageController;
|
||||||
use App\Domains\Admin\Controllers\TenantListPageController;
|
use App\Domains\Admin\Controllers\TenantListPageController;
|
||||||
use App\Domains\Admin\Controllers\TenantPageController;
|
use App\Domains\Admin\Controllers\TenantPageController;
|
||||||
@@ -21,11 +23,13 @@ Route::middleware([IdentifyTenant::class, 'auth', AdminRoleMiddleware::class])->
|
|||||||
// App-weit gültige Dokumentvorlagen -- nur für Hauptadministrator*innen.
|
// App-weit gültige Dokumentvorlagen -- nur für Hauptadministrator*innen.
|
||||||
Route::middleware(MainAdminRoleMiddleware::class)->group(function () {
|
Route::middleware(MainAdminRoleMiddleware::class)->group(function () {
|
||||||
Route::get('/document-templates', DocumentTemplatesPageController::class);
|
Route::get('/document-templates', DocumentTemplatesPageController::class);
|
||||||
|
Route::get('/settings', GlobalSettingsPageController::class);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::middleware(LvOnlyMiddleware::class)->group(function () {
|
Route::middleware(LvOnlyMiddleware::class)->group(function () {
|
||||||
Route::get('/tenants', TenantListPageController::class);
|
Route::get('/tenants', TenantListPageController::class);
|
||||||
Route::get('/tenants/{slug}', TenantEditPageController::class);
|
Route::get('/tenants/{slug}', TenantEditPageController::class);
|
||||||
|
Route::get('/parent-groups', ParentGroupListPageController::class);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
import AdminAppLayout from "../../../../resources/js/layouts/AdminAppLayout.vue";
|
||||||
|
import ShadowedBox from "../../../Views/Components/ShadowedBox.vue";
|
||||||
|
import { useAjax } from "../../../../resources/js/components/ajaxHandler.js";
|
||||||
|
import { toast } from "vue3-toastify";
|
||||||
|
|
||||||
|
const { request } = useAjax()
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
localGroup: '',
|
||||||
|
localGroupPlural: '',
|
||||||
|
parentGroup: '',
|
||||||
|
parentGroupPlural: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const response = await request('/api/v1/admin/settings')
|
||||||
|
Object.assign(form.value, response?.groupLabels ?? {})
|
||||||
|
})
|
||||||
|
|
||||||
|
async function save() {
|
||||||
|
const response = await request('/api/v1/admin/settings', {
|
||||||
|
method: 'POST',
|
||||||
|
body: form.value,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response && response.status === 'success') {
|
||||||
|
toast.success(response.message)
|
||||||
|
} else {
|
||||||
|
toast.error(response?.message ?? 'Fehler beim Speichern')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<AdminAppLayout title="Einstellungen">
|
||||||
|
<shadowed-box style="width: 95%; margin: 20px auto; padding: 20px; overflow-x: hidden;">
|
||||||
|
<h3>Bezeichnungen der Gruppen</h3>
|
||||||
|
<p class="hint">
|
||||||
|
Gelten für alle Mandanten: in Anmeldungen, Teilnehmendenlisten, Exporten und in der Verwaltung.
|
||||||
|
</p>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Einzahl</th>
|
||||||
|
<th>Mehrzahl</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Gruppe (Mandant)</th>
|
||||||
|
<td><input type="text" v-model="form.localGroup" class="form-input" placeholder="z. B. Stamm" /></td>
|
||||||
|
<td><input type="text" v-model="form.localGroupPlural" class="form-input" placeholder="z. B. Stämme" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Übergeordnete Gruppe</th>
|
||||||
|
<td><input type="text" v-model="form.parentGroup" class="form-input" placeholder="z. B. Bund" /></td>
|
||||||
|
<td><input type="text" v-model="form.parentGroupPlural" class="form-input" placeholder="z. B. Bünde" /></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<button class="btn-save" @click="save">Speichern</button>
|
||||||
|
</shadowed-box>
|
||||||
|
</AdminAppLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.hint {
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 8px 12px;
|
||||||
|
color: #374151;
|
||||||
|
border-bottom: 1px solid #e5e7eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table td {
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-bottom: 1px solid #e5e7eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-input {
|
||||||
|
width: 100%;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-save {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 8px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
background-color: #16a34a;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-save:hover {
|
||||||
|
background-color: #15803d;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,249 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
import AdminAppLayout from "../../../../resources/js/layouts/AdminAppLayout.vue";
|
||||||
|
import ShadowedBox from "../../../Views/Components/ShadowedBox.vue";
|
||||||
|
import { useAjax } from "../../../../resources/js/components/ajaxHandler.js";
|
||||||
|
import { toast } from "vue3-toastify";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
groupLabels: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({ localGroupPlural: 'Stämme', parentGroup: 'Bund', parentGroupPlural: 'Bünde' }),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const { request } = useAjax()
|
||||||
|
|
||||||
|
const parentGroups = ref([])
|
||||||
|
const newName = ref('')
|
||||||
|
const showCreate = ref(false)
|
||||||
|
// ID des Eintrags, der gerade umbenannt wird, samt Entwurf des neuen Namens.
|
||||||
|
const editingId = ref(null)
|
||||||
|
const editName = ref('')
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await loadParentGroups()
|
||||||
|
})
|
||||||
|
|
||||||
|
async function loadParentGroups() {
|
||||||
|
const response = await request('/api/v1/admin/parent-groups/list')
|
||||||
|
parentGroups.value = response?.parentGroups ?? []
|
||||||
|
}
|
||||||
|
|
||||||
|
async function createParentGroup() {
|
||||||
|
const response = await request('/api/v1/admin/parent-groups/create', {
|
||||||
|
method: 'POST',
|
||||||
|
body: { name: newName.value },
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response && response.status === 'success') {
|
||||||
|
toast.success(response.message)
|
||||||
|
newName.value = ''
|
||||||
|
showCreate.value = false
|
||||||
|
await loadParentGroups()
|
||||||
|
} else {
|
||||||
|
toast.error(response?.message ?? 'Fehler beim Anlegen')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function startEditing(parentGroup) {
|
||||||
|
editingId.value = parentGroup.id
|
||||||
|
editName.value = parentGroup.name
|
||||||
|
}
|
||||||
|
|
||||||
|
async function saveName(parentGroup) {
|
||||||
|
const response = await request('/api/v1/admin/parent-groups/' + parentGroup.id, {
|
||||||
|
method: 'POST',
|
||||||
|
body: { name: editName.value },
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response && response.status === 'success') {
|
||||||
|
toast.success(response.message)
|
||||||
|
editingId.value = null
|
||||||
|
await loadParentGroups()
|
||||||
|
} else {
|
||||||
|
toast.error(response?.message ?? 'Fehler beim Speichern')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteParentGroup(parentGroup) {
|
||||||
|
if (!confirm('„' + parentGroup.name + '" wirklich löschen?')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await request('/api/v1/admin/parent-groups/' + parentGroup.id, {
|
||||||
|
method: 'DELETE',
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response && response.status === 'success') {
|
||||||
|
toast.success(response.message)
|
||||||
|
await loadParentGroups()
|
||||||
|
} else {
|
||||||
|
toast.error(response?.message ?? 'Fehler beim Löschen')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<AdminAppLayout :title="props.groupLabels.parentGroupPlural">
|
||||||
|
<shadowed-box style="width: 95%; margin: 20px auto; padding: 20px; overflow-x: hidden;">
|
||||||
|
<table class="parent-group-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Zugeordnete {{ props.groupLabels.localGroupPlural }}</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="parentGroup in parentGroups" :key="parentGroup.id">
|
||||||
|
<td>
|
||||||
|
<input v-if="editingId === parentGroup.id" type="text" v-model="editName" class="form-input"
|
||||||
|
@keyup.enter="saveName(parentGroup)" />
|
||||||
|
<span v-else>{{ parentGroup.name }}</span>
|
||||||
|
</td>
|
||||||
|
<td>{{ parentGroup.tenantCount }}</td>
|
||||||
|
<td class="actions">
|
||||||
|
<template v-if="editingId === parentGroup.id">
|
||||||
|
<button class="btn-save" @click="saveName(parentGroup)">Speichern</button>
|
||||||
|
<button class="btn-cancel" @click="editingId = null">Abbrechen</button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<button class="btn-edit" @click="startEditing(parentGroup)">Umbenennen</button>
|
||||||
|
<button v-if="parentGroup.deletable" class="btn-delete" @click="deleteParentGroup(parentGroup)">Löschen</button>
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p class="hint">
|
||||||
|
Löschen ist nur möglich, solange keine {{ props.groupLabels.localGroupPlural }} und keine Anmeldungen
|
||||||
|
zugeordnet sind. „Ohne Zuordnung" bleibt immer bestehen.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div style="margin-top: 20px;">
|
||||||
|
<button v-if="!showCreate" class="btn-create" @click="showCreate = true">Neuen Eintrag anlegen</button>
|
||||||
|
|
||||||
|
<div v-if="showCreate" class="create-form">
|
||||||
|
<h3>Neuen Eintrag anlegen ({{ props.groupLabels.parentGroup }})</h3>
|
||||||
|
<input type="text" v-model="newName" class="form-input" placeholder="Name"
|
||||||
|
@keyup.enter="createParentGroup" />
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn-save" @click="createParentGroup">Anlegen</button>
|
||||||
|
<button class="btn-cancel" @click="showCreate = false">Abbrechen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</shadowed-box>
|
||||||
|
</AdminAppLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.parent-group-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parent-group-table thead th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 10px 16px;
|
||||||
|
background-color: #f9fafb;
|
||||||
|
color: #374151;
|
||||||
|
font-weight: bold;
|
||||||
|
border-bottom: 2px solid #d1d5db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parent-group-table tbody td {
|
||||||
|
padding: 10px 16px;
|
||||||
|
border-bottom: 1px solid #e5e7eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
margin-top: 12px;
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.create-form {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: #f9fafb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.create-form h3 {
|
||||||
|
margin: 0 0 15px 0;
|
||||||
|
color: #374151;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-input {
|
||||||
|
width: 100%;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-create, .btn-save, .btn-cancel, .btn-edit, .btn-delete {
|
||||||
|
padding: 6px 16px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-create, .btn-edit {
|
||||||
|
background-color: #1d4899;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-create:hover, .btn-edit:hover {
|
||||||
|
background-color: #163a7a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-save {
|
||||||
|
background-color: #16a34a;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-save:hover {
|
||||||
|
background-color: #15803d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cancel {
|
||||||
|
background-color: #e5e7eb;
|
||||||
|
color: #374151;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cancel:hover {
|
||||||
|
background-color: #d1d5db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-delete {
|
||||||
|
background-color: #dc2626;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-delete:hover {
|
||||||
|
background-color: #b91c1c;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useAjax } from "../../../../../resources/js/components/ajaxHandler.js";
|
import { useAjax } from "../../../../../resources/js/components/ajaxHandler.js";
|
||||||
import { toast } from "vue3-toastify";
|
import { toast } from "vue3-toastify";
|
||||||
|
|
||||||
@@ -17,8 +17,16 @@ const form = ref({
|
|||||||
name: props.data.name ?? '',
|
name: props.data.name ?? '',
|
||||||
slug: props.data.slug ?? '',
|
slug: props.data.slug ?? '',
|
||||||
url: props.data.url ?? '',
|
url: props.data.url ?? '',
|
||||||
|
parent_group_id: props.data.parent_group_id ?? null,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Übergeordnete Gruppe (z. B. „Bund") -- Pflichtangabe, Auswahl aus der LV-seitig gepflegten Liste.
|
||||||
|
const parentGroups = props.data.parentGroups ?? []
|
||||||
|
const parentGroupLabel = props.data.parentGroupLabel ?? 'Bund'
|
||||||
|
const parentGroupName = computed(() =>
|
||||||
|
parentGroups.find(g => g.id === form.value.parent_group_id)?.name ?? '—'
|
||||||
|
)
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
const saveUrl = props.data.saveEndpoint ?? '/api/v1/admin/tenants/' + props.data.slug + '/general'
|
const saveUrl = props.data.saveEndpoint ?? '/api/v1/admin/tenants/' + props.data.slug + '/general'
|
||||||
const response = await request(saveUrl, {
|
const response = await request(saveUrl, {
|
||||||
@@ -39,6 +47,7 @@ async function save() {
|
|||||||
<div v-if="!editing">
|
<div v-if="!editing">
|
||||||
<table class="data-table">
|
<table class="data-table">
|
||||||
<tr><th>Name:</th><td>{{ form.name }}</td></tr>
|
<tr><th>Name:</th><td>{{ form.name }}</td></tr>
|
||||||
|
<tr><th>{{ parentGroupLabel }}:</th><td>{{ parentGroupName }}</td></tr>
|
||||||
<tr><th>Slug:</th><td>{{ form.slug }}</td></tr>
|
<tr><th>Slug:</th><td>{{ form.slug }}</td></tr>
|
||||||
<tr><th>URL:</th><td>{{ form.url }}</td></tr>
|
<tr><th>URL:</th><td>{{ form.url }}</td></tr>
|
||||||
<tr><th>Status:</th><td>
|
<tr><th>Status:</th><td>
|
||||||
@@ -54,6 +63,14 @@ async function save() {
|
|||||||
<th>Name:</th>
|
<th>Name:</th>
|
||||||
<td><input type="text" v-model="form.name" class="form-input" /></td>
|
<td><input type="text" v-model="form.name" class="form-input" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{ parentGroupLabel }}:</th>
|
||||||
|
<td>
|
||||||
|
<select v-model="form.parent_group_id" class="form-input">
|
||||||
|
<option v-for="group in parentGroups" :key="group.id" :value="group.id">{{ group.name }}</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Slug:</th>
|
<th>Slug:</th>
|
||||||
<td><input type="text" v-model="form.slug" class="form-input" /></td>
|
<td><input type="text" v-model="form.slug" class="form-input" /></td>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {computed, ref} from 'vue';
|
import {computed, ref} from 'vue';
|
||||||
|
import BankRulesetEditor from "../../../../Views/Components/BankRulesetEditor.vue";
|
||||||
import FullScreenModal from "../../../../Views/Components/FullScreenModal.vue";
|
import FullScreenModal from "../../../../Views/Components/FullScreenModal.vue";
|
||||||
import TextEditor from "../../../../Views/Components/TextEditor.vue";
|
import TextEditor from "../../../../Views/Components/TextEditor.vue";
|
||||||
import RichSelectBox from "../../../../Views/Components/RichSelectBox.vue";
|
import RichSelectBox from "../../../../Views/Components/RichSelectBox.vue";
|
||||||
@@ -102,6 +103,10 @@ async function save() {
|
|||||||
<RichSelectBox v-if="option.type === 'icon'" v-model="form.configuration[option.name]"
|
<RichSelectBox v-if="option.type === 'icon'" v-model="form.configuration[option.name]"
|
||||||
:options="PAYMENT_METHOD_ICONS" placeholder="Symbol wählen…"/>
|
:options="PAYMENT_METHOD_ICONS" placeholder="Symbol wählen…"/>
|
||||||
<TextEditor v-else-if="option.type === 'richtext'" v-model="form.configuration[option.name]"/>
|
<TextEditor v-else-if="option.type === 'richtext'" v-model="form.configuration[option.name]"/>
|
||||||
|
<BankRulesetEditor v-else-if="option.type === 'bank-ruleset'"
|
||||||
|
v-model="form.configuration[option.name]"
|
||||||
|
:defaults="data.statementRulesetDefault ?? {}"
|
||||||
|
:charsets="data.statementRulesetCharsets ?? undefined"/>
|
||||||
<input v-else type="text" v-model="form.configuration[option.name]" class="form-input"/>
|
<input v-else type="text" v-model="form.configuration[option.name]" class="form-input"/>
|
||||||
<span v-if="option.hint" class="option-hint">{{ option.hint }}</span>
|
<span v-if="option.hint" class="option-hint">{{ option.hint }}</span>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ import ShadowedBox from "../../../Views/Components/ShadowedBox.vue";
|
|||||||
import { useAjax } from "../../../../resources/js/components/ajaxHandler.js";
|
import { useAjax } from "../../../../resources/js/components/ajaxHandler.js";
|
||||||
import { toast } from "vue3-toastify";
|
import { toast } from "vue3-toastify";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
groupLabels: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({ localGroup: 'Stamm', localGroupPlural: 'Stämme', parentGroup: 'Bund' }),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const { request } = useAjax()
|
const { request } = useAjax()
|
||||||
|
|
||||||
function openTenant(slug) {
|
function openTenant(slug) {
|
||||||
@@ -12,12 +19,16 @@ function openTenant(slug) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tenants = ref([])
|
const tenants = ref([])
|
||||||
|
const parentGroups = ref([])
|
||||||
const showCreate = ref(false)
|
const showCreate = ref(false)
|
||||||
const createForm = ref({
|
const emptyForm = () => ({
|
||||||
name: '',
|
name: '',
|
||||||
slug: '',
|
slug: '',
|
||||||
url: '',
|
url: '',
|
||||||
|
// Pflichtangabe; vorbelegt mit „Ohne Zuordnung", sobald die Liste geladen ist.
|
||||||
|
parent_group_id: parentGroups.value.find(g => g.isFallback)?.id ?? null,
|
||||||
})
|
})
|
||||||
|
const createForm = ref(emptyForm())
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await loadTenants()
|
await loadTenants()
|
||||||
@@ -33,6 +44,11 @@ async function loadTenants() {
|
|||||||
})
|
})
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
tenants.value = data.tenants
|
tenants.value = data.tenants
|
||||||
|
parentGroups.value = data.parentGroups ?? []
|
||||||
|
|
||||||
|
if (createForm.value.parent_group_id === null) {
|
||||||
|
createForm.value.parent_group_id = parentGroups.value.find(g => g.isFallback)?.id ?? null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createTenant() {
|
async function createTenant() {
|
||||||
@@ -44,7 +60,7 @@ async function createTenant() {
|
|||||||
if (response && response.status === 'success') {
|
if (response && response.status === 'success') {
|
||||||
toast.success(response.message)
|
toast.success(response.message)
|
||||||
showCreate.value = false
|
showCreate.value = false
|
||||||
createForm.value = { name: '', slug: '', url: '' }
|
createForm.value = emptyForm()
|
||||||
await loadTenants()
|
await loadTenants()
|
||||||
} else {
|
} else {
|
||||||
toast.error(response?.message ?? 'Fehler beim Anlegen')
|
toast.error(response?.message ?? 'Fehler beim Anlegen')
|
||||||
@@ -53,12 +69,13 @@ async function createTenant() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AdminAppLayout title="Stämme">
|
<AdminAppLayout :title="props.groupLabels.localGroupPlural">
|
||||||
<shadowed-box style="width: 95%; margin: 20px auto; padding: 20px; overflow-x: hidden;">
|
<shadowed-box style="width: 95%; margin: 20px auto; padding: 20px; overflow-x: hidden;">
|
||||||
<table class="tenant-table">
|
<table class="tenant-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
<th>{{ props.groupLabels.parentGroup }}</th>
|
||||||
<th>Slug</th>
|
<th>Slug</th>
|
||||||
<th>URL</th>
|
<th>URL</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
@@ -67,6 +84,7 @@ async function createTenant() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="tenant in tenants" :key="tenant.slug" class="tenant-row" @click="openTenant(tenant.slug)">
|
<tr v-for="tenant in tenants" :key="tenant.slug" class="tenant-row" @click="openTenant(tenant.slug)">
|
||||||
<td>{{ tenant.name }}</td>
|
<td>{{ tenant.name }}</td>
|
||||||
|
<td>{{ tenant.parentGroup ?? '—' }}</td>
|
||||||
<td>{{ tenant.slug }}</td>
|
<td>{{ tenant.slug }}</td>
|
||||||
<td>{{ tenant.url }}</td>
|
<td>{{ tenant.url }}</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -79,15 +97,23 @@ async function createTenant() {
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
<button v-if="!showCreate" class="btn-create" @click="showCreate = true">Neuen Stamm anlegen</button>
|
<button v-if="!showCreate" class="btn-create" @click="showCreate = true">Neuen Eintrag anlegen ({{ props.groupLabels.localGroup }})</button>
|
||||||
|
|
||||||
<div v-if="showCreate" class="create-form">
|
<div v-if="showCreate" class="create-form">
|
||||||
<h3>Neuen Stamm anlegen</h3>
|
<h3>Neuen Eintrag anlegen ({{ props.groupLabels.localGroup }})</h3>
|
||||||
<table class="form-table">
|
<table class="form-table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<td><input type="text" v-model="createForm.name" class="form-input" /></td>
|
<td><input type="text" v-model="createForm.name" class="form-input" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{ props.groupLabels.parentGroup }}</th>
|
||||||
|
<td>
|
||||||
|
<select v-model="createForm.parent_group_id" class="form-input">
|
||||||
|
<option v-for="group in parentGroups" :key="group.id" :value="group.id">{{ group.name }}</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Slug</th>
|
<th>Slug</th>
|
||||||
<td><input type="text" v-model="createForm.slug" class="form-input" /></td>
|
<td><input type="text" v-model="createForm.slug" class="form-input" /></td>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class CreateEstimateAction {
|
|||||||
|
|
||||||
if ($this->request->estimateId === 0) {
|
if ($this->request->estimateId === 0) {
|
||||||
$estimate = CostUnitEstimate::create(array_merge([
|
$estimate = CostUnitEstimate::create(array_merge([
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'cost_unit_id' => $this->request->costUnit->id,
|
'cost_unit_id' => $this->request->costUnit->id,
|
||||||
'type' => $this->request->estimateType,
|
'type' => $this->request->estimateType,
|
||||||
'description' => $this->request->description,
|
'description' => $this->request->description,
|
||||||
@@ -33,7 +33,7 @@ class CreateEstimateAction {
|
|||||||
} else {
|
} else {
|
||||||
$estimate = CostUnitEstimate::find($this->request->estimateId);
|
$estimate = CostUnitEstimate::find($this->request->estimateId);
|
||||||
$estimate->update(array_merge([
|
$estimate->update(array_merge([
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'cost_unit_id' => $this->request->costUnit->id,
|
'cost_unit_id' => $this->request->costUnit->id,
|
||||||
'type' => $this->request->estimateType,
|
'type' => $this->request->estimateType,
|
||||||
'description' => $this->request->description,
|
'description' => $this->request->description,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class ChangeCostUnitDetailsCommand {
|
|||||||
|
|
||||||
$this->request->costUnit->distance_allowance = $this->request->distanceAllowance->getAmount();
|
$this->request->costUnit->distance_allowance = $this->request->distanceAllowance->getAmount();
|
||||||
$this->request->costUnit->mail_on_new = $this->request->mailOnNew;
|
$this->request->costUnit->mail_on_new = $this->request->mailOnNew;
|
||||||
$this->request->costUnit->billing_deadline = $this->request->billingDeadline;
|
$this->request->costUnit->billing_deadline = $this->request->billingDeadline?->format('Y-m-d');
|
||||||
|
|
||||||
$response->success = $this->request->costUnit->save();
|
$response->success = $this->request->costUnit->save();
|
||||||
return $response;
|
return $response;
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ class CreateCostUnitCommand {
|
|||||||
$response = new CreateCostUnitResponse();
|
$response = new CreateCostUnitResponse();
|
||||||
$costUnit = CostUnit::create([
|
$costUnit = CostUnit::create([
|
||||||
'name' => $this->request->name,
|
'name' => $this->request->name,
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'type' => $this->request->type,
|
'type' => $this->request->type,
|
||||||
'billing_deadline' => $this->request->billingDeadline,
|
'billing_deadline' => $this->request->billingDeadline?->format('Y-m-d'),
|
||||||
'distance_allowance' => $this->request->distanceAllowance->getAmount(),
|
'distance_allowance' => $this->request->distanceAllowance->getAmount(),
|
||||||
'mail_on_new' => $this->request->mailOnNew,
|
'mail_on_new' => $this->request->mailOnNew,
|
||||||
'allow_new' => true,
|
'allow_new' => true,
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ class EditController extends CommonController{
|
|||||||
|
|
||||||
$saveParams = $request->get('formData');
|
$saveParams = $request->get('formData');
|
||||||
$distanceAllowance = Amount::fromString($saveParams['distanceAllowance']);
|
$distanceAllowance = Amount::fromString($saveParams['distanceAllowance']);
|
||||||
$billingDeadline = isset($saveParams['billingDeadline']) ? \DateTime::createFromFormat('Y-m-d', $saveParams['billingDeadline']) : null;
|
$rawBillingDeadline = $saveParams['billingDeadline'] ?? null;
|
||||||
|
$billingDeadline = !empty($rawBillingDeadline)
|
||||||
|
? (\DateTime::createFromFormat('!Y-m-d', $rawBillingDeadline) ?: null)
|
||||||
|
: null;
|
||||||
|
|
||||||
$request = new ChangeCostUnitDetailsRequest($costUnit, $distanceAllowance, $saveParams['mailOnNew'], $billingDeadline);
|
$request = new ChangeCostUnitDetailsRequest($costUnit, $distanceAllowance, $saveParams['mailOnNew'], $billingDeadline);
|
||||||
$command = new ChangeCostUnitDetailsCommand($request);
|
$command = new ChangeCostUnitDetailsCommand($request);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class ExportController extends CommonController {
|
|||||||
'amount' => $invoice->amount,
|
'amount' => $invoice->amount,
|
||||||
'recipient_name' => $invoice->contact_bank_owner,
|
'recipient_name' => $invoice->contact_bank_owner,
|
||||||
'recipient_iban' => $invoice->contact_bank_iban,
|
'recipient_iban' => $invoice->contact_bank_iban,
|
||||||
'payment_purpose' => $invoice->payment_purpose ?? 'Auslagenerstattung Rechnungsnummer ' . $invoice->invoice_number,
|
'payment_purpose' => $invoice->paymentPurposeText(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,12 +89,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<table v-if="localData.invoices.length > 0" class="invoice-list-table">
|
<table v-if="localData.invoices.length > 0" class="invoice-list-table">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6">{{props.data.costUnit.name}}</td>
|
<td colspan="7">{{props.data.costUnit.name}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr v-for="invoice in localData.invoices" :id="'invoice_' + invoice.id">
|
<tr v-for="invoice in localData.invoices" :id="'invoice_' + invoice.id">
|
||||||
<td>{{invoice.invoiceNumber}}</td>
|
<td>{{invoice.invoiceNumber}}</td>
|
||||||
<td>{{invoice.invoiceType}}</td>
|
<td>{{invoice.invoiceTypeShort}}</td>
|
||||||
|
<td style="max-width: 250px;">{{invoice.purpose}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{invoice.amount}}
|
{{invoice.amount}}
|
||||||
</td>
|
</td>
|
||||||
@@ -114,7 +115,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr v-if="props.data.endpoint === 'approved'">
|
<tr v-if="props.data.endpoint === 'approved'">
|
||||||
<td colspan="5"></td>
|
<td colspan="6"></td>
|
||||||
<td>
|
<td>
|
||||||
<a style="font-size: 10pt;" class="link" @click="exportPayouts()">Genehmigte Abrechnungen exportieren</a>
|
<a style="font-size: 10pt;" class="link" @click="exportPayouts()">Genehmigte Abrechnungen exportieren</a>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class PersonalDataController extends CommonController
|
|||||||
return redirect()->intended('/login');
|
return redirect()->intended('/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = auth()->user();
|
$user = currentUser();
|
||||||
$data = $this->users->getPersonalData($user);
|
$data = $this->users->getPersonalData($user);
|
||||||
|
|
||||||
$inertiaProvider = new InertiaProvider('Dashboard/PersonalData', [
|
$inertiaProvider = new InertiaProvider('Dashboard/PersonalData', [
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class StorePersonalDataController extends CommonController
|
|||||||
{
|
{
|
||||||
public function __invoke(Request $request): JsonResponse
|
public function __invoke(Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$user = currentUser();
|
||||||
|
|
||||||
$actionRequest = new UpdatePersonalDataRequest(
|
$actionRequest = new UpdatePersonalDataRequest(
|
||||||
user: $user,
|
user: $user,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function navigateTo(url) {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{participation.event.postal_code}} {{participation.event.location}}<br />
|
{{participation.eventAddress}}<br />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="link" :href="`/api/v1/event/participant/${participation.identifier}/ical`">In Kalender importieren</a>
|
<a class="link" :href="`/api/v1/event/participant/${participation.identifier}/ical`">In Kalender importieren</a>
|
||||||
|
|||||||
+142
@@ -0,0 +1,142 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\BookBankStatementPayments;
|
||||||
|
|
||||||
|
use App\Domains\Event\Actions\ParticipantPayment\ParticipantPaymentCommand;
|
||||||
|
use App\Domains\Event\Actions\ParticipantPayment\ParticipantPaymentRequest;
|
||||||
|
use App\EventPaymentModules\EventPaymentModuleRegistry;
|
||||||
|
use App\EventPaymentModules\ReadsBankStatements;
|
||||||
|
use App\Models\EventParticipant;
|
||||||
|
use App\Models\PaymentMethod;
|
||||||
|
use App\Repositories\EventParticipantRepository;
|
||||||
|
use App\ValueObjects\Amount;
|
||||||
|
use App\ValueObjects\BankTransaction;
|
||||||
|
use Carbon\CarbonImmutable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bucht die in der Prüfansicht bestätigten Zahlungseingänge -- alle in einem Durchgang.
|
||||||
|
*
|
||||||
|
* Bewusst **ohne** umspannende Transaktion: Gebucht wird über {@see ParticipantPaymentCommand}, und der
|
||||||
|
* verschickt die Zahlungsmail gleich mit. Das Projekt kennt keine Queue, die Mails gehen also synchron
|
||||||
|
* raus; eine offene Transaktion über achtzig Mailversände wäre die schlechtere Wahl. Jede Zeile ist
|
||||||
|
* für sich vollständig, und das Wasserzeichen schützt sie gegen eine Wiederholung.
|
||||||
|
*/
|
||||||
|
class BookBankStatementPaymentsCommand
|
||||||
|
{
|
||||||
|
public function __construct(private readonly BookBankStatementPaymentsRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): BookBankStatementPaymentsResponse
|
||||||
|
{
|
||||||
|
$response = new BookBankStatementPaymentsResponse();
|
||||||
|
|
||||||
|
if ($this->request->bookings === []) {
|
||||||
|
$response->message = 'Es wurden keine Zahlungen zum Buchen ausgewählt.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$module = EventPaymentModuleRegistry::forSlug(PaymentMethod::PAYMENT_ACCOUNT_TRANSACTION);
|
||||||
|
$participants = new EventParticipantRepository();
|
||||||
|
|
||||||
|
foreach ($this->request->bookings as $booking) {
|
||||||
|
$participant = $participants->findInEventByIdentifier(
|
||||||
|
$this->request->event,
|
||||||
|
(string) ($booking['participantIdentifier'] ?? ''),
|
||||||
|
);
|
||||||
|
|
||||||
|
$transaction = $this->toTransaction($booking);
|
||||||
|
|
||||||
|
if ($participant === null || $transaction === null) {
|
||||||
|
$response->failed++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zweite Prüfung, nicht bloß Gürtel und Hosenträger: In der Prüfansicht lässt sich eine
|
||||||
|
// Zeile von Hand einer anderen Person zuordnen, und deren Wasserzeichen hat der erste
|
||||||
|
// Durchlauf nie gesehen.
|
||||||
|
if ($this->isBeforeWatermark($participant, $transaction)) {
|
||||||
|
$response->skipped++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($module instanceof ReadsBankStatements) {
|
||||||
|
$module->recordTransaction($participant, $transaction);
|
||||||
|
}
|
||||||
|
|
||||||
|
$participant->last_payment_date = $transaction->paymentDate;
|
||||||
|
|
||||||
|
$this->book($participant, $transaction->amount);
|
||||||
|
$response->booked++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->message = $this->summaryMessage($response);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bucht den Betrag **zusätzlich** zum bereits Gezahlten.
|
||||||
|
*
|
||||||
|
* Die manuelle Erfassung setzt `amount_paid` absolut, weil dort jemand den Gesamtstand eintippt.
|
||||||
|
* Hier kommt eine einzelne Zahlung an -- eine zweite Rate darf die erste nicht überschreiben.
|
||||||
|
* Der {@see ParticipantPaymentCommand} speichert dabei die zuvor gesetzten Felder mit und schickt
|
||||||
|
* die passende Mail (bezahlt / fehlt noch / überzahlt).
|
||||||
|
*/
|
||||||
|
private function book(EventParticipant $participant, Amount $amount): void
|
||||||
|
{
|
||||||
|
$total = new Amount(
|
||||||
|
round(($participant->amount_paid?->getAmount() ?? 0.0) + $amount->getAmount(), 2),
|
||||||
|
'Euro',
|
||||||
|
);
|
||||||
|
|
||||||
|
new ParticipantPaymentCommand(new ParticipantPaymentRequest($participant, $total))->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @param array<string, mixed> $booking */
|
||||||
|
private function toTransaction(array $booking): ?BankTransaction
|
||||||
|
{
|
||||||
|
$date = CarbonImmutable::createFromFormat('!Y-m-d', (string) ($booking['paymentDate'] ?? ''));
|
||||||
|
$amount = $booking['amount'] ?? null;
|
||||||
|
|
||||||
|
if ($date === false || !is_numeric($amount) || (float) $amount <= 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new BankTransaction(
|
||||||
|
paymentDate: $date,
|
||||||
|
amount: new Amount(round((float) $amount, 2), 'Euro'),
|
||||||
|
purpose: (string) ($booking['purpose'] ?? ''),
|
||||||
|
payerName: (string) ($booking['payerName'] ?? ''),
|
||||||
|
payerIban: (string) ($booking['payerIban'] ?? ''),
|
||||||
|
rowNumber: (int) ($booking['rowNumber'] ?? 0),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function isBeforeWatermark(EventParticipant $participant, BankTransaction $transaction): bool
|
||||||
|
{
|
||||||
|
$watermark = $participant->last_payment_date;
|
||||||
|
|
||||||
|
return $watermark !== null && $transaction->paymentDate->startOfDay()->lt($watermark->startOfDay());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function summaryMessage(BookBankStatementPaymentsResponse $response): string
|
||||||
|
{
|
||||||
|
$message = sprintf('%d Zahlungen wurden gebucht.', $response->booked);
|
||||||
|
|
||||||
|
if ($response->skipped > 0) {
|
||||||
|
$message .= sprintf(
|
||||||
|
' %d wurden übersprungen, weil sie älter sind als die zuletzt erfasste Zahlung der Person.',
|
||||||
|
$response->skipped,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($response->failed > 0) {
|
||||||
|
$message .= sprintf(' %d konnten nicht zugeordnet werden.', $response->failed);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\BookBankStatementPayments;
|
||||||
|
|
||||||
|
use App\Models\Event;
|
||||||
|
|
||||||
|
class BookBankStatementPaymentsRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param array<int, array<string, mixed>> $bookings Je Eintrag die bestätigte Zeile der Prüfansicht:
|
||||||
|
* participantIdentifier, paymentDate, amount,
|
||||||
|
* payerName, payerIban, purpose.
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public readonly Event $event,
|
||||||
|
public readonly array $bookings,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\BookBankStatementPayments;
|
||||||
|
|
||||||
|
class BookBankStatementPaymentsResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
public string $message = '';
|
||||||
|
|
||||||
|
public int $booked = 0;
|
||||||
|
|
||||||
|
/** Übersprungen, weil älter als die zuletzt erfasste Zahlung der Person. */
|
||||||
|
public int $skipped = 0;
|
||||||
|
|
||||||
|
/** Nicht verarbeitbar (unbekannte Anmeldung, unbrauchbarer Betrag). */
|
||||||
|
public int $failed = 0;
|
||||||
|
}
|
||||||
+8
-1
@@ -12,7 +12,14 @@ class CertificateOfConductionCheckCommand {
|
|||||||
public function execute() : CertificateOfConductionCheckResponse {
|
public function execute() : CertificateOfConductionCheckResponse {
|
||||||
$response = new CertificateOfConductionCheckResponse();
|
$response = new CertificateOfConductionCheckResponse();
|
||||||
|
|
||||||
$localGroup = str_replace('Stamm ', '', $this->request->participant->localGroup()->first()->name);
|
// Verlangt die Veranstaltung kein eFZ, entfällt die Prüfung -- ohne Aufruf der Prüf-API.
|
||||||
|
if (!$this->request->participant->event()->first()?->coc_check_required) {
|
||||||
|
$response->status = EfzStatus::EFZ_STATUS_NOT_REQUIRED;
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Der Stamm ist optional (die Kurzanmeldung erhebt ihn nicht, in der Verwaltung kann er entfernt werden).
|
||||||
|
$localGroup = str_replace('Stamm ', '', $this->request->participant->localGroup()->first()?->name ?? '');
|
||||||
|
|
||||||
$apiResponse = Http::acceptJson()
|
$apiResponse = Http::acceptJson()
|
||||||
->asJson()
|
->asJson()
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class CreateEventCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$tenant = app('tenant');
|
$tenant = currentTenant();
|
||||||
|
|
||||||
// Anlage als Ganzes: der Event-Teil der Rechnungsnummer wird unter der Sperre vergeben und muss
|
// Anlage als Ganzes: der Event-Teil der Rechnungsnummer wird unter der Sperre vergeben und muss
|
||||||
// im selben Zug geschrieben werden, sonst könnten zwei gleichzeitige Anlagen denselben erhalten.
|
// im selben Zug geschrieben werden, sonst könnten zwei gleichzeitige Anlagen denselben erhalten.
|
||||||
@@ -38,6 +38,8 @@ class CreateEventCommand {
|
|||||||
'name' => $this->request->name,
|
'name' => $this->request->name,
|
||||||
'identifier' => Str::random(10),
|
'identifier' => Str::random(10),
|
||||||
'location' => $this->request->location,
|
'location' => $this->request->location,
|
||||||
|
'street' => $this->normalizeOptional($this->request->street),
|
||||||
|
'house_number' => $this->normalizeOptional($this->request->houseNumber),
|
||||||
'postal_code' => $this->request->postalCode,
|
'postal_code' => $this->request->postalCode,
|
||||||
'email' => $this->request->email,
|
'email' => $this->request->email,
|
||||||
'start_date' => $this->request->begin,
|
'start_date' => $this->request->begin,
|
||||||
@@ -60,6 +62,7 @@ class CreateEventCommand {
|
|||||||
'vat_pricing_mode' => $tenant->vat_pricing_mode,
|
'vat_pricing_mode' => $tenant->vat_pricing_mode,
|
||||||
'tax_exemption_reason' => $tenant->tax_exemption_reason,
|
'tax_exemption_reason' => $tenant->tax_exemption_reason,
|
||||||
'tax_exemption_note' => $tenant->tax_exemption_note,
|
'tax_exemption_note' => $tenant->tax_exemption_note,
|
||||||
|
'participant_group_type' => $this->request->participantGroupType->value,
|
||||||
// Den Event-Teil der Rechnungsnummer einfrieren: Tenant-Präfix und Startdatum sind später
|
// Den Event-Teil der Rechnungsnummer einfrieren: Tenant-Präfix und Startdatum sind später
|
||||||
// änderbar, eine herausgegebene Rechnung würde sonst zu einer anderen Nummer gehören.
|
// änderbar, eine herausgegebene Rechnung würde sonst zu einer anderen Nummer gehören.
|
||||||
//
|
//
|
||||||
@@ -91,12 +94,12 @@ class CreateEventCommand {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app('tenant')->slug === 'lv') {
|
if (currentTenant()->slug === 'lv') {
|
||||||
foreach(Tenant::where(['is_active_local_group' => true])->get() as $tenant) {
|
foreach(Tenant::where(['is_active_local_group' => true])->get() as $tenant) {
|
||||||
EventLocalGroups::create(['event_id' => $event->id, 'local_group_id' => $tenant->id]);
|
EventLocalGroups::create(['event_id' => $event->id, 'local_group_id' => $tenant->id]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EventLocalGroups::create(['event_id' => $event->id, 'local_group_id' => app('tenant')->id]);
|
EventLocalGroups::create(['event_id' => $event->id, 'local_group_id' => currentTenant()->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -107,6 +110,17 @@ class CreateEventCommand {
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Straße und Hausnummer sind optional. Ein leer gelassenes Eingabefeld liefert einen leeren String --
|
||||||
|
* gespeichert wird dafür `null`, damit „nicht angegeben" nur eine Darstellung hat.
|
||||||
|
*/
|
||||||
|
private function normalizeOptional(?string $value): ?string
|
||||||
|
{
|
||||||
|
$value = trim((string) $value);
|
||||||
|
|
||||||
|
return '' === $value ? null : $value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event-Teil der Rechnungsnummer, z.B. `WM-V-20260701`: Tenant-Präfix, Dokumentart „V" für
|
* Event-Teil der Rechnungsnummer, z.B. `WM-V-20260701`: Tenant-Präfix, Dokumentart „V" für
|
||||||
* Veranstaltung, dann ohne Trenner Jahr, Monat des Beginns und die laufende Nummer der
|
* Veranstaltung, dann ohne Trenner Jahr, Monat des Beginns und die laufende Nummer der
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Event\Actions\CreateEvent;
|
namespace App\Domains\Event\Actions\CreateEvent;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Enumerations\ParticipationFeeType;
|
use App\Enumerations\ParticipationFeeType;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
|
||||||
@@ -19,8 +20,13 @@ class CreateEventRequest {
|
|||||||
public string $accountOwner;
|
public string $accountOwner;
|
||||||
public string $accountIban;
|
public string $accountIban;
|
||||||
public bool $payPerDay;
|
public bool $payPerDay;
|
||||||
|
public ?string $street;
|
||||||
|
public ?string $houseNumber;
|
||||||
|
/** Wonach bei der Anmeldung gefragt wird: Local Group oder Parent Group. */
|
||||||
|
public ParticipantGroupType $participantGroupType;
|
||||||
|
|
||||||
public function __construct(string $name, string $location, string $postalCode, string $email, DateTime $begin, DateTime $end, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $earlyBirdEndAmountIncrease, ParticipationFeeType $participationFeeType, string $accountOwner, string $accountIban, bool $payPerDay) {
|
public function __construct(string $name, string $location, string $postalCode, string $email, DateTime $begin, DateTime $end, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $earlyBirdEndAmountIncrease, ParticipationFeeType $participationFeeType, string $accountOwner, string $accountIban, bool $payPerDay, ?string $street = null, ?string $houseNumber = null, ParticipantGroupType $participantGroupType = ParticipantGroupType::LocalGroup) {
|
||||||
|
$this->participantGroupType = $participantGroupType;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->location = $location;
|
$this->location = $location;
|
||||||
$this->postalCode = $postalCode;
|
$this->postalCode = $postalCode;
|
||||||
@@ -34,5 +40,7 @@ class CreateEventRequest {
|
|||||||
$this->accountOwner = $accountOwner;
|
$this->accountOwner = $accountOwner;
|
||||||
$this->accountIban = $accountIban;
|
$this->accountIban = $accountIban;
|
||||||
$this->payPerDay = $payPerDay;
|
$this->payPerDay = $payPerDay;
|
||||||
|
$this->street = $street;
|
||||||
|
$this->houseNumber = $houseNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+233
@@ -0,0 +1,233 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\CreateIncomeSurplusStatement;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipationType;
|
||||||
|
use App\Models\CostUnit;
|
||||||
|
use App\Models\Event;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Providers\PdfGenerateAndDownloadProvider;
|
||||||
|
use App\Repositories\CostUnitRepository;
|
||||||
|
use App\ValueObjects\Amount;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erzeugt die Einnahmen-Überschuss-Rechnung einer Veranstaltung als PDF.
|
||||||
|
*
|
||||||
|
* Gezeigt wird ausschließlich Geld, das geflossen ist: gezahlte Beiträge, weitere Einnahmen, was von
|
||||||
|
* Abmeldungen einbehalten wurde, Fördermittel -- und auf der anderen Seite die erfassten Belege. Was nur
|
||||||
|
* erwartet (offene Beiträge) oder geplant (Budgetwerte) ist, gehört in eine Einnahmen-Überschuss-Rechnung
|
||||||
|
* nicht hinein.
|
||||||
|
*
|
||||||
|
* Es wird nichts gespeichert: Alle Zahlen leiten sich aus dem aktuellen Stand ab, ein erneuter Abruf
|
||||||
|
* liefert den dann gültigen Stand.
|
||||||
|
*/
|
||||||
|
class CreateIncomeSurplusStatementCommand
|
||||||
|
{
|
||||||
|
private Event $event;
|
||||||
|
|
||||||
|
private CostUnitRepository $costUnits;
|
||||||
|
|
||||||
|
public function __construct(private readonly CreateIncomeSurplusStatementRequest $request)
|
||||||
|
{
|
||||||
|
$this->event = $request->event;
|
||||||
|
$this->costUnits = new CostUnitRepository();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): CreateIncomeSurplusStatementResponse
|
||||||
|
{
|
||||||
|
$response = new CreateIncomeSurplusStatementResponse();
|
||||||
|
|
||||||
|
$costUnit = $this->event->costUnit()->first();
|
||||||
|
|
||||||
|
if (!$costUnit instanceof CostUnit) {
|
||||||
|
$response->message = 'Der Veranstaltung ist keine Kostenstelle zugeordnet.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Der Pauschalbetrag wird vor dem Resource-Aufruf gelesen: `EventResource::calculateSupportPerPerson()`
|
||||||
|
// multipliziert das Amount-Objekt von `support_per_person` in place. Auf `support_flat` wirkt das
|
||||||
|
// zwar nicht, aber der gesamte Zugriff auf Beträge des Models ist danach nicht mehr vertrauenswürdig.
|
||||||
|
$otherIncome = $this->event->support_flat->getAmount();
|
||||||
|
|
||||||
|
$eventData = $this->event->toResource()->toArray(new Request());
|
||||||
|
|
||||||
|
$expenses = $this->buildExpenses($costUnit);
|
||||||
|
$donations = $this->buildExpenses($costUnit, donationsOnly: true);
|
||||||
|
$income = $this->buildIncome($eventData, $otherIncome, $donations['total']);
|
||||||
|
|
||||||
|
$result = new Amount($income['total']->getAmount() - $expenses['total']->getAmount(), 'Euro');
|
||||||
|
|
||||||
|
$html = view('pdfs.income-surplus-statement', [
|
||||||
|
'event' => $this->event,
|
||||||
|
'createdAt' => new \DateTime()->format('d.m.Y'),
|
||||||
|
'income' => $income,
|
||||||
|
'expenses' => $expenses,
|
||||||
|
'donations' => $donations,
|
||||||
|
'result' => $result,
|
||||||
|
'money' => self::money(...),
|
||||||
|
])->render();
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->filename = 'EUER-' . $this->event->identifier . '.pdf';
|
||||||
|
$response->income = $income;
|
||||||
|
$response->expenses = $expenses;
|
||||||
|
$response->donations = $donations;
|
||||||
|
$response->result = $result;
|
||||||
|
$response->pdfContent = PdfGenerateAndDownloadProvider::fromHtml($html, 'portrait');
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Die Einnahmenseite in zwei Ober-Kategorien.
|
||||||
|
*
|
||||||
|
* Alle Zahlen stammen aus {@see \App\Resources\EventResource} -- derselben Quelle wie die
|
||||||
|
* Veranstaltungsübersicht am Bildschirm. Eine eigene Rechnung daneben würde über kurz oder lang von
|
||||||
|
* der Übersicht abweichen, und dann glaubt niemand mehr einer der beiden Zahlen.
|
||||||
|
*
|
||||||
|
* @param array<string, mixed> $eventData
|
||||||
|
*
|
||||||
|
* @return array{categories: array<int, array{name: string, total: Amount, entries: array<int, array{name: string, amount: Amount}>}>, total: Amount}
|
||||||
|
*/
|
||||||
|
private function buildIncome(array $eventData, float $otherIncome, Amount $donations): array
|
||||||
|
{
|
||||||
|
// Beiträge aller Teilnahmearten in einer Zeile: Für die Mittelverwendung zählt, was an Beiträgen
|
||||||
|
// hereingekommen ist, nicht von wem.
|
||||||
|
$participationFees = new Amount(0, 'Euro');
|
||||||
|
foreach ([
|
||||||
|
ParticipationType::PARTICIPATION_TYPE_PARTICIPANT,
|
||||||
|
ParticipationType::PARTICIPATION_TYPE_TEAM,
|
||||||
|
ParticipationType::PARTICIPATION_TYPE_VOLUNTEER,
|
||||||
|
ParticipationType::PARTICIPATION_TYPE_OTHER,
|
||||||
|
] as $participationType) {
|
||||||
|
$participationFees->addAmount(
|
||||||
|
new Amount((float) $eventData['participants'][$participationType]['amount']['paid']['value'], 'Euro')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ownFunds = [
|
||||||
|
['name' => 'Teilnahmebeiträge', 'amount' => $participationFees],
|
||||||
|
['name' => 'Weitere Einnahmen', 'amount' => new Amount($otherIncome, 'Euro')],
|
||||||
|
[
|
||||||
|
'name' => 'Einbehaltene Einnahmen aus Abmeldungen',
|
||||||
|
'amount' => new Amount((float) $eventData['retainedFromUnregistered']['value'], 'Euro'),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$supportRate = new Amount((float) $eventData['supportPersonValue'], 'Euro');
|
||||||
|
$funding = [
|
||||||
|
[
|
||||||
|
'name' => 'Fördermittel (' . self::money($supportRate) . ' € p.P./Tag)',
|
||||||
|
'amount' => new Amount($eventData['supportPerson']['amount']->getAmount(), 'Euro'),
|
||||||
|
],
|
||||||
|
// Gespendete Auslagen: als Ausgabe ihres Typs gebucht, hier die Gegenbuchung.
|
||||||
|
['name' => 'Spenden', 'amount' => $donations],
|
||||||
|
];
|
||||||
|
|
||||||
|
$categories = [
|
||||||
|
['name' => 'Eigenmittel', 'entries' => $ownFunds, 'total' => self::sum($ownFunds)],
|
||||||
|
['name' => 'Förderungen', 'entries' => $funding, 'total' => self::sum($funding)],
|
||||||
|
];
|
||||||
|
|
||||||
|
return [
|
||||||
|
'categories' => $categories,
|
||||||
|
'total' => self::sum($categories),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Die Ausgabenseite: eine Zeile je Ausgabentyp, dazu die Belege für die Anlage.
|
||||||
|
*
|
||||||
|
* Mit `$donationsOnly` nur die gespendeten Auslagen in derselben Gliederung -- für die Anlage „Spenden"
|
||||||
|
* und die Summe unter den Förderungen.
|
||||||
|
*
|
||||||
|
* @return array{groups: array<int, array{name: string, sum: Amount, rows: array<int, array{number: string, date: string, purpose: string, amount: Amount}>}>, total: Amount}
|
||||||
|
*/
|
||||||
|
private function buildExpenses(CostUnit $costUnit, bool $donationsOnly = false): array
|
||||||
|
{
|
||||||
|
$groups = [];
|
||||||
|
$total = new Amount(0, 'Euro');
|
||||||
|
|
||||||
|
foreach ($this->costUnits->groupExpensesByType($costUnit, $donationsOnly) as $group) {
|
||||||
|
$rows = [];
|
||||||
|
|
||||||
|
foreach ($group['invoices'] as $invoice) {
|
||||||
|
$rows[] = [
|
||||||
|
'number' => (string) $invoice->invoice_number,
|
||||||
|
'date' => $invoice->created_at?->format('d.m.Y') ?? '',
|
||||||
|
// Ohne die Anmerkung: dort steht, was die Kassenwart*in beim Korrigieren notiert hat,
|
||||||
|
// und das gehört auf den Beleg, nicht in den Zweck.
|
||||||
|
'purpose' => self::purpose($invoice),
|
||||||
|
'amount' => Amount::fromString($invoice->amount),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$groups[] = [
|
||||||
|
'name' => $group['type']->name,
|
||||||
|
'sum' => $group['sum'],
|
||||||
|
'rows' => $rows,
|
||||||
|
];
|
||||||
|
|
||||||
|
$total->addAmount($group['sum']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['groups' => $groups, 'total' => $total];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Der Zweck eines Belegs für die Anlage.
|
||||||
|
*
|
||||||
|
* Erfasster oder abgeleiteter Zahlungsgrund wie in der Beleg-Übersicht. Nur wenn es keinen gibt --
|
||||||
|
* ältere Abrechnungen ohne jede Zweckangabe --, steht dort ersatzweise, wem was erstattet wurde. Bewusst
|
||||||
|
* hier und nicht in {@see Invoice::purposeText()}: Dort würde der Ersatztext als erfasster Zahlungsgrund
|
||||||
|
* erscheinen und beim Korrigieren als Änderung protokolliert.
|
||||||
|
*/
|
||||||
|
private static function purpose(Invoice $invoice): string
|
||||||
|
{
|
||||||
|
$purpose = $invoice->purposeText();
|
||||||
|
|
||||||
|
if (trim($purpose) !== '') {
|
||||||
|
return $purpose;
|
||||||
|
}
|
||||||
|
|
||||||
|
return trim('Auslagenerstattung ' . $invoice->contact_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ein Betrag in deutscher Schreibweise: Punkt als Tausender-, Komma als Dezimaltrennzeichen.
|
||||||
|
*
|
||||||
|
* Bewusst nicht {@see Amount::getFormattedAmount()}: Die Methode ersetzt nach `number_format` jeden
|
||||||
|
* Punkt durch ein Komma und macht aus 1.487,50 damit "1,487,50". Auf einer Aufstellung, in der
|
||||||
|
* vierstellige Beträge die Regel sind, wäre das nicht lesbar. Der Fehler steckt im Value Object und
|
||||||
|
* wirkt überall, wo Beträge angezeigt werden -- ihn dort zu beheben ist eine eigene Änderung.
|
||||||
|
*
|
||||||
|
* Öffentlich, weil die Vorlage sie als Callable bekommt und weil sie für sich prüfbar sein soll.
|
||||||
|
*/
|
||||||
|
public static function money(Amount $amount): string
|
||||||
|
{
|
||||||
|
return number_format(round($amount->getAmount(), 2), 2, ',', '.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Summiert Zeilen, die je ein `amount` oder `total` tragen.
|
||||||
|
*
|
||||||
|
* Über ein frisches Amount-Objekt, weil `Amount::addAmount()` den Empfänger verändert -- die
|
||||||
|
* Einzelbeträge sollen unangetastet bleiben, sie werden anschließend gedruckt.
|
||||||
|
*
|
||||||
|
* @param array<int, array<string, mixed>> $rows
|
||||||
|
*/
|
||||||
|
private static function sum(array $rows): Amount
|
||||||
|
{
|
||||||
|
$sum = new Amount(0, 'Euro');
|
||||||
|
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
/** @var Amount $amount */
|
||||||
|
$amount = $row['amount'] ?? $row['total'];
|
||||||
|
$sum->addAmount($amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $sum;
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\CreateIncomeSurplusStatement;
|
||||||
|
|
||||||
|
use App\Models\Event;
|
||||||
|
|
||||||
|
class CreateIncomeSurplusStatementRequest
|
||||||
|
{
|
||||||
|
public function __construct(public readonly Event $event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\CreateIncomeSurplusStatement;
|
||||||
|
|
||||||
|
use App\ValueObjects\Amount;
|
||||||
|
|
||||||
|
class CreateIncomeSurplusStatementResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
|
||||||
|
public string $filename = '';
|
||||||
|
|
||||||
|
public string $pdfContent = '';
|
||||||
|
|
||||||
|
public ?string $message = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Die Zahlen, aus denen das PDF entsteht -- Einnahmen-Kategorien, Ausgaben-Gruppen und das Ergebnis.
|
||||||
|
*
|
||||||
|
* Sie stehen hier, weil sie das eigentliche Ergebnis der Action sind; das PDF ist nur ihre Darstellung.
|
||||||
|
* So lässt sich die Rechnung prüfen, ohne ein PDF zerlegen zu müssen.
|
||||||
|
*
|
||||||
|
* @var array{categories: array<int, array{name: string, total: Amount, entries: array<int, array{name: string, amount: Amount}>}>, total: Amount}|array{}
|
||||||
|
*/
|
||||||
|
public array $income = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array{groups: array<int, array{name: string, sum: Amount, rows: array<int, array<string, mixed>>}>, total: Amount}|array{}
|
||||||
|
*/
|
||||||
|
public array $expenses = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Die gespendeten Auslagen, gegliedert wie die Ausgaben -- die Gegenbuchung zur Zeile „Spenden".
|
||||||
|
*
|
||||||
|
* @var array{groups: array<int, array{name: string, sum: Amount, rows: array<int, array<string, mixed>>}>, total: Amount}|array{}
|
||||||
|
*/
|
||||||
|
public array $donations = [];
|
||||||
|
|
||||||
|
public ?Amount $result = null;
|
||||||
|
}
|
||||||
@@ -13,18 +13,18 @@ class GenerateIcalCommand
|
|||||||
$participant = $this->request->participant;
|
$participant = $this->request->participant;
|
||||||
$event = $participant->event;
|
$event = $participant->event;
|
||||||
|
|
||||||
$uid = $participant->identifier . '@' . app('tenant')->slug;
|
$uid = $participant->identifier . '@' . currentTenant()->slug;
|
||||||
$dtStart = $event->start_date->format('Ymd');
|
$dtStart = $event->start_date->format('Ymd');
|
||||||
$dtEnd = $event->end_date->copy()->addDay()->format('Ymd');
|
$dtEnd = $event->end_date->copy()->addDay()->format('Ymd');
|
||||||
$now = now()->format('Ymd\THis\Z');
|
$now = now()->format('Ymd\THis\Z');
|
||||||
$summary = $this->escapeIcal($event->name);
|
$summary = $this->escapeIcal($event->name);
|
||||||
$location = $this->escapeIcal(trim($event->postal_code . ' ' . $event->location));
|
$location = $this->escapeIcal($event->getFullAddress());
|
||||||
$description = $this->escapeIcal('Teilnahme als: ' . $participant->getOfficialName());
|
$description = $this->escapeIcal('Teilnahme als: ' . $participant->getOfficialName());
|
||||||
|
|
||||||
$icalContent = implode("\r\n", [
|
$icalContent = implode("\r\n", [
|
||||||
'BEGIN:VCALENDAR',
|
'BEGIN:VCALENDAR',
|
||||||
'VERSION:2.0',
|
'VERSION:2.0',
|
||||||
'PRODID:-//' . app('tenant')->name . '//Veranstaltungskalender//DE',
|
'PRODID:-//' . currentTenant()->name . '//Veranstaltungskalender//DE',
|
||||||
'CALSCALE:GREGORIAN',
|
'CALSCALE:GREGORIAN',
|
||||||
'METHOD:PUBLISH',
|
'METHOD:PUBLISH',
|
||||||
'BEGIN:VEVENT',
|
'BEGIN:VEVENT',
|
||||||
|
|||||||
+2
-2
@@ -21,11 +21,11 @@ class GenerateIcalForDeadlineCommand {
|
|||||||
$icalContent = implode("\r\n", [
|
$icalContent = implode("\r\n", [
|
||||||
'BEGIN:VCALENDAR',
|
'BEGIN:VCALENDAR',
|
||||||
'VERSION:2.0',
|
'VERSION:2.0',
|
||||||
'PRODID:-//' . app('tenant')->name . '//Veranstaltungskalender//DE',
|
'PRODID:-//' . currentTenant()->name . '//Veranstaltungskalender//DE',
|
||||||
'CALSCALE:GREGORIAN',
|
'CALSCALE:GREGORIAN',
|
||||||
'METHOD:PUBLISH',
|
'METHOD:PUBLISH',
|
||||||
'BEGIN:VEVENT',
|
'BEGIN:VEVENT',
|
||||||
'UID:payment-deadline-' . $event->identifier . '@' . app('tenant')->slug,
|
'UID:payment-deadline-' . $event->identifier . '@' . currentTenant()->slug,
|
||||||
'DTSTAMP:' . $now,
|
'DTSTAMP:' . $now,
|
||||||
'DTSTART;VALUE=DATE:' . $dtDate,
|
'DTSTART;VALUE=DATE:' . $dtDate,
|
||||||
'DTEND;VALUE=DATE:' . $dtDate,
|
'DTEND;VALUE=DATE:' . $dtDate,
|
||||||
|
|||||||
@@ -0,0 +1,183 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\ParseBankStatement;
|
||||||
|
|
||||||
|
use App\EventPaymentModules\EventPaymentModuleRegistry;
|
||||||
|
use App\EventPaymentModules\ProvidesStatementRuleset;
|
||||||
|
use App\EventPaymentModules\ReadsBankStatements;
|
||||||
|
use App\Models\EventParticipant;
|
||||||
|
use App\Models\PaymentMethod;
|
||||||
|
use App\Providers\BankStatementParseProvider;
|
||||||
|
use App\Repositories\EventParticipantRepository;
|
||||||
|
use App\Support\BankStatementParseException;
|
||||||
|
use App\ValueObjects\BankStatementRuleset;
|
||||||
|
use App\ValueObjects\BankTransaction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liest einen hochgeladenen Kontoauszug und schlägt je Zahlungseingang eine Anmeldung vor.
|
||||||
|
*
|
||||||
|
* Hier wird nichts gebucht -- das Ergebnis ist die Prüfansicht, in der die Aktionsleitung die
|
||||||
|
* Vorschläge bestätigt, korrigiert oder verwirft. Erst der zweite Schritt schreibt.
|
||||||
|
*
|
||||||
|
* Der Ablauf ist zahlartneutral: Was ein verwertbarer Umsatz ist und zu wem er gehört, entscheidet
|
||||||
|
* das Zahlungsmodul über {@see ReadsBankStatements}.
|
||||||
|
*/
|
||||||
|
class ParseBankStatementCommand
|
||||||
|
{
|
||||||
|
/** 8 MB -- ein Jahresauszug bleibt weit darunter, alles darüber ist die falsche Datei. */
|
||||||
|
private const int MAX_BYTES = 8 * 1024 * 1024;
|
||||||
|
|
||||||
|
private const array ALLOWED_EXTENSIONS = ['csv', 'txt'];
|
||||||
|
|
||||||
|
public function __construct(private readonly ParseBankStatementRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(): ParseBankStatementResponse
|
||||||
|
{
|
||||||
|
$response = new ParseBankStatementResponse();
|
||||||
|
|
||||||
|
$module = EventPaymentModuleRegistry::forSlug(PaymentMethod::PAYMENT_ACCOUNT_TRANSACTION);
|
||||||
|
if (!$module instanceof ReadsBankStatements) {
|
||||||
|
$response->message = 'Für die Überweisung ist kein Kontoauszug-Import eingerichtet.';
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$contents = $this->readFile($response);
|
||||||
|
if ($contents === null) {
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ruleset = $module instanceof ProvidesStatementRuleset
|
||||||
|
? $module->statementRuleset($this->request->configuration)
|
||||||
|
: BankStatementRuleset::default();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$transactions = new BankStatementParseProvider()->parse($contents, $ruleset);
|
||||||
|
} catch (BankStatementParseException $exception) {
|
||||||
|
$response->message = $exception->getMessage();
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$candidates = new EventParticipantRepository()->getForPaymentMatching($this->request->event);
|
||||||
|
|
||||||
|
foreach ($transactions as $transaction) {
|
||||||
|
if (!$module->isRelevantTransaction($transaction)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$match = $module->matchTransaction($transaction, $candidates);
|
||||||
|
|
||||||
|
// Vor der letzten erfassten Zahlung dieser Person: schon gebucht, oder aus einem Auszug,
|
||||||
|
// der bereits verarbeitet wurde. Gar nicht erst anzeigen.
|
||||||
|
if ($match !== null && $this->isBeforeWatermark($match->participant, $transaction)) {
|
||||||
|
$response->skippedOlderThanWatermark++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response->rows[] = $transaction->toArray() + [
|
||||||
|
'suggestedIdentifier' => $match?->participant->identifier,
|
||||||
|
'confidence' => $match?->confidence,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$response->participants = $candidates
|
||||||
|
->map(fn (EventParticipant $participant): array => $this->participantOption($participant))
|
||||||
|
->values()
|
||||||
|
->all();
|
||||||
|
|
||||||
|
$response->success = true;
|
||||||
|
$response->message = $this->summaryMessage($response);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function readFile(ParseBankStatementResponse $response): ?string
|
||||||
|
{
|
||||||
|
$file = $this->request->file;
|
||||||
|
|
||||||
|
if ($file === null || !$file->isValid()) {
|
||||||
|
$response->message = 'Es wurde keine Datei hochgeladen.';
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($file->getSize() > self::MAX_BYTES) {
|
||||||
|
$response->message = 'Die Datei ist zu groß (maximal 8 MB).';
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array(strtolower($file->getClientOriginalExtension()), self::ALLOWED_EXTENSIONS, true)) {
|
||||||
|
$response->message = 'Bitte den CSV-Export der Bank hochladen (.csv).';
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$contents = file_get_contents($file->getRealPath());
|
||||||
|
|
||||||
|
if ($contents === false || trim($contents) === '') {
|
||||||
|
$response->message = 'Die Datei ließ sich nicht lesen oder ist leer.';
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function isBeforeWatermark(EventParticipant $participant, BankTransaction $transaction): bool
|
||||||
|
{
|
||||||
|
$watermark = $participant->last_payment_date;
|
||||||
|
|
||||||
|
// Echt kleiner, nicht kleiner-gleich: Zwei Zahlungen am selben Tag sollen beide ankommen.
|
||||||
|
return $watermark !== null && $transaction->paymentDate->startOfDay()->lt($watermark->startOfDay());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return array<string, mixed> */
|
||||||
|
private function participantOption(EventParticipant $participant): array
|
||||||
|
{
|
||||||
|
$amountLeft = clone $participant->amount;
|
||||||
|
if ($participant->amount_paid !== null) {
|
||||||
|
$amountLeft->subtractAmount($participant->amount_paid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'identifier' => $participant->identifier,
|
||||||
|
'name' => $participant->lastname . ', ' . $participant->firstname,
|
||||||
|
'amount' => $participant->amount?->toString(),
|
||||||
|
'amountPaid' => $participant->amount_paid?->toString(),
|
||||||
|
'amountOpen' => $amountLeft->toString(),
|
||||||
|
'isSettled' => round($amountLeft->getAmount(), 2) <= 0,
|
||||||
|
'lastPaymentDate' => $participant->last_payment_date?->format('d.m.Y'),
|
||||||
|
// Zahlt jemand, der sich abgemeldet hat, wird die Zahlung trotzdem erfasst -- danach
|
||||||
|
// steht aber eine Erstattung an. Die Prüfansicht weist darauf hin.
|
||||||
|
'isSignedOff' => $participant->unregistered_at !== null,
|
||||||
|
'signedOffAt' => $participant->unregistered_at?->format('d.m.Y'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function summaryMessage(ParseBankStatementResponse $response): string
|
||||||
|
{
|
||||||
|
if ($response->rows === []) {
|
||||||
|
return $response->skippedOlderThanWatermark > 0
|
||||||
|
? 'Alle Zahlungseingänge dieser Datei wurden bereits erfasst.'
|
||||||
|
: 'In der Datei sind keine Zahlungseingänge zu dieser Aktion enthalten.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$assigned = count(array_filter($response->rows, static fn (array $row): bool => $row['suggestedIdentifier'] !== null));
|
||||||
|
|
||||||
|
$message = sprintf(
|
||||||
|
'%d Zahlungseingänge gelesen, %d davon konnten zugeordnet werden.',
|
||||||
|
count($response->rows),
|
||||||
|
$assigned,
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->skippedOlderThanWatermark > 0) {
|
||||||
|
$message .= sprintf(' %d bereits erfasste Zahlungen wurden übersprungen.', $response->skippedOlderThanWatermark);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\ParseBankStatement;
|
||||||
|
|
||||||
|
use App\Models\Event;
|
||||||
|
use Illuminate\Http\UploadedFile;
|
||||||
|
|
||||||
|
class ParseBankStatementRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param array<string, mixed> $configuration Tenant-Konfiguration der Überweisung. Wird hereingereicht
|
||||||
|
* statt hier geholt -- den DB-Zugriff macht der Controller
|
||||||
|
* über das Repository.
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public readonly Event $event,
|
||||||
|
public readonly ?UploadedFile $file,
|
||||||
|
public readonly array $configuration = [],
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\ParseBankStatement;
|
||||||
|
|
||||||
|
class ParseBankStatementResponse
|
||||||
|
{
|
||||||
|
public bool $success = false;
|
||||||
|
public string $message = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Eine Zeile je verwertbarem Umsatz, fertig für die Prüfansicht.
|
||||||
|
*
|
||||||
|
* @var array<int, array<string, mixed>>
|
||||||
|
*/
|
||||||
|
public array $rows = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alle zuordenbaren Anmeldungen der Aktion für die Auswahlliste.
|
||||||
|
*
|
||||||
|
* @var array<int, array<string, mixed>>
|
||||||
|
*/
|
||||||
|
public array $participants = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Umsätze, die vor der zuletzt erfassten Zahlung der erkannten Person liegen. Sie erscheinen gar
|
||||||
|
* nicht erst in der Prüfansicht -- gezählt werden sie trotzdem, sonst bliebe unerklärt, warum
|
||||||
|
* eine Datei mit 40 Zeilen nur 12 Vorschläge ergibt.
|
||||||
|
*/
|
||||||
|
public int $skippedOlderThanWatermark = 0;
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ class SetParticipationFeesCommand {
|
|||||||
$this->cleanBefore();
|
$this->cleanBefore();
|
||||||
|
|
||||||
$this->request->event->participationFee1()->associate(EventParticipationFee::create([
|
$this->request->event->participationFee1()->associate(EventParticipationFee::create([
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'type' => $this->request->participationFeeFirst['type'],
|
'type' => $this->request->participationFeeFirst['type'],
|
||||||
'name' => $this->request->participationFeeFirst['name'],
|
'name' => $this->request->participationFeeFirst['name'],
|
||||||
'description' => $this->request->participationFeeFirst['description'],
|
'description' => $this->request->participationFeeFirst['description'],
|
||||||
@@ -29,7 +29,7 @@ class SetParticipationFeesCommand {
|
|||||||
|
|
||||||
if ($this->request->participationFeeSecond !== null) {
|
if ($this->request->participationFeeSecond !== null) {
|
||||||
$this->request->event->participationFee2()->associate(EventParticipationFee::create([
|
$this->request->event->participationFee2()->associate(EventParticipationFee::create([
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'type' => $this->request->participationFeeSecond['type'],
|
'type' => $this->request->participationFeeSecond['type'],
|
||||||
'name' => $this->request->participationFeeSecond['name'],
|
'name' => $this->request->participationFeeSecond['name'],
|
||||||
'description' => $this->request->participationFeeSecond['description'],
|
'description' => $this->request->participationFeeSecond['description'],
|
||||||
@@ -41,7 +41,7 @@ class SetParticipationFeesCommand {
|
|||||||
|
|
||||||
if ($this->request->participationFeeThird !== null) {
|
if ($this->request->participationFeeThird !== null) {
|
||||||
$this->request->event->participationFee3()->associate(EventParticipationFee::create([
|
$this->request->event->participationFee3()->associate(EventParticipationFee::create([
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'type' => $this->request->participationFeeThird['type'],
|
'type' => $this->request->participationFeeThird['type'],
|
||||||
'name' => $this->request->participationFeeThird['name'],
|
'name' => $this->request->participationFeeThird['name'],
|
||||||
'description' => $this->request->participationFeeThird['description'],
|
'description' => $this->request->participationFeeThird['description'],
|
||||||
@@ -53,7 +53,7 @@ class SetParticipationFeesCommand {
|
|||||||
|
|
||||||
if ($this->request->participationFeeFourth !== null) {
|
if ($this->request->participationFeeFourth !== null) {
|
||||||
$this->request->event->participationFee4()->associate(EventParticipationFee::create([
|
$this->request->event->participationFee4()->associate(EventParticipationFee::create([
|
||||||
'tenant' => app('tenant')->slug,
|
'tenant' => currentTenant()->slug,
|
||||||
'type' => $this->request->participationFeeFourth['type'],
|
'type' => $this->request->participationFeeFourth['type'],
|
||||||
'name' => $this->request->participationFeeFourth['name'],
|
'name' => $this->request->participationFeeFourth['name'],
|
||||||
'description' => $this->request->participationFeeFourth['description'],
|
'description' => $this->request->participationFeeFourth['description'],
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class SetPaymentMethodsCommand
|
|||||||
// Bestehende Zuweisung: Config nur bei explizitem Override anpassen, sonst unverändert lassen.
|
// Bestehende Zuweisung: Config nur bei explizitem Override anpassen, sonst unverändert lassen.
|
||||||
if ($override !== null) {
|
if ($override !== null) {
|
||||||
$row = $existing[$slug];
|
$row = $existing[$slug];
|
||||||
$row->configuration = PaymentMethod::sanitizeConfiguration($slug, $override);
|
$row->configuration = $this->eventConfiguration($slug, $override);
|
||||||
$row->save();
|
$row->save();
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -75,8 +75,27 @@ class SetPaymentMethodsCommand
|
|||||||
EventPaymentMethods::create([
|
EventPaymentMethods::create([
|
||||||
'event_id' => $event->id,
|
'event_id' => $event->id,
|
||||||
'slug' => $slug,
|
'slug' => $slug,
|
||||||
'configuration' => PaymentMethod::sanitizeConfiguration($slug, $snapshot ?? []),
|
'configuration' => $this->eventConfiguration($slug, $snapshot ?? []),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Was von einer Konfiguration am Event gespeichert wird.
|
||||||
|
*
|
||||||
|
* Neben dem Zuschnitt aufs Schema fallen hier die tenant-weiten Optionen heraus. Das
|
||||||
|
* Kontoauszug-Format etwa beschreibt die Bank, nicht die Zusage an die Teilnehmenden -- eingefroren
|
||||||
|
* ließe sich nach einem Bankwechsel für laufende Aktionen nichts mehr importieren. IBAN und
|
||||||
|
* Kontoinhaber frieren dagegen weiterhin pro Aktion ein.
|
||||||
|
*
|
||||||
|
* @param array<string, mixed> $configuration
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
private function eventConfiguration(string $slug, array $configuration): array
|
||||||
|
{
|
||||||
|
return PaymentMethod::stripTenantScopedOptions(
|
||||||
|
$slug,
|
||||||
|
PaymentMethod::sanitizeConfiguration($slug, $configuration),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\ShortSignUp;
|
||||||
|
|
||||||
|
use App\Domains\Event\Actions\SignUp\SignUpCommand;
|
||||||
|
use App\Domains\Event\Actions\SignUp\SignUpRequest;
|
||||||
|
use App\Models\ParentGroup;
|
||||||
|
use App\Models\Tenant;
|
||||||
|
use App\ValueObjects\Age;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verkürzte Anmeldung: ergänzt die nicht erhobenen Pflichtangaben um Platzhalter und übergibt an die reguläre
|
||||||
|
* Anmelde-Action. Dadurch gelten für Kurzanmeldungen dieselben Regeln wie für jede andere Anmeldung
|
||||||
|
* (Transaktion, laufende Rechnungsnummer, eFZ-Vorbelegung, Snapshot der Teilnahmeoptionen).
|
||||||
|
*/
|
||||||
|
class ShortSignUpCommand {
|
||||||
|
/** Platzhalter für Angaben, die die Kurzanmeldung nicht erhebt. */
|
||||||
|
private const string PLACEHOLDER = 'Nicht erforderlich';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Die Postleitzahl bekommt bewusst keinen Text-Platzhalter: aus ihr wird in Teilnehmerliste und CSV-Export
|
||||||
|
* das Bundesland abgeleitet.
|
||||||
|
*/
|
||||||
|
private const string PLACEHOLDER_POSTCODE = '00000';
|
||||||
|
|
||||||
|
public function __construct(public ShortSignUpRequest $request) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute() : ShortSignUpResponse {
|
||||||
|
$response = new ShortSignUpResponse();
|
||||||
|
|
||||||
|
// Ohne konfigurierte Teilnahmegruppe gäbe es keinen gültigen `participation_type` -- sauber abbrechen,
|
||||||
|
// statt in einen Fremdschlüssel-Fehler zu laufen.
|
||||||
|
$participationFee = $this->request->event->firstParticipationFee();
|
||||||
|
if ($participationFee === null) {
|
||||||
|
$response->message = 'Für diese Veranstaltung ist noch keine Teilnahmegruppe hinterlegt.';
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$participationType = $participationFee->type;
|
||||||
|
|
||||||
|
// Nur hinterlegte Beitragsstufen sind wählbar -- für jede andere hätte calculateAmount() keinen Betrag.
|
||||||
|
if (!in_array($this->request->feeType, $participationFee->availableFeeTypes(), true)) {
|
||||||
|
$response->message = 'Der gewählte Beitrag ist für diese Veranstaltung nicht verfügbar.';
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
$participantAge = new Age($this->request->birthday);
|
||||||
|
|
||||||
|
// Bei Minderjährigen ist die Kontaktperson Pflicht; der Client prüft das ebenfalls, verlassen wird sich
|
||||||
|
// darauf nicht.
|
||||||
|
if (!$participantAge->isfullAged()
|
||||||
|
&& ($this->request->contactPerson === null || $this->request->contactEmail === null)) {
|
||||||
|
$response->message = 'Für Minderjährige werden Name und E-Mail-Adresse einer Kontaktperson benötigt.';
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gruppe (Local oder Parent Group, je nach Veranstaltung): bei genau einer Option wird diese gesetzt, bei
|
||||||
|
// mehreren muss gewählt werden, ohne Optionen bleibt die Zuordnung leer.
|
||||||
|
$groupOptions = $this->request->event->participantGroupOptions();
|
||||||
|
$participantGroup = null;
|
||||||
|
|
||||||
|
if ($groupOptions->count() === 1) {
|
||||||
|
$participantGroup = $groupOptions->first();
|
||||||
|
} elseif ($groupOptions->count() > 1) {
|
||||||
|
$participantGroup = $groupOptions->firstWhere('id', $this->request->localGroupId);
|
||||||
|
|
||||||
|
if ($participantGroup === null) {
|
||||||
|
$response->message = sprintf(
|
||||||
|
'Bitte bei „%s" eine Auswahl treffen.',
|
||||||
|
$this->request->event->participantGroupType()->label(),
|
||||||
|
);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$eventResource = $this->request->event->toResource();
|
||||||
|
|
||||||
|
// Zeitraum und Gruppe stehen bei der Kurzanmeldung fest, wählbar ist nur die Beitragsstufe.
|
||||||
|
$amount = $eventResource->calculateAmount(
|
||||||
|
$participationType,
|
||||||
|
$this->request->feeType,
|
||||||
|
$this->request->event->start_date,
|
||||||
|
$this->request->event->end_date,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
$signUpRequest = new SignUpRequest(
|
||||||
|
event: $this->request->event,
|
||||||
|
user_id: $this->request->user_id,
|
||||||
|
firstname: $this->request->firstname,
|
||||||
|
lastname: $this->request->lastname,
|
||||||
|
nickname: $this->request->nickname,
|
||||||
|
participationType: $participationType,
|
||||||
|
localGroup: $participantGroup instanceof Tenant ? $participantGroup : null,
|
||||||
|
birthday: $this->request->birthday,
|
||||||
|
address_1: self::PLACEHOLDER,
|
||||||
|
address_2: null,
|
||||||
|
postcode: self::PLACEHOLDER_POSTCODE,
|
||||||
|
city: self::PLACEHOLDER,
|
||||||
|
email_1: $this->request->email,
|
||||||
|
phone_1: $this->request->phone,
|
||||||
|
email_2: $this->request->contactEmail,
|
||||||
|
phone_2: null,
|
||||||
|
contact_person: $this->request->contactPerson,
|
||||||
|
allergies: $this->request->allergies,
|
||||||
|
intolerances: $this->request->intolerances,
|
||||||
|
medications: null,
|
||||||
|
tetanus_vaccination: null,
|
||||||
|
// Kein Wert der Zuordnung -- der SignUpCommand fällt damit auf "Omnivor" zurück.
|
||||||
|
eating_habit: '',
|
||||||
|
swimming_permission: $this->resolveSwimmingPermission($participantAge),
|
||||||
|
first_aid_permission: $participantAge->isfullAged() ? '-1' : ($this->request->firstAidPermission ?? '-1'),
|
||||||
|
foto_socialmedia: $this->request->foto_socialmedia,
|
||||||
|
foto_print: $this->request->foto_print,
|
||||||
|
foto_webseite: $this->request->foto_webseite,
|
||||||
|
foto_partner: $this->request->foto_partner,
|
||||||
|
foto_intern: $this->request->foto_intern,
|
||||||
|
arrival: $this->request->event->start_date,
|
||||||
|
departure: $this->request->event->end_date,
|
||||||
|
arrival_eating: 1,
|
||||||
|
departure_eating: 2,
|
||||||
|
notes: null,
|
||||||
|
amount: $amount,
|
||||||
|
paymentMethod: $this->request->paymentMethod,
|
||||||
|
paymentOptions: $this->request->paymentOptions,
|
||||||
|
participationOptions: $this->request->participationOptions,
|
||||||
|
addonItems: [],
|
||||||
|
feeType: $this->request->feeType,
|
||||||
|
siblingReduction: false,
|
||||||
|
parentGroup: $participantGroup instanceof ParentGroup ? $participantGroup : null,
|
||||||
|
);
|
||||||
|
|
||||||
|
$signUpResponse = new SignUpCommand($signUpRequest)->execute();
|
||||||
|
|
||||||
|
$response->success = $signUpResponse->success;
|
||||||
|
$response->participant = $signUpResponse->participant;
|
||||||
|
$response->message = $signUpResponse->message;
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bei Volljährigen und wenn die Veranstaltung die Badeerlaubnis nicht abfragt, entscheidet der SignUpCommand
|
||||||
|
* (volljährig => erteilt, nicht abgefragt => keine). Nur die getroffene Auswahl Minderjähriger wird
|
||||||
|
* durchgereicht.
|
||||||
|
*/
|
||||||
|
private function resolveSwimmingPermission(Age $participantAge) : ?string
|
||||||
|
{
|
||||||
|
if ($participantAge->isfullAged() || !$this->request->event->swimming_permission_required) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->request->swimmingPermission;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\ShortSignUp;
|
||||||
|
|
||||||
|
use App\Models\Event;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Eingabedaten der verkürzten Anmeldung -- ausschließlich das, was der Kurz-Wizard tatsächlich erhebt.
|
||||||
|
* Alle übrigen Pflichtangaben des Teilnehmers setzt der Command auf Platzhalter.
|
||||||
|
*/
|
||||||
|
class ShortSignUpRequest {
|
||||||
|
function __construct(
|
||||||
|
public Event $event,
|
||||||
|
public ?int $user_id,
|
||||||
|
public string $firstname,
|
||||||
|
public string $lastname,
|
||||||
|
public ?string $nickname,
|
||||||
|
public DateTime $birthday,
|
||||||
|
public string $email,
|
||||||
|
public string $phone,
|
||||||
|
/**
|
||||||
|
* Tenant-ID des Stamms. Nur gefüllt, wenn die Veranstaltung mehrere teilnehmende Stämme hat --
|
||||||
|
* bei genau einem wird dieser gesetzt, ohne zu fragen.
|
||||||
|
*/
|
||||||
|
public ?int $localGroupId,
|
||||||
|
/** Kontaktperson: nur bei Minderjährigen erhoben. */
|
||||||
|
public ?string $contactPerson,
|
||||||
|
public ?string $contactEmail,
|
||||||
|
public ?string $allergies,
|
||||||
|
public ?string $intolerances,
|
||||||
|
/** Slug aus `first_aid_permissions`; nur bei Minderjährigen erhoben. */
|
||||||
|
public ?string $firstAidPermission,
|
||||||
|
/** Slug aus `swimming_permissions`; nur bei Minderjährigen und nur wenn die Veranstaltung sie abfragt. */
|
||||||
|
public ?string $swimmingPermission,
|
||||||
|
public bool $foto_socialmedia,
|
||||||
|
public bool $foto_print,
|
||||||
|
public bool $foto_webseite,
|
||||||
|
public bool $foto_partner,
|
||||||
|
public bool $foto_intern,
|
||||||
|
public ?string $paymentMethod,
|
||||||
|
public array $paymentOptions = [],
|
||||||
|
/** Antworten auf die Teilnahmeoptionen: [ question_key => value ]. */
|
||||||
|
public array $participationOptions = [],
|
||||||
|
/**
|
||||||
|
* Beitragsstufe (`standard`, `reduced`, `solidarity`). Wählbar nur, wenn die Teilnahmegruppe neben dem
|
||||||
|
* Standardbeitrag weitere Stufen hinterlegt hat; der Command prüft das.
|
||||||
|
*/
|
||||||
|
public string $feeType = 'standard',
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Actions\ShortSignUp;
|
||||||
|
|
||||||
|
use App\Models\EventParticipant;
|
||||||
|
|
||||||
|
class ShortSignUpResponse {
|
||||||
|
public bool $success;
|
||||||
|
public ?EventParticipant $participant;
|
||||||
|
public ?string $message = null;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->success = false;
|
||||||
|
$this->participant = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ namespace App\Domains\Event\Actions\SignUp;
|
|||||||
|
|
||||||
use App\Enumerations\EatingHabit;
|
use App\Enumerations\EatingHabit;
|
||||||
use App\Enumerations\EfzStatus;
|
use App\Enumerations\EfzStatus;
|
||||||
|
use App\Enumerations\SwimmingPermission;
|
||||||
use App\EventPaymentModules\EventPaymentModuleRegistry;
|
use App\EventPaymentModules\EventPaymentModuleRegistry;
|
||||||
use App\ValueObjects\Age;
|
use App\ValueObjects\Age;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -36,11 +37,7 @@ class SignUpCommand {
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
$eatingHabit = match ($this->request->eating_habit) {
|
$eatingHabit = $this->resolveEatingHabit();
|
||||||
'vegan' => EatingHabit::EATING_HABIT_VEGAN,
|
|
||||||
'vegetarian' => EatingHabit::EATING_HABIT_VEGETARIAN,
|
|
||||||
default => EatingHabit::EATING_HABIT_OMNIVOR,
|
|
||||||
};
|
|
||||||
|
|
||||||
$participantAge = new Age($this->request->birthday);
|
$participantAge = new Age($this->request->birthday);
|
||||||
|
|
||||||
@@ -59,7 +56,8 @@ class SignUpCommand {
|
|||||||
'participation_type' => $this->request->participationType,
|
'participation_type' => $this->request->participationType,
|
||||||
'fee_type' => $this->request->feeType,
|
'fee_type' => $this->request->feeType,
|
||||||
'sibling_reduction' => $this->request->siblingReduction,
|
'sibling_reduction' => $this->request->siblingReduction,
|
||||||
'local_group' => $this->request->localGroup->slug,
|
'local_group' => $this->request->localGroup?->slug,
|
||||||
|
'parent_group_id' => $this->request->parentGroup?->id,
|
||||||
'birthday' => $this->request->birthday,
|
'birthday' => $this->request->birthday,
|
||||||
'address_1' => $this->request->address_1,
|
'address_1' => $this->request->address_1,
|
||||||
'address_2' => $this->request->address_2,
|
'address_2' => $this->request->address_2,
|
||||||
@@ -75,9 +73,7 @@ class SignUpCommand {
|
|||||||
'medications' => $this->request->medications,
|
'medications' => $this->request->medications,
|
||||||
'tetanus_vaccination' => $this->request->tetanus_vaccination,
|
'tetanus_vaccination' => $this->request->tetanus_vaccination,
|
||||||
'eating_habit' => $eatingHabit,
|
'eating_habit' => $eatingHabit,
|
||||||
'swimming_permission' => ($participantAge->isfullAged() || $this->request->swimming_permission === '-1')
|
'swimming_permission' => $this->resolveSwimmingPermission($participantAge),
|
||||||
? 'SWIMMING_PERMISSION_ALLOWED'
|
|
||||||
: $this->request->swimming_permission,
|
|
||||||
'first_aid_permission' => ($participantAge->isfullAged() || $this->request->first_aid_permission === '-1')
|
'first_aid_permission' => ($participantAge->isfullAged() || $this->request->first_aid_permission === '-1')
|
||||||
? 'FIRST_AID_PERMISSION_ALLOWED'
|
? 'FIRST_AID_PERMISSION_ALLOWED'
|
||||||
: $this->request->first_aid_permission,
|
: $this->request->first_aid_permission,
|
||||||
@@ -95,7 +91,9 @@ class SignUpCommand {
|
|||||||
'payment_purpose' => $this->request->event->name . ' - Beitrag ' . $this->request->firstname . ' ' . $this->request->lastname,
|
'payment_purpose' => $this->request->event->name . ' - Beitrag ' . $this->request->firstname . ' ' . $this->request->lastname,
|
||||||
'payment_method' => $this->request->paymentMethod,
|
'payment_method' => $this->request->paymentMethod,
|
||||||
'payment_options' => $paymentOptions,
|
'payment_options' => $paymentOptions,
|
||||||
'efz_status' => $participantAge->isfullAged() ? EfzStatus::EFZ_STATUS_NOT_CHECKED : EfzStatus::EFZ_STATUS_NOT_REQUIRED,
|
'efz_status' => $participantAge->isfullAged() && $this->request->event->coc_check_required
|
||||||
|
? EfzStatus::EFZ_STATUS_NOT_CHECKED
|
||||||
|
: EfzStatus::EFZ_STATUS_NOT_REQUIRED,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -109,6 +107,41 @@ class SignUpCommand {
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ernährungsweise auflösen. Übernommen wird nur ein Slug, den die Veranstaltung anbietet; ohne Angabe (z. B. bei
|
||||||
|
* der Kurzanmeldung) oder bei einem nicht angebotenen Wert gilt "Omnivor".
|
||||||
|
*/
|
||||||
|
private function resolveEatingHabit(): string
|
||||||
|
{
|
||||||
|
$slug = $this->request->eating_habit;
|
||||||
|
|
||||||
|
if ($slug !== '' && $this->request->event->eatingHabits()->where('slug', $slug)->exists()) {
|
||||||
|
return $slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EatingHabit::EATING_HABIT_OMNIVOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Badeerlaubnis auflösen. Volljährige brauchen keine Erlaubnis. Für Minderjährige gilt die getroffene Auswahl;
|
||||||
|
* fehlt sie -- weil die Veranstaltung die Badeerlaubnis gar nicht abfragt oder keine Wahl getroffen wurde --,
|
||||||
|
* wird bewusst "Keine" hinterlegt und nicht etwa stillschweigend eine Erlaubnis angenommen.
|
||||||
|
*/
|
||||||
|
private function resolveSwimmingPermission(Age $participantAge): string
|
||||||
|
{
|
||||||
|
if ($participantAge->isfullAged()) {
|
||||||
|
return SwimmingPermission::SWIMMING_PERMISSION_ALLOWED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->request->event->swimming_permission_required
|
||||||
|
|| $this->request->swimming_permission === null
|
||||||
|
|| $this->request->swimming_permission === '-1') {
|
||||||
|
return SwimmingPermission::SWIMMING_PERMISSION_DENIED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->request->swimming_permission;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nächste laufende Nummer des Teilis innerhalb der Veranstaltung -- der letzte Block der
|
* Nächste laufende Nummer des Teilis innerhalb der Veranstaltung -- der letzte Block der
|
||||||
* Rechnungsnummer. Die Event-Zeile wird gesperrt, damit gleichzeitige Anmeldungen derselben
|
* Rechnungsnummer. Die Event-Zeile wird gesperrt, damit gleichzeitige Anmeldungen derselben
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Domains\Event\Actions\SignUp;
|
namespace App\Domains\Event\Actions\SignUp;
|
||||||
|
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
|
use App\Models\ParentGroup;
|
||||||
use App\Models\Tenant;
|
use App\Models\Tenant;
|
||||||
use App\ValueObjects\Amount;
|
use App\ValueObjects\Amount;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
@@ -15,7 +16,8 @@ class SignUpRequest {
|
|||||||
public string $lastname,
|
public string $lastname,
|
||||||
public ?string $nickname,
|
public ?string $nickname,
|
||||||
public string $participationType,
|
public string $participationType,
|
||||||
public Tenant $localGroup,
|
/** Stamm des Teilnehmers; in der Kurzanmeldung nicht erhoben und deshalb optional. */
|
||||||
|
public ?Tenant $localGroup,
|
||||||
public DateTime $birthday,
|
public DateTime $birthday,
|
||||||
public string $address_1,
|
public string $address_1,
|
||||||
public ?string $address_2,
|
public ?string $address_2,
|
||||||
@@ -54,6 +56,8 @@ class SignUpRequest {
|
|||||||
public ?string $feeType = null,
|
public ?string $feeType = null,
|
||||||
/** Ob die 50-%-Geschwisterermäßigung in `amount` eingerechnet ist. */
|
/** Ob die 50-%-Geschwisterermäßigung in `amount` eingerechnet ist. */
|
||||||
public bool $siblingReduction = false,
|
public bool $siblingReduction = false,
|
||||||
|
/** Parent Group -- nur bei Veranstaltungen, die danach statt nach der Local Group fragen. */
|
||||||
|
public ?ParentGroup $parentGroup = null,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Domains\Event\Actions\UpdateEvent;
|
namespace App\Domains\Event\Actions\UpdateEvent;
|
||||||
|
|
||||||
|
use App\Repositories\EventParticipantRepository;
|
||||||
|
|
||||||
class UpdateEventCommand {
|
class UpdateEventCommand {
|
||||||
public UpdateEventRequest $request;
|
public UpdateEventRequest $request;
|
||||||
public function __construct(UpdateEventRequest $request) {
|
public function __construct(UpdateEventRequest $request) {
|
||||||
@@ -13,6 +15,8 @@ class UpdateEventCommand {
|
|||||||
|
|
||||||
$this->request->event->name = $this->request->eventName;
|
$this->request->event->name = $this->request->eventName;
|
||||||
$this->request->event->location = $this->request->eventLocation;
|
$this->request->event->location = $this->request->eventLocation;
|
||||||
|
$this->request->event->street = $this->normalizeOptional($this->request->street);
|
||||||
|
$this->request->event->house_number = $this->normalizeOptional($this->request->houseNumber);
|
||||||
$this->request->event->postal_code = $this->request->postalCode;
|
$this->request->event->postal_code = $this->request->postalCode;
|
||||||
$this->request->event->email = $this->request->email;
|
$this->request->event->email = $this->request->email;
|
||||||
$this->request->event->early_bird_end = $this->request->earlyBirdEnd;
|
$this->request->event->early_bird_end = $this->request->earlyBirdEnd;
|
||||||
@@ -22,6 +26,17 @@ class UpdateEventCommand {
|
|||||||
$this->request->event->support_flat = $this->request->flatSupport;
|
$this->request->event->support_flat = $this->request->flatSupport;
|
||||||
$this->request->event->send_weekly_report = $this->request->sendWeeklyReports;
|
$this->request->event->send_weekly_report = $this->request->sendWeeklyReports;
|
||||||
$this->request->event->registration_allowed = $this->request->registrationAllowed;
|
$this->request->event->registration_allowed = $this->request->registrationAllowed;
|
||||||
|
$this->request->event->short_registration = $this->request->shortRegistration;
|
||||||
|
$this->request->event->swimming_permission_required = $this->request->swimmingPermissionRequired;
|
||||||
|
$this->request->event->coc_check_required = $this->request->cocCheckRequired;
|
||||||
|
|
||||||
|
// Umstellen zwischen Local und Parent Group nur ohne Anmeldungen -- sonst stünden in einer Veranstaltung
|
||||||
|
// beide Arten von Antworten nebeneinander.
|
||||||
|
if ($this->request->participantGroupType !== null
|
||||||
|
&& !new EventParticipantRepository()->existsForEvent($this->request->event)) {
|
||||||
|
$this->request->event->participant_group_type = $this->request->participantGroupType->value;
|
||||||
|
}
|
||||||
|
|
||||||
$this->request->event->save();
|
$this->request->event->save();
|
||||||
|
|
||||||
$this->request->event->resetAllowedEatingHabits();
|
$this->request->event->resetAllowedEatingHabits();
|
||||||
@@ -40,4 +55,15 @@ class UpdateEventCommand {
|
|||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Straße und Hausnummer sind optional. Ein geleertes Eingabefeld liefert einen leeren String --
|
||||||
|
* gespeichert wird dafür `null`, damit „nicht angegeben" nur eine Darstellung hat.
|
||||||
|
*/
|
||||||
|
private function normalizeOptional(?string $value): ?string
|
||||||
|
{
|
||||||
|
$value = trim((string) $value);
|
||||||
|
|
||||||
|
return '' === $value ? null : $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Event\Actions\UpdateEvent;
|
namespace App\Domains\Event\Actions\UpdateEvent;
|
||||||
|
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use App\ValueObjects\Amount;
|
use App\ValueObjects\Amount;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
@@ -10,6 +11,8 @@ class UpdateEventRequest {
|
|||||||
public Event $event;
|
public Event $event;
|
||||||
public string $eventName;
|
public string $eventName;
|
||||||
public string $eventLocation;
|
public string $eventLocation;
|
||||||
|
public ?string $street;
|
||||||
|
public ?string $houseNumber;
|
||||||
public string $postalCode;
|
public string $postalCode;
|
||||||
public string $email;
|
public string $email;
|
||||||
public DateTime $earlyBirdEnd;
|
public DateTime $earlyBirdEnd;
|
||||||
@@ -17,16 +20,25 @@ class UpdateEventRequest {
|
|||||||
public int $alcoholicsAge;
|
public int $alcoholicsAge;
|
||||||
public bool $sendWeeklyReports;
|
public bool $sendWeeklyReports;
|
||||||
public bool $registrationAllowed;
|
public bool $registrationAllowed;
|
||||||
|
public bool $shortRegistration;
|
||||||
|
public bool $swimmingPermissionRequired;
|
||||||
|
public bool $cocCheckRequired;
|
||||||
public Amount $flatSupport;
|
public Amount $flatSupport;
|
||||||
public Amount $supportPerPerson;
|
public Amount $supportPerPerson;
|
||||||
public array $contributingLocalGroups;
|
public array $contributingLocalGroups;
|
||||||
public array $eatingHabits;
|
public array $eatingHabits;
|
||||||
|
/** Wonach bei der Anmeldung gefragt wird; null = unverändert. Greift nur, solange es keine Anmeldungen gibt. */
|
||||||
|
public ?ParticipantGroupType $participantGroupType;
|
||||||
|
|
||||||
public function __construct(Event $event, string $eventName, string $eventLocation, string $postalCode, string $email, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $alcoholicsAge, bool $sendWeeklyReports, bool $registrationAllowed, Amount $flatSupport, Amount $supportPerPerson, array $contributingLocalGroups, array $eatingHabits)
|
public function __construct(Event $event, string $eventName, string $eventLocation, string $postalCode, string $email, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $alcoholicsAge, bool $sendWeeklyReports, bool $registrationAllowed, Amount $flatSupport, Amount $supportPerPerson, array $contributingLocalGroups, array $eatingHabits, bool $shortRegistration = false, bool $swimmingPermissionRequired = true, ?string $street = null, ?string $houseNumber = null, ?ParticipantGroupType $participantGroupType = null, bool $cocCheckRequired = true)
|
||||||
{
|
{
|
||||||
|
$this->participantGroupType = $participantGroupType;
|
||||||
|
$this->cocCheckRequired = $cocCheckRequired;
|
||||||
$this->event = $event;
|
$this->event = $event;
|
||||||
$this->eventName = $eventName;
|
$this->eventName = $eventName;
|
||||||
$this->eventLocation = $eventLocation;
|
$this->eventLocation = $eventLocation;
|
||||||
|
$this->street = $street;
|
||||||
|
$this->houseNumber = $houseNumber;
|
||||||
$this->postalCode = $postalCode;
|
$this->postalCode = $postalCode;
|
||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
$this->earlyBirdEnd = $earlyBirdEnd;
|
$this->earlyBirdEnd = $earlyBirdEnd;
|
||||||
@@ -34,6 +46,8 @@ class UpdateEventRequest {
|
|||||||
$this->alcoholicsAge = $alcoholicsAge;
|
$this->alcoholicsAge = $alcoholicsAge;
|
||||||
$this->sendWeeklyReports = $sendWeeklyReports;
|
$this->sendWeeklyReports = $sendWeeklyReports;
|
||||||
$this->registrationAllowed = $registrationAllowed;
|
$this->registrationAllowed = $registrationAllowed;
|
||||||
|
$this->shortRegistration = $shortRegistration;
|
||||||
|
$this->swimmingPermissionRequired = $swimmingPermissionRequired;
|
||||||
$this->flatSupport = $flatSupport;
|
$this->flatSupport = $flatSupport;
|
||||||
$this->supportPerPerson = $supportPerPerson;
|
$this->supportPerPerson = $supportPerPerson;
|
||||||
$this->contributingLocalGroups = $contributingLocalGroups;
|
$this->contributingLocalGroups = $contributingLocalGroups;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ class UpdateParticipantCommand {
|
|||||||
$p->address_2 = $this->request->address_2;
|
$p->address_2 = $this->request->address_2;
|
||||||
$p->postcode = $this->request->postcode;
|
$p->postcode = $this->request->postcode;
|
||||||
$p->city = $this->request->city;
|
$p->city = $this->request->city;
|
||||||
$p->local_group = $this->request->localgroup;
|
$this->applyParticipantGroup($p);
|
||||||
$p->birthday = DateTime::createFromFormat('Y-m-d', $this->request->birthday);
|
$p->birthday = DateTime::createFromFormat('Y-m-d', $this->request->birthday);
|
||||||
$p->email_1 = $this->request->email_1;
|
$p->email_1 = $this->request->email_1;
|
||||||
$p->phone_1 = $this->request->phone_1;
|
$p->phone_1 = $this->request->phone_1;
|
||||||
$p->contact_person = $this->request->contact_person;
|
$p->contact_person = $this->request->contact_person;
|
||||||
@@ -86,6 +86,29 @@ class UpdateParticipantCommand {
|
|||||||
return $this->response;
|
return $this->response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Übernimmt die gewählte Gruppe -- je nach Veranstaltung die Local Group (Slug) oder die Parent Group (ID).
|
||||||
|
* Angenommen wird nur, was die Veranstaltung zur Auswahl stellt; leer heißt keine Angabe (null, ein leerer
|
||||||
|
* String würde als Fremdschlüssel scheitern).
|
||||||
|
*/
|
||||||
|
private function applyParticipantGroup(EventParticipant $participant): void
|
||||||
|
{
|
||||||
|
$event = $participant->event;
|
||||||
|
$value = trim((string) $this->request->participantGroup);
|
||||||
|
|
||||||
|
if ($event->asksForParentGroup()) {
|
||||||
|
$participant->parent_group_id = $value === ''
|
||||||
|
? null
|
||||||
|
: $event->participantGroupOptions()->firstWhere('id', (int) $value)?->id;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$participant->local_group = $value === ''
|
||||||
|
? null
|
||||||
|
: $event->participantGroupOptions()->firstWhere('slug', $value)?->slug;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ersetzt die zugeordneten Zusätze (Event-Addons) anhand der Auswahl. Bewusst **ohne Preis/Betrag**
|
* Ersetzt die zugeordneten Zusätze (Event-Addons) anhand der Auswahl. Bewusst **ohne Preis/Betrag**
|
||||||
* (amount 0): der Teilnahmebeitrag wird in den Details ohnehin manuell gesetzt. Es wird nur der Titel als
|
* (amount 0): der Teilnahmebeitrag wird in den Details ohnehin manuell gesetzt. Es wird nur der Titel als
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ class UpdateParticipantRequest {
|
|||||||
public ?string $address_2,
|
public ?string $address_2,
|
||||||
public string $postcode,
|
public string $postcode,
|
||||||
public string $city,
|
public string $city,
|
||||||
public string $localgroup,
|
/**
|
||||||
|
* Gewählte Gruppe: Slug der Local Group bzw. ID der Parent Group, je nachdem, wonach die Veranstaltung
|
||||||
|
* fragt. Leer/null = keine Angabe.
|
||||||
|
*/
|
||||||
|
public ?string $participantGroup,
|
||||||
public string $birthday,
|
public string $birthday,
|
||||||
public string $email_1,
|
public string $email_1,
|
||||||
public string $phone_1,
|
public string $phone_1,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class ArchivedEventsController extends CommonController
|
|||||||
'name' => $event->name,
|
'name' => $event->name,
|
||||||
'location' => $event->location,
|
'location' => $event->location,
|
||||||
'postalCode' => $event->postal_code,
|
'postalCode' => $event->postal_code,
|
||||||
|
'fullAddress' => $event->getFullAddress(),
|
||||||
'eventBegin' => $event->start_date->format('d.m.Y'),
|
'eventBegin' => $event->start_date->format('d.m.Y'),
|
||||||
'eventEnd' => $event->end_date->format('d.m.Y'),
|
'eventEnd' => $event->end_date->format('d.m.Y'),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Event\Actions\BookBankStatementPayments\BookBankStatementPaymentsCommand;
|
||||||
|
use App\Domains\Event\Actions\BookBankStatementPayments\BookBankStatementPaymentsRequest;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bucht die in der Prüfansicht bestätigten Zahlungseingänge -- ein Aufruf für alle Zeilen.
|
||||||
|
*/
|
||||||
|
class BankStatementBookController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(int $eventId, Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$event = $this->events->getById($eventId);
|
||||||
|
|
||||||
|
if ($event === null) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => 'Die Veranstaltung wurde nicht gefunden.']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = new BookBankStatementPaymentsCommand(new BookBankStatementPaymentsRequest(
|
||||||
|
event: $event,
|
||||||
|
bookings: (array) $request->input('bookings', []),
|
||||||
|
))->execute();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => $response->success ? 'success' : 'error',
|
||||||
|
'message' => $response->message,
|
||||||
|
'booked' => $response->booked,
|
||||||
|
'skipped' => $response->skipped,
|
||||||
|
'failed' => $response->failed,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Event\Actions\ParseBankStatement\ParseBankStatementCommand;
|
||||||
|
use App\Domains\Event\Actions\ParseBankStatement\ParseBankStatementRequest;
|
||||||
|
use App\Models\PaymentMethod;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nimmt den CSV-Export der Bank entgegen und liefert die Prüfansicht zurück. Gebucht wird hier nichts.
|
||||||
|
*/
|
||||||
|
class BankStatementParseController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(int $eventId, Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$event = $this->events->getById($eventId);
|
||||||
|
|
||||||
|
if ($event === null) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => 'Die Veranstaltung wurde nicht gefunden.']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Das Kontoauszug-Format kommt vom Mandanten, nicht aus dem Event-Snapshot: Ein Bankwechsel
|
||||||
|
// muss sofort auch für laufende Aktionen gelten.
|
||||||
|
$configuration = $this->paymentMethods->tenantConfiguration(PaymentMethod::PAYMENT_ACCOUNT_TRANSACTION);
|
||||||
|
|
||||||
|
$response = new ParseBankStatementCommand(new ParseBankStatementRequest(
|
||||||
|
event: $event,
|
||||||
|
file: $request->file('statement'),
|
||||||
|
configuration: $configuration,
|
||||||
|
))->execute();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => $response->success ? 'success' : 'error',
|
||||||
|
'message' => $response->message,
|
||||||
|
'rows' => $response->rows,
|
||||||
|
'participants' => $response->participants,
|
||||||
|
'skipped' => $response->skippedOlderThanWatermark,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ use App\Domains\Event\Actions\CreateEvent\CreateEventRequest;
|
|||||||
use App\Domains\Event\Actions\SetCostUnit\SetCostUnitCommand;
|
use App\Domains\Event\Actions\SetCostUnit\SetCostUnitCommand;
|
||||||
use App\Domains\Event\Actions\SetCostUnit\SetCostUnitRequest;
|
use App\Domains\Event\Actions\SetCostUnit\SetCostUnitRequest;
|
||||||
use App\Enumerations\CostUnitType;
|
use App\Enumerations\CostUnitType;
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Enumerations\ParticipationFeeType;
|
use App\Enumerations\ParticipationFeeType;
|
||||||
use App\Providers\InertiaProvider;
|
use App\Providers\InertiaProvider;
|
||||||
use App\Resources\EventResource;
|
use App\Resources\EventResource;
|
||||||
@@ -21,13 +22,14 @@ use Illuminate\Http\Request;
|
|||||||
class CreateController extends CommonController {
|
class CreateController extends CommonController {
|
||||||
public function __invoke() {
|
public function __invoke() {
|
||||||
return new InertiaProvider('Event/Create', [
|
return new InertiaProvider('Event/Create', [
|
||||||
'emailAddress' => auth()->user()->email,
|
'emailAddress' => currentUserOrFail()->email,
|
||||||
'eventAccount' => $this->tenant->account_name,
|
'eventAccount' => $this->tenant->account_name,
|
||||||
'eventIban' => $this->tenant->account_iban,
|
'eventIban' => $this->tenant->account_iban,
|
||||||
'eventPayPerDay' => $this->tenant->slug === 'lv' ? true : false,
|
'eventPayPerDay' => $this->tenant->slug === 'lv' ? true : false,
|
||||||
'participationFeeType' => $this->tenant->slug === 'lv' ?
|
'participationFeeType' => $this->tenant->slug === 'lv' ?
|
||||||
ParticipationFeeType::PARTICIPATION_FEE_TYPE_FIXED :
|
ParticipationFeeType::PARTICIPATION_FEE_TYPE_FIXED :
|
||||||
ParticipationFeeType::PARTICIPATION_FEE_TYPE_SOLIDARITY,
|
ParticipationFeeType::PARTICIPATION_FEE_TYPE_SOLIDARITY,
|
||||||
|
'participantGroupTypes' => ParticipantGroupType::options(),
|
||||||
])->render();
|
])->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +58,10 @@ class CreateController extends CommonController {
|
|||||||
$participationFeeType,
|
$participationFeeType,
|
||||||
$request->input('eventAccount'),
|
$request->input('eventAccount'),
|
||||||
$request->input('eventIban'),
|
$request->input('eventIban'),
|
||||||
$payPerDay
|
$payPerDay,
|
||||||
|
$request->input('eventStreet'),
|
||||||
|
$request->input('eventHouseNumber'),
|
||||||
|
ParticipantGroupType::fromStored($request->input('eventParticipantGroupType')),
|
||||||
);
|
);
|
||||||
|
|
||||||
$wasSuccessful = false;
|
$wasSuccessful = false;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use App\Domains\Event\Actions\UpdateEvent\UpdateEventCommand;
|
|||||||
use App\Domains\Event\Actions\UpdateEvent\UpdateEventRequest;
|
use App\Domains\Event\Actions\UpdateEvent\UpdateEventRequest;
|
||||||
use App\Domains\Event\Actions\UpdateManagers\UpdateManagersCommand;
|
use App\Domains\Event\Actions\UpdateManagers\UpdateManagersCommand;
|
||||||
use App\Domains\Event\Actions\UpdateManagers\UpdateManagersRequest;
|
use App\Domains\Event\Actions\UpdateManagers\UpdateManagersRequest;
|
||||||
|
use App\Enumerations\ParticipantGroupType;
|
||||||
use App\Enumerations\ParticipationFeeType;
|
use App\Enumerations\ParticipationFeeType;
|
||||||
use App\Enumerations\ParticipationType;
|
use App\Enumerations\ParticipationType;
|
||||||
use App\Providers\InertiaProvider;
|
use App\Providers\InertiaProvider;
|
||||||
@@ -27,7 +28,10 @@ use Illuminate\Http\Response;
|
|||||||
class DetailsController extends CommonController {
|
class DetailsController extends CommonController {
|
||||||
public function __invoke(string $eventId) {
|
public function __invoke(string $eventId) {
|
||||||
$event = $this->events->getByIdentifier($eventId);
|
$event = $this->events->getByIdentifier($eventId);
|
||||||
return new InertiaProvider('Event/Details', ['event' => $event])->render();
|
return new InertiaProvider('Event/Details', [
|
||||||
|
'event' => $event,
|
||||||
|
'participantGroupLabel' => $event->participantGroupType()->label(),
|
||||||
|
])->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function summary(int $eventId, Request $request) : JsonResponse {
|
public function summary(int $eventId, Request $request) : JsonResponse {
|
||||||
@@ -60,7 +64,13 @@ class DetailsController extends CommonController {
|
|||||||
$flatSupport,
|
$flatSupport,
|
||||||
$supportPerPerson,
|
$supportPerPerson,
|
||||||
$contributinLocalGroups,
|
$contributinLocalGroups,
|
||||||
$eatingHabits
|
$eatingHabits,
|
||||||
|
(bool)$request->input('shortRegistration', false),
|
||||||
|
(bool)$request->input('swimmingPermissionRequired', true),
|
||||||
|
$request->input('street'),
|
||||||
|
$request->input('houseNumber'),
|
||||||
|
ParticipantGroupType::tryFrom((string) $request->input('participantGroupType')),
|
||||||
|
(bool)$request->input('cocCheckRequired', true),
|
||||||
);
|
);
|
||||||
|
|
||||||
$eventUpdateCommand = new UpdateEventCommand($eventUpdateRequest);
|
$eventUpdateCommand = new UpdateEventCommand($eventUpdateRequest);
|
||||||
@@ -181,6 +191,7 @@ class DetailsController extends CommonController {
|
|||||||
'rows' => $participants,
|
'rows' => $participants,
|
||||||
'kitchenRequirements' => $kitchenOverview,
|
'kitchenRequirements' => $kitchenOverview,
|
||||||
'participantsForKitchenList' => $this->eventParticipants->getParticipantsWithIntolerances($event, $request),
|
'participantsForKitchenList' => $this->eventParticipants->getParticipantsWithIntolerances($event, $request),
|
||||||
|
'participantGroupLabel' => $event->participantGroupType()->label(),
|
||||||
])->render();
|
])->render();
|
||||||
|
|
||||||
$pdf = PdfGenerateAndDownloadProvider::fromHtml(
|
$pdf = PdfGenerateAndDownloadProvider::fromHtml(
|
||||||
@@ -204,6 +215,9 @@ class DetailsController extends CommonController {
|
|||||||
$csv = view('csvs.' . $listType, [
|
$csv = view('csvs.' . $listType, [
|
||||||
'event' => $event->name,
|
'event' => $event->name,
|
||||||
'rows' => $participants,
|
'rows' => $participants,
|
||||||
|
// Die Anschriftsspalten beschreiben immer die Local Group, die Gruppenspalte die gewählte Gruppe.
|
||||||
|
'localGroupLabel' => ParticipantGroupType::LocalGroup->label(),
|
||||||
|
'participantGroupLabel' => $event->participantGroupType()->label(),
|
||||||
])->render();
|
])->render();
|
||||||
|
|
||||||
return response($csv, 200, [
|
return response($csv, 200, [
|
||||||
@@ -216,7 +230,7 @@ class DetailsController extends CommonController {
|
|||||||
$event = $this->events->getByIdentifier($eventId);
|
$event = $this->events->getByIdentifier($eventId);
|
||||||
switch ($listType) {
|
switch ($listType) {
|
||||||
case 'by-local-group':
|
case 'by-local-group':
|
||||||
$participants = $this->eventParticipants->groupByLocalGroup($event, $request);
|
$participants = $this->eventParticipants->groupByParticipantGroup($event, $request);
|
||||||
break;
|
break;
|
||||||
case 'by-participation-group':
|
case 'by-participation-group':
|
||||||
$participants = $this->eventParticipants->groupByParticipationType($event, $request);
|
$participants = $this->eventParticipants->groupByParticipationType($event, $request);
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Event\Actions\CreateIncomeSurplusStatement\CreateIncomeSurplusStatementCommand;
|
||||||
|
use App\Domains\Event\Actions\CreateIncomeSurplusStatement\CreateIncomeSurplusStatementRequest;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
|
class IncomeSurplusStatementController extends CommonController
|
||||||
|
{
|
||||||
|
public function __invoke(string $eventId): Response
|
||||||
|
{
|
||||||
|
$event = $this->events->getByIdentifier($eventId);
|
||||||
|
|
||||||
|
if ($event === null) {
|
||||||
|
abort(403, 'Zugriff verweigert.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$statementRequest = new CreateIncomeSurplusStatementRequest($event);
|
||||||
|
$statementCommand = new CreateIncomeSurplusStatementCommand($statementRequest);
|
||||||
|
$statementResponse = $statementCommand->execute();
|
||||||
|
|
||||||
|
if (!$statementResponse->success) {
|
||||||
|
abort(422, $statementResponse->message ?? 'Die EÜR konnte nicht erstellt werden.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return response($statementResponse->pdfContent, 200, [
|
||||||
|
'Content-Type' => 'application/pdf',
|
||||||
|
'Content-Disposition' => 'attachment; filename="' . $statementResponse->filename . '"',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ class ByGroupController extends CommonController
|
|||||||
$recipients = [];
|
$recipients = [];
|
||||||
switch ($groupType) {
|
switch ($groupType) {
|
||||||
case 'by-local-group':
|
case 'by-local-group':
|
||||||
$participants = $this->eventParticipants->groupByLocalGroup($event, $request, $request->input('groupName'));
|
$participants = $this->eventParticipants->groupByParticipantGroup($event, $request, $request->input('groupName'));
|
||||||
$recipients = $this->eventParticipants->getMailAddresses($participants[$request->input('groupName')]);
|
$recipients = $this->eventParticipants->getMailAddresses($participants[$request->input('groupName')]);
|
||||||
break;
|
break;
|
||||||
case 'by-participation-group':
|
case 'by-participation-group':
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class SendController extends CommonController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = auth()->user();
|
$user = currentUser();
|
||||||
$reportSubject = sprintf('Sendebericht für Nachricht mit Betreff "%s"', $subject);
|
$reportSubject = sprintf('Sendebericht für Nachricht mit Betreff "%s"', $subject);
|
||||||
|
|
||||||
Mail::to($user->email)->send(new ManualMailsReportMail(
|
Mail::to($user->email)->send(new ManualMailsReportMail(
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ParticipantUpdateController extends CommonController {
|
|||||||
address_2: $request->input('address_2'),
|
address_2: $request->input('address_2'),
|
||||||
postcode: $request->input('postcode'),
|
postcode: $request->input('postcode'),
|
||||||
city: $request->input('city'),
|
city: $request->input('city'),
|
||||||
localgroup: $request->input('localgroup'),
|
participantGroup: $request->input('participantGroup'),
|
||||||
birthday: $request->input('birthday'),
|
birthday: $request->input('birthday'),
|
||||||
email_1: $request->input('email_1'),
|
email_1: $request->input('email_1'),
|
||||||
phone_1: $request->input('phone_1'),
|
phone_1: $request->input('phone_1'),
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Controllers;
|
||||||
|
|
||||||
|
use App\RelationModels\EventParticipationFee;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use App\ValueObjects\Amount;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Beiträge einer Kurzanmeldung. Teilnahmegruppe und Zeitraum stehen fest; geliefert wird der Betrag je
|
||||||
|
* hinterlegter Beitragsstufe, damit der Client zwischen ihnen wählen kann, ohne erneut zu fragen. Der Endpunkt
|
||||||
|
* braucht keine Eingaben -- berechnet wird der gespeicherte Betrag bei der Anmeldung ohnehin neu.
|
||||||
|
*
|
||||||
|
* `amountValue` der gewählten Stufe steuert im Frontend, ob der Schritt "Zahlungsart" gezeigt wird; mehr als
|
||||||
|
* eine Stufe blendet den Schritt "Beitrag" ein.
|
||||||
|
*/
|
||||||
|
class ShortCalculateAmountController extends CommonController {
|
||||||
|
public function __invoke(int $eventId) : JsonResponse {
|
||||||
|
$event = $this->events->getById($eventId, false);
|
||||||
|
|
||||||
|
$participationFee = $event->firstParticipationFee();
|
||||||
|
$eventResource = $event->toResource();
|
||||||
|
|
||||||
|
$feeTypes = array_map(function (string $feeType) use ($event, $eventResource, $participationFee) {
|
||||||
|
$amount = $participationFee === null
|
||||||
|
? new Amount(0, 'Euro')
|
||||||
|
: $eventResource->calculateAmount(
|
||||||
|
$participationFee->type,
|
||||||
|
$feeType,
|
||||||
|
$event->start_date,
|
||||||
|
$event->end_date,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'value' => $feeType,
|
||||||
|
'label' => EventParticipationFee::FEE_TYPE_LABELS[$feeType],
|
||||||
|
'amount' => $amount->toString(),
|
||||||
|
'amountValue' => $amount->getAmount(),
|
||||||
|
];
|
||||||
|
}, $participationFee?->availableFeeTypes() ?? ['standard']);
|
||||||
|
|
||||||
|
return response()->json(['feeTypes' => $feeTypes]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Event\Controllers;
|
||||||
|
|
||||||
|
use App\Domains\Event\Actions\CertificateOfConductionCheck\CertificateOfConductionCheckCommand;
|
||||||
|
use App\Domains\Event\Actions\CertificateOfConductionCheck\CertificateOfConductionCheckRequest;
|
||||||
|
use App\Domains\Event\Actions\ShortSignUp\ShortSignUpCommand;
|
||||||
|
use App\Domains\Event\Actions\ShortSignUp\ShortSignUpRequest;
|
||||||
|
use App\Enumerations\FirstAidPermission;
|
||||||
|
use App\Enumerations\SwimmingPermission;
|
||||||
|
use App\Mail\ParticipantParticipationMails\EventSignUpSuccessfullMail;
|
||||||
|
use App\Providers\DoubleCheckEventRegistrationProvider;
|
||||||
|
use App\RelationModels\EventParticipationFee;
|
||||||
|
use App\Scopes\CommonController;
|
||||||
|
use DateTime;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nimmt die verkürzte Anmeldung entgegen. Öffentlich erreichbar, deshalb werden die Eingaben hier -- anders als
|
||||||
|
* im langen Prozess -- validiert, bevor sie die Action erreichen.
|
||||||
|
*/
|
||||||
|
class ShortSignupController extends CommonController {
|
||||||
|
public function __invoke(int $eventId, Request $request) : JsonResponse {
|
||||||
|
$event = $this->events->getById($eventId, false);
|
||||||
|
|
||||||
|
if (!$event->registration_allowed || new DateTime() > $event->start_date) {
|
||||||
|
return response()->json(['status' => 'closed'], 403);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Die Kurzanmeldung darf nicht als Abkürzung um den langen Prozess herum benutzt werden.
|
||||||
|
if (!$event->short_registration) {
|
||||||
|
return response()->json(['status' => 'closed'], 403);
|
||||||
|
}
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), [
|
||||||
|
'firstname' => 'required|string|max:255',
|
||||||
|
'lastname' => 'required|string|max:255',
|
||||||
|
'nickname' => 'nullable|string|max:255',
|
||||||
|
'birthday' => 'required|date_format:Y-m-d|before:today',
|
||||||
|
'email' => 'required|email|max:255',
|
||||||
|
'phone' => 'required|string|max:255',
|
||||||
|
// Gegen die teilnehmenden Stämme prüft der Command -- hier reicht die Typprüfung.
|
||||||
|
'localGroup' => 'nullable|integer',
|
||||||
|
'contactPerson' => 'nullable|string|max:255',
|
||||||
|
'contactEmail' => 'nullable|email|max:255',
|
||||||
|
'allergies' => 'nullable|string|max:255',
|
||||||
|
'intolerances' => 'nullable|string|max:255',
|
||||||
|
'firstAidPermission' => ['nullable', 'string', 'in:' . implode(',', FirstAidPermission::query()->pluck('slug')->toArray())],
|
||||||
|
'swimmingPermission' => ['nullable', 'string', 'in:' . implode(',', SwimmingPermission::query()->pluck('slug')->toArray())],
|
||||||
|
'foto' => 'array',
|
||||||
|
'participationOptions' => 'array',
|
||||||
|
'paymentMethod' => 'nullable|string',
|
||||||
|
'paymentOptions' => 'array',
|
||||||
|
// Ob die Stufe für die Teilnahmegruppe hinterlegt ist, prüft der Command.
|
||||||
|
'feeType' => 'nullable|string|in:' . implode(',', array_keys(EventParticipationFee::FEE_TYPE_LABELS)),
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => $validator->errors()->first()], 422);
|
||||||
|
}
|
||||||
|
|
||||||
|
$birthday = DateTime::createFromFormat('Y-m-d', $request->input('birthday'));
|
||||||
|
|
||||||
|
$doubleCheck = new DoubleCheckEventRegistrationProvider(
|
||||||
|
$event,
|
||||||
|
$request->input('firstname'),
|
||||||
|
$request->input('lastname'),
|
||||||
|
$request->input('email'),
|
||||||
|
$birthday
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($doubleCheck->isRegistered()) {
|
||||||
|
return response()->json(['status' => 'exists']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$foto = (array)$request->input('foto', []);
|
||||||
|
|
||||||
|
$shortSignUpRequest = new ShortSignUpRequest(
|
||||||
|
event: $event,
|
||||||
|
user_id: currentUser()?->id,
|
||||||
|
firstname: $request->input('firstname'),
|
||||||
|
lastname: $request->input('lastname'),
|
||||||
|
nickname: $request->input('nickname'),
|
||||||
|
birthday: $birthday,
|
||||||
|
email: $request->input('email'),
|
||||||
|
phone: $request->input('phone'),
|
||||||
|
localGroupId: $request->input('localGroup') !== null ? (int)$request->input('localGroup') : null,
|
||||||
|
contactPerson: $request->input('contactPerson') ?: null,
|
||||||
|
contactEmail: $request->input('contactEmail') ?: null,
|
||||||
|
allergies: $request->input('allergies') ?: null,
|
||||||
|
intolerances: $request->input('intolerances') ?: null,
|
||||||
|
firstAidPermission: $request->input('firstAidPermission') ?: null,
|
||||||
|
swimmingPermission: $request->input('swimmingPermission') ?: null,
|
||||||
|
foto_socialmedia: (bool)($foto['socialmedia'] ?? false),
|
||||||
|
foto_print: (bool)($foto['print'] ?? false),
|
||||||
|
foto_webseite: (bool)($foto['webseite'] ?? false),
|
||||||
|
foto_partner: (bool)($foto['partner'] ?? false),
|
||||||
|
foto_intern: (bool)($foto['intern'] ?? false),
|
||||||
|
paymentMethod: $request->input('paymentMethod') ?: null,
|
||||||
|
paymentOptions: (array)$request->input('paymentOptions', []),
|
||||||
|
participationOptions: (array)$request->input('participationOptions', []),
|
||||||
|
feeType: $request->input('feeType') ?: 'standard',
|
||||||
|
);
|
||||||
|
|
||||||
|
$shortSignUpResponse = new ShortSignUpCommand($shortSignUpRequest)->execute();
|
||||||
|
|
||||||
|
if (!$shortSignUpResponse->success) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => $shortSignUpResponse->message], 422);
|
||||||
|
}
|
||||||
|
|
||||||
|
$participant = $shortSignUpResponse->participant;
|
||||||
|
|
||||||
|
$cocResponse = new CertificateOfConductionCheckCommand(
|
||||||
|
new CertificateOfConductionCheckRequest($participant)
|
||||||
|
)->execute();
|
||||||
|
|
||||||
|
$participant->efz_status = $cocResponse->status;
|
||||||
|
$participant->save();
|
||||||
|
|
||||||
|
Mail::to($participant->email_1)->send(new EventSignUpSuccessfullMail(participant: $participant));
|
||||||
|
|
||||||
|
if ($participant->email_2 !== null) {
|
||||||
|
Mail::to($participant->email_2)->send(new EventSignUpSuccessfullMail(participant: $participant));
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'participant' => $participant->toResource()->toArray($request),
|
||||||
|
'status' => 'success',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ use App\Domains\Event\Actions\CertificateOfConductionCheck\CertificateOfConducti
|
|||||||
use App\Domains\Event\Actions\SignUp\SignUpCommand;
|
use App\Domains\Event\Actions\SignUp\SignUpCommand;
|
||||||
use App\Domains\Event\Actions\SignUp\SignUpRequest;
|
use App\Domains\Event\Actions\SignUp\SignUpRequest;
|
||||||
use App\Mail\ParticipantParticipationMails\EventSignUpSuccessfullMail;
|
use App\Mail\ParticipantParticipationMails\EventSignUpSuccessfullMail;
|
||||||
|
use App\Models\ParentGroup;
|
||||||
use App\Models\Tenant;
|
use App\Models\Tenant;
|
||||||
use App\Providers\DoubleCheckEventRegistrationProvider;
|
use App\Providers\DoubleCheckEventRegistrationProvider;
|
||||||
use App\Providers\InertiaProvider;
|
use App\Providers\InertiaProvider;
|
||||||
@@ -35,8 +36,9 @@ class SignupController extends CommonController {
|
|||||||
'lastname' => '',
|
'lastname' => '',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (auth()->check()) {
|
$currentUser = currentUser();
|
||||||
$user = new UserResource(auth()->user())->toArray($request);
|
if ($currentUser !== null) {
|
||||||
|
$user = new UserResource($currentUser)->toArray($request);
|
||||||
|
|
||||||
$participantData = [
|
$participantData = [
|
||||||
'id' => $user['id'],
|
'id' => $user['id'],
|
||||||
@@ -64,7 +66,7 @@ class SignupController extends CommonController {
|
|||||||
$inertiaProvider = new InertiaProvider('Event/Signup', [
|
$inertiaProvider = new InertiaProvider('Event/Signup', [
|
||||||
'event' => $event,
|
'event' => $event,
|
||||||
'availableEvents' => $availableEvents,
|
'availableEvents' => $availableEvents,
|
||||||
'localGroups' => $event['contributingLocalGroups'],
|
'localGroups' => $event['participantGroupOptions'] ?? [],
|
||||||
'participantData' => $participantData,
|
'participantData' => $participantData,
|
||||||
]);
|
]);
|
||||||
return $inertiaProvider->render();
|
return $inertiaProvider->render();
|
||||||
@@ -110,6 +112,15 @@ class SignupController extends CommonController {
|
|||||||
$addonResolution = $eventResource->resolveAddons($selectedAddonKeys, $arrival, $departure);
|
$addonResolution = $eventResource->resolveAddons($selectedAddonKeys, $arrival, $departure);
|
||||||
$amount->addAmount($addonResolution['total']);
|
$amount->addAmount($addonResolution['total']);
|
||||||
|
|
||||||
|
// Gewählt wird eine der Optionen der Veranstaltung (Local oder Parent Group); anderes wird abgelehnt.
|
||||||
|
$participantGroup = $event->participantGroupOptions()->firstWhere('id', (int)($registrationData['localGroup'] ?? 0));
|
||||||
|
if ($participantGroup === null) {
|
||||||
|
return response()->json([
|
||||||
|
'status' => 'error',
|
||||||
|
'message' => sprintf('Bitte bei „%s" eine Auswahl treffen.', $event->participantGroupType()->label()),
|
||||||
|
], 422);
|
||||||
|
}
|
||||||
|
|
||||||
$signupRequest = new SignUpRequest(
|
$signupRequest = new SignUpRequest(
|
||||||
$event,
|
$event,
|
||||||
$registrationData['userId'] ?? null,
|
$registrationData['userId'] ?? null,
|
||||||
@@ -117,7 +128,7 @@ class SignupController extends CommonController {
|
|||||||
$registrationData['nachname'],
|
$registrationData['nachname'],
|
||||||
$registrationData['pfadiname'],
|
$registrationData['pfadiname'],
|
||||||
$registrationData['participationType'],
|
$registrationData['participationType'],
|
||||||
Tenant::findOrFail($registrationData['localGroup']),
|
$participantGroup instanceof Tenant ? $participantGroup : null,
|
||||||
\DateTime::createFromFormat('Y-m-d', $registrationData['geburtsdatum']),
|
\DateTime::createFromFormat('Y-m-d', $registrationData['geburtsdatum']),
|
||||||
$registrationData['address1'],
|
$registrationData['address1'],
|
||||||
$registrationData['address2'],
|
$registrationData['address2'],
|
||||||
@@ -132,7 +143,7 @@ class SignupController extends CommonController {
|
|||||||
$registrationData['intolerances'],
|
$registrationData['intolerances'],
|
||||||
$registrationData['medikamente'],
|
$registrationData['medikamente'],
|
||||||
$tetanusVaccination,
|
$tetanusVaccination,
|
||||||
$registrationData['essgewohnheit'],
|
$registrationData['eatingHabit'] ?? '',
|
||||||
$registrationData['badeerlaubnis'],
|
$registrationData['badeerlaubnis'],
|
||||||
$registrationData['first_aid'],
|
$registrationData['first_aid'],
|
||||||
$registrationData['foto']['socialmedia'],
|
$registrationData['foto']['socialmedia'],
|
||||||
@@ -152,6 +163,7 @@ class SignupController extends CommonController {
|
|||||||
$addonResolution['items'],
|
$addonResolution['items'],
|
||||||
$registrationData['beitrag'],
|
$registrationData['beitrag'],
|
||||||
$siblingReduction,
|
$siblingReduction,
|
||||||
|
$participantGroup instanceof ParentGroup ? $participantGroup : null,
|
||||||
);
|
);
|
||||||
|
|
||||||
$signupCommand = new SignUpCommand($signupRequest);
|
$signupCommand = new SignUpCommand($signupRequest);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Domains\Event\Controllers\BankStatementBookController;
|
||||||
|
use App\Domains\Event\Controllers\BankStatementParseController;
|
||||||
use App\Domains\Event\Controllers\CreateController;
|
use App\Domains\Event\Controllers\CreateController;
|
||||||
use App\Domains\Event\Controllers\DetailsController;
|
use App\Domains\Event\Controllers\DetailsController;
|
||||||
use App\Domains\Event\Controllers\EventArchiveController;
|
use App\Domains\Event\Controllers\EventArchiveController;
|
||||||
@@ -14,6 +16,8 @@ use App\Domains\Event\Controllers\ParticipantReSignOnController;
|
|||||||
use App\Domains\Event\Controllers\ParticipantSignOffController;
|
use App\Domains\Event\Controllers\ParticipantSignOffController;
|
||||||
use App\Domains\Event\Controllers\ParticipantUpdateController;
|
use App\Domains\Event\Controllers\ParticipantUpdateController;
|
||||||
use App\Domains\Event\Controllers\PaymentReminderController;
|
use App\Domains\Event\Controllers\PaymentReminderController;
|
||||||
|
use App\Domains\Event\Controllers\ShortCalculateAmountController;
|
||||||
|
use App\Domains\Event\Controllers\ShortSignupController;
|
||||||
use App\Domains\Event\Controllers\SignupController;
|
use App\Domains\Event\Controllers\SignupController;
|
||||||
use App\Middleware\IdentifyTenant;
|
use App\Middleware\IdentifyTenant;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@@ -25,6 +29,9 @@ Route::prefix('api/v1')
|
|||||||
Route::post('{eventId}/calculate-amount', [SignupController::class, 'calculateAmount']);
|
Route::post('{eventId}/calculate-amount', [SignupController::class, 'calculateAmount']);
|
||||||
Route::post('{eventId}/signup', [SignupController::class, 'signUp']);
|
Route::post('{eventId}/signup', [SignupController::class, 'signUp']);
|
||||||
|
|
||||||
|
Route::post('{eventId}/short-calculate-amount', ShortCalculateAmountController::class);
|
||||||
|
Route::post('{eventId}/short-signup', ShortSignupController::class);
|
||||||
|
|
||||||
Route::middleware(['auth'])->group(function () {
|
Route::middleware(['auth'])->group(function () {
|
||||||
Route::post('/create', [CreateController::class, 'doCreate']);
|
Route::post('/create', [CreateController::class, 'doCreate']);
|
||||||
|
|
||||||
@@ -48,6 +55,9 @@ Route::prefix('api/v1')
|
|||||||
Route::post('/payment-methods', [DetailsController::class, 'updatePaymentMethods']);
|
Route::post('/payment-methods', [DetailsController::class, 'updatePaymentMethods']);
|
||||||
Route::post('/participation-options', [DetailsController::class, 'updateParticipationOptions']);
|
Route::post('/participation-options', [DetailsController::class, 'updateParticipationOptions']);
|
||||||
Route::post('/event-addons', [DetailsController::class, 'updateEventAddons']);
|
Route::post('/event-addons', [DetailsController::class, 'updateEventAddons']);
|
||||||
|
|
||||||
|
Route::post('/bank-statement/parse', BankStatementParseController::class);
|
||||||
|
Route::post('/bank-statement/book', BankStatementBookController::class);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ use App\Domains\Event\Controllers\ArchivedEventsController;
|
|||||||
use App\Domains\Event\Controllers\AvailableEventsController;
|
use App\Domains\Event\Controllers\AvailableEventsController;
|
||||||
use App\Domains\Event\Controllers\CreateController;
|
use App\Domains\Event\Controllers\CreateController;
|
||||||
use App\Domains\Event\Controllers\DetailsController;
|
use App\Domains\Event\Controllers\DetailsController;
|
||||||
|
use App\Domains\Event\Controllers\IncomeSurplusStatementController;
|
||||||
use App\Domains\Event\Controllers\SignupController;
|
use App\Domains\Event\Controllers\SignupController;
|
||||||
use App\Middleware\IdentifyTenant;
|
use App\Middleware\IdentifyTenant;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@@ -18,6 +19,10 @@ Route::middleware(IdentifyTenant::class)->group(function () {
|
|||||||
|
|
||||||
Route::middleware(['auth'])->group(function () {
|
Route::middleware(['auth'])->group(function () {
|
||||||
Route::get('/details/{eventId}', DetailsController::class);
|
Route::get('/details/{eventId}', DetailsController::class);
|
||||||
|
|
||||||
|
// Vor der Wildcard darunter: Sonst greift `downloadPdfList()` und sucht ein Blade namens
|
||||||
|
// `income-surplus-statement` mit Teilnehmendendaten, die die EÜR gar nicht braucht.
|
||||||
|
Route::get('/details/{eventId}/pdf/income-surplus-statement', IncomeSurplusStatementController::class);
|
||||||
Route::get('/details/{eventId}/pdf/{listType}', [DetailsController::class, 'downloadPdfList']);
|
Route::get('/details/{eventId}/pdf/{listType}', [DetailsController::class, 'downloadPdfList']);
|
||||||
Route::get('/details/{eventId}/csv/{listType}', [DetailsController::class, 'downloadCsvList']);
|
Route::get('/details/{eventId}/csv/{listType}', [DetailsController::class, 'downloadCsvList']);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ async function unarchiveEvent(eventId) {
|
|||||||
<div>
|
<div>
|
||||||
<h2 style="margin: 0 0 4px 0; font-size: 1.1rem; font-weight: 600;">{{ event.name }}</h2>
|
<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;">
|
<span style="color: #6b7280; font-size: 0.875rem;">
|
||||||
{{ event.postalCode }} {{ event.location }}
|
{{ event.fullAddress }}
|
||||||
·
|
·
|
||||||
{{ event.eventBegin }} – {{ event.eventEnd }}
|
{{ event.eventBegin }} – {{ event.eventEnd }}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
'eventIban': String,
|
'eventIban': String,
|
||||||
"eventPayPerDay": Boolean,
|
"eventPayPerDay": Boolean,
|
||||||
"participationFeeType": String,
|
"participationFeeType": String,
|
||||||
|
"participantGroupTypes": {type: Array, default: () => []},
|
||||||
})
|
})
|
||||||
|
|
||||||
const errors = reactive({})
|
const errors = reactive({})
|
||||||
@@ -23,6 +24,8 @@
|
|||||||
eventName: '',
|
eventName: '',
|
||||||
eventPostalCode: '',
|
eventPostalCode: '',
|
||||||
eventLocation: '',
|
eventLocation: '',
|
||||||
|
eventStreet: '',
|
||||||
|
eventHouseNumber: '',
|
||||||
eventEmail: props.emailAddress ? props.emailAddress : '',
|
eventEmail: props.emailAddress ? props.emailAddress : '',
|
||||||
eventBegin: '',
|
eventBegin: '',
|
||||||
eventEnd: '',
|
eventEnd: '',
|
||||||
@@ -33,6 +36,7 @@
|
|||||||
eventIban: props.eventIban ? props.eventIban : '',
|
eventIban: props.eventIban ? props.eventIban : '',
|
||||||
eventPayPerDay: props.eventPayPerDay ? props.eventPayPerDay : false,
|
eventPayPerDay: props.eventPayPerDay ? props.eventPayPerDay : false,
|
||||||
eventParticipationFeeType: props.participationFeeType ? props.participationFeeType : 'fixed',
|
eventParticipationFeeType: props.participationFeeType ? props.participationFeeType : 'fixed',
|
||||||
|
eventParticipantGroupType: 'local_group',
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@@ -145,6 +149,8 @@
|
|||||||
eventName: formData.eventName,
|
eventName: formData.eventName,
|
||||||
eventPostalCode: formData.eventPostalCode,
|
eventPostalCode: formData.eventPostalCode,
|
||||||
eventLocation: formData.eventLocation,
|
eventLocation: formData.eventLocation,
|
||||||
|
eventStreet: formData.eventStreet,
|
||||||
|
eventHouseNumber: formData.eventHouseNumber,
|
||||||
eventEmail: formData.eventEmail,
|
eventEmail: formData.eventEmail,
|
||||||
eventBegin: formData.eventBegin,
|
eventBegin: formData.eventBegin,
|
||||||
eventEnd: formData.eventEnd,
|
eventEnd: formData.eventEnd,
|
||||||
@@ -155,6 +161,7 @@
|
|||||||
eventIban: formData.eventIban,
|
eventIban: formData.eventIban,
|
||||||
eventPayPerDay: formData.eventPayPerDay,
|
eventPayPerDay: formData.eventPayPerDay,
|
||||||
eventParticipationFeeType: formData.eventParticipationFeeType,
|
eventParticipationFeeType: formData.eventParticipationFeeType,
|
||||||
|
eventParticipantGroupType: formData.eventParticipantGroupType,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -195,6 +202,16 @@
|
|||||||
<ErrorText :message="errors.eventLocation" /></td>
|
<ErrorText :message="errors.eventLocation" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr style="vertical-align: top;">
|
||||||
|
<th class="width-medium pr-20 height-50">Straße (optional)</th>
|
||||||
|
<td class="height-50"><input type="text" v-model="formData.eventStreet" class="width-half-full" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr style="vertical-align: top;">
|
||||||
|
<th class="width-medium pr-20 height-50">Hausnummer (optional)</th>
|
||||||
|
<td class="height-50"><input type="text" v-model="formData.eventHouseNumber" class="width-half-full" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr style="vertical-align: top;">
|
<tr style="vertical-align: top;">
|
||||||
<th class="width-medium pr-20 height-50">Postleitzahl des Veranstaltungsorts</th>
|
<th class="width-medium pr-20 height-50">Postleitzahl des Veranstaltungsorts</th>
|
||||||
<td class="height-50"><input type="text" v-model="formData.eventPostalCode" class="width-half-full" />
|
<td class="height-50"><input type="text" v-model="formData.eventPostalCode" class="width-half-full" />
|
||||||
@@ -242,6 +259,15 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr style="vertical-align: top;">
|
||||||
|
<th class="width-medium pr-20 height-50">Bei der Anmeldung abfragen</th>
|
||||||
|
<td class="height-50">
|
||||||
|
<select v-model="formData.eventParticipantGroupType" class="width-half-full">
|
||||||
|
<option v-for="type in props.participantGroupTypes" :key="type.value" :value="type.value">{{ type.label }}</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<tr style="vertical-align: top;">
|
<tr style="vertical-align: top;">
|
||||||
<th class="width-medium pr-20 height-50">Preiserhöhung nach Early-Bird-Phase</th>
|
<th class="width-medium pr-20 height-50">Preiserhöhung nach Early-Bird-Phase</th>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import Overview from "./Partials/Overview.vue";
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
event: Object,
|
event: Object,
|
||||||
|
participantGroupLabel: {type: String, default: 'Stamm'},
|
||||||
})
|
})
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
@@ -24,7 +25,7 @@ const tabs = [
|
|||||||
endpoint: "/api/v1/event/details/" + props.event.identifier + '/participants/all',
|
endpoint: "/api/v1/event/details/" + props.event.identifier + '/participants/all',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Teilis nach Stamm',
|
title: 'Teilis nach ' + props.participantGroupLabel,
|
||||||
component: ParticipantsList,
|
component: ParticipantsList,
|
||||||
endpoint: "/api/v1/event/details/" + props.event.identifier + '/participants/by-local-group',
|
endpoint: "/api/v1/event/details/" + props.event.identifier + '/participants/by-local-group',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const props = defineProps({
|
|||||||
<div class="available-event-header">
|
<div class="available-event-header">
|
||||||
<div>
|
<div>
|
||||||
<h2 class="available-event-title">{{ event.name }}</h2>
|
<h2 class="available-event-title">{{ event.name }}</h2>
|
||||||
<span class="available-event-location">{{ event.postalCode }} {{ event.location }}</span>
|
<span class="available-event-location">{{ event.fullAddress }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
v-if="event.registrationAllowed"
|
v-if="event.registrationAllowed"
|
||||||
@@ -47,7 +47,7 @@ const props = defineProps({
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Veranstaltungsort</th>
|
<th>Veranstaltungsort</th>
|
||||||
<td>{{ event.postalCode }} {{ event.location }}</td>
|
<td>{{ event.fullAddress }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Frühbuchen bis</th>
|
<th>Frühbuchen bis</th>
|
||||||
|
|||||||
@@ -0,0 +1,635 @@
|
|||||||
|
<script setup>
|
||||||
|
import {computed, ref} from 'vue'
|
||||||
|
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";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zahlungseingänge aus dem CSV-Export der Bank einbuchen.
|
||||||
|
*
|
||||||
|
* Zwei Schritte: Datei einlesen (der Server ordnet zu und schlägt vor), dann die Prüfansicht
|
||||||
|
* bestätigen. Gebucht wird erst im zweiten Schritt und für alle Zeilen in einem Aufruf.
|
||||||
|
*/
|
||||||
|
const props = defineProps({
|
||||||
|
event: {type: Object, required: true},
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['close', 'booked'])
|
||||||
|
|
||||||
|
const {request} = useAjax()
|
||||||
|
|
||||||
|
const fileInput = ref(null)
|
||||||
|
const fileName = ref('')
|
||||||
|
const parsing = ref(false)
|
||||||
|
const booking = ref(false)
|
||||||
|
|
||||||
|
const rows = ref([])
|
||||||
|
const participants = ref([])
|
||||||
|
// rowNumber -> identifier ('' = ignorieren)
|
||||||
|
const assignment = ref({})
|
||||||
|
const parsed = ref(false)
|
||||||
|
const skipped = ref(0)
|
||||||
|
|
||||||
|
const assignedCount = computed(
|
||||||
|
() => rows.value.filter(row => isAssigned(row)).length,
|
||||||
|
)
|
||||||
|
|
||||||
|
const openCount = computed(() => rows.value.length - assignedCount.value)
|
||||||
|
|
||||||
|
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] ?? '') !== ''
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Der sichtbare Button klickt das versteckte Datei-Element -- wie beim Beleg-Upload der Abrechnung. */
|
||||||
|
function chooseFile() {
|
||||||
|
fileInput.value?.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Auswählen und Einlesen sind ein Schritt: Ein zweiter Klick brächte nichts zu entscheiden. */
|
||||||
|
async function onFileChosen(event) {
|
||||||
|
const file = event.target.files?.[0] ?? null
|
||||||
|
if (file === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fileName.value = file.name
|
||||||
|
await readStatement(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function readStatement(file) {
|
||||||
|
parsing.value = true
|
||||||
|
try {
|
||||||
|
const form = new FormData()
|
||||||
|
form.append('statement', file)
|
||||||
|
|
||||||
|
const response = await request(
|
||||||
|
'/api/v1/event/details/' + props.event.id + '/bank-statement/parse',
|
||||||
|
{method: 'POST', body: form},
|
||||||
|
)
|
||||||
|
|
||||||
|
if (response?.status !== 'success') {
|
||||||
|
toast.error(response?.message ?? 'Die Datei konnte nicht gelesen werden.')
|
||||||
|
reset()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rows.value = response.rows ?? []
|
||||||
|
participants.value = response.participants ?? []
|
||||||
|
skipped.value = response.skipped ?? 0
|
||||||
|
// Vorschläge sind vorbelegt, aber nichts ist entschieden -- gebucht wird nur, was hier
|
||||||
|
// stehen bleibt.
|
||||||
|
assignment.value = Object.fromEntries(
|
||||||
|
rows.value.map(row => [row.rowNumber, row.suggestedIdentifier ?? '']),
|
||||||
|
)
|
||||||
|
parsed.value = true
|
||||||
|
} finally {
|
||||||
|
parsing.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function bookPayments() {
|
||||||
|
const bookings = rows.value
|
||||||
|
.filter(row => isAssigned(row))
|
||||||
|
.map(row => ({
|
||||||
|
participantIdentifier: assignment.value[row.rowNumber],
|
||||||
|
rowNumber: row.rowNumber,
|
||||||
|
paymentDate: row.paymentDate,
|
||||||
|
amount: row.amount,
|
||||||
|
payerName: row.payerName,
|
||||||
|
payerIban: row.payerIban,
|
||||||
|
purpose: row.purpose,
|
||||||
|
}))
|
||||||
|
|
||||||
|
if (bookings.length === 0) {
|
||||||
|
toast.error('Es ist keine Zahlung zugeordnet.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
booking.value = true
|
||||||
|
try {
|
||||||
|
const response = await request(
|
||||||
|
'/api/v1/event/details/' + props.event.id + '/bank-statement/book',
|
||||||
|
{method: 'POST', body: {bookings}},
|
||||||
|
)
|
||||||
|
|
||||||
|
if (response?.status !== 'success') {
|
||||||
|
toast.error(response?.message ?? 'Die Zahlungen konnten nicht gebucht werden.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
toast.success(response.message)
|
||||||
|
emit('booked')
|
||||||
|
emit('close')
|
||||||
|
} finally {
|
||||||
|
booking.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
rows.value = []
|
||||||
|
participants.value = []
|
||||||
|
assignment.value = {}
|
||||||
|
parsed.value = false
|
||||||
|
skipped.value = 0
|
||||||
|
fileName.value = ''
|
||||||
|
if (fileInput.value) fileInput.value.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
function assignedParticipant(row) {
|
||||||
|
return participantsByIdentifier.value[assignment.value[row.rowNumber]] ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Der Zustand einer Zeile: was gebucht wird, was noch offen ist, was geprüft gehört. */
|
||||||
|
function rowState(row) {
|
||||||
|
if (!isAssigned(row)) {
|
||||||
|
return row.suggestedIdentifier === null
|
||||||
|
? {key: 'unmatched', label: 'Keine Zuordnung', icon: 'circle-question'}
|
||||||
|
: {key: 'ignored', label: 'Ignoriert', icon: 'ban'}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (assignment.value[row.rowNumber] !== row.suggestedIdentifier) {
|
||||||
|
return {key: 'manual', label: 'Von Hand', icon: 'user-pen'}
|
||||||
|
}
|
||||||
|
|
||||||
|
return row.confidence === 'unsicher'
|
||||||
|
? {key: 'uncertain', label: 'Bitte prüfen', icon: 'triangle-exclamation'}
|
||||||
|
: {key: 'certain', label: 'Vorschlag', icon: 'check'}
|
||||||
|
}
|
||||||
|
|
||||||
|
function lastPaymentOf(row) {
|
||||||
|
return assignedParticipant(row)?.lastPaymentDate ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Eine Zahlung auf eine abgemeldete Anmeldung zieht eine Erstattung nach sich. */
|
||||||
|
function signedOffOf(row) {
|
||||||
|
const participant = assignedParticipant(row)
|
||||||
|
|
||||||
|
return participant?.isSignedOff === true ? participant : null
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FullScreenModal :show="true" @close="emit('close')">
|
||||||
|
<div class="import">
|
||||||
|
<header class="import-header">
|
||||||
|
<h2>Zahlungseingänge einlesen</h2>
|
||||||
|
<p class="subtitle">{{ event.name }}</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- Schritt 1: Datei wählen. Das Datei-Element bleibt versteckt, geklickt wird der Button. -->
|
||||||
|
<div v-if="!parsed" class="dropzone">
|
||||||
|
<Icon name="file-csv" class="dropzone-icon"/>
|
||||||
|
<p class="dropzone-title">Kontoauszug als CSV hochladen</p>
|
||||||
|
<p class="dropzone-note">
|
||||||
|
Der Export wird nur gelesen und nicht gespeichert. Gebucht wird anschließend
|
||||||
|
ausschließlich das, was ihr in der Prüfansicht bestätigt.
|
||||||
|
</p>
|
||||||
|
<input type="button" value="Kontoauszug auswählen" @click="chooseFile"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input ref="fileInput" type="file" accept=".csv,text/csv,text/plain"
|
||||||
|
style="display: none" @change="onFileChosen"/>
|
||||||
|
|
||||||
|
<template v-if="parsed">
|
||||||
|
<div class="filebar">
|
||||||
|
<span class="filename"><Icon name="file-csv"/> {{ fileName }}</span>
|
||||||
|
<label class="link" @click="reset">Andere Datei wählen</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="rows.length > 0" class="stats">
|
||||||
|
<div class="stat stat-assigned">
|
||||||
|
<span class="stat-value">{{ assignedCount }}</span>
|
||||||
|
<span class="stat-label">wird gebucht</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat" :class="{'stat-open': openCount > 0}">
|
||||||
|
<span class="stat-value">{{ openCount }}</span>
|
||||||
|
<span class="stat-label">nicht zugeordnet</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="skipped > 0" class="stat">
|
||||||
|
<span class="stat-value">{{ skipped }}</span>
|
||||||
|
<span class="stat-label">bereits erfasst</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="rows.length === 0" class="empty">
|
||||||
|
<Icon name="circle-check" class="empty-icon"/>
|
||||||
|
<p>
|
||||||
|
In dieser Datei sind keine offenen Zahlungseingänge zu dieser Aktion enthalten.
|
||||||
|
<template v-if="skipped > 0">
|
||||||
|
{{ skipped }} Zahlungen wurden bereits früher eingebucht.
|
||||||
|
</template>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table v-else class="statement-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Buchung</th>
|
||||||
|
<th class="right">Betrag</th>
|
||||||
|
<th>Zahler*in</th>
|
||||||
|
<th>Verwendungszweck</th>
|
||||||
|
<th class="assignment-column">Zuordnung</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="row in rows" :key="row.rowNumber" :class="'state-' + rowState(row).key">
|
||||||
|
<td class="nowrap">{{ row.paymentDateFormatted }}</td>
|
||||||
|
<td class="right amount">{{ row.amountFormatted }}</td>
|
||||||
|
<td>
|
||||||
|
<span class="payer">{{ row.payerName || '—' }}</span>
|
||||||
|
<span v-if="row.payerIban" class="iban">{{ row.payerIban }}</span>
|
||||||
|
</td>
|
||||||
|
<td class="purpose">{{ row.purpose }}</td>
|
||||||
|
<td>
|
||||||
|
<div class="assignment">
|
||||||
|
<RichSelectBox v-model="assignment[row.rowNumber]"
|
||||||
|
:options="participantOptions"
|
||||||
|
placeholder="— ignorieren —"
|
||||||
|
filterable/>
|
||||||
|
<span class="pill" :class="'pill-' + rowState(row).key">
|
||||||
|
<Icon :key="rowState(row).icon" :name="rowState(row).icon"/> {{ rowState(row).label }}
|
||||||
|
</span>
|
||||||
|
<span v-if="signedOffOf(row)" class="pill pill-signedoff">
|
||||||
|
<Icon name="user-slash"/> Abgemeldet
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span v-if="signedOffOf(row)" class="hint hint-warning">
|
||||||
|
Am {{ signedOffOf(row).signedOffAt }} abgemeldet — die Zahlung wird
|
||||||
|
erfasst, danach steht eine Erstattung an.
|
||||||
|
</span>
|
||||||
|
<span v-if="lastPaymentOf(row)" class="hint">
|
||||||
|
Zuletzt erfasst: {{ lastPaymentOf(row) }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<footer v-if="rows.length > 0" class="actions">
|
||||||
|
<span class="actions-note">
|
||||||
|
Die Teilnehmenden erhalten je Buchung die gewohnte Zahlungsmail.
|
||||||
|
</span>
|
||||||
|
<input type="button" class="accept-button"
|
||||||
|
:value="assignedCount === 1 ? '1 Zahlung einbuchen' : assignedCount + ' Zahlungen einbuchen'"
|
||||||
|
:disabled="assignedCount === 0 || booking"
|
||||||
|
@click="bookPayments"/>
|
||||||
|
</footer>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Beim Buchen geht je Zahlung eine Mail an die Teilnehmenden raus, und zwar synchron --
|
||||||
|
bei achtzig Buchungen dauert der Aufruf entsprechend. -->
|
||||||
|
<LoadingModal v-if="parsing || booking" :show="true"
|
||||||
|
:message="booking
|
||||||
|
? 'Die Zahlungen werden gebucht und die Teilnehmenden benachrichtigt. Das kann einen Moment dauern …'
|
||||||
|
: 'Der Kontoauszug wird gelesen …'"/>
|
||||||
|
</FullScreenModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.import {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.import-header {
|
||||||
|
border-bottom: 1px solid #e5e7eb;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.import-header h2 {
|
||||||
|
margin: 0;
|
||||||
|
color: #1d4899;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
margin: 2px 0 0 0;
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Schritt 1: Datei wählen ───────────────────────────────────────────── */
|
||||||
|
|
||||||
|
.dropzone {
|
||||||
|
border: 2px dashed #c7d2e8;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fafbfe;
|
||||||
|
padding: 48px 24px;
|
||||||
|
text-align: center;
|
||||||
|
max-width: 620px;
|
||||||
|
margin: 40px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropzone-icon {
|
||||||
|
font-size: 2.6rem;
|
||||||
|
color: #809dd5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropzone-title {
|
||||||
|
margin: 14px 0 6px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.05rem;
|
||||||
|
color: #374151;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropzone-note {
|
||||||
|
margin: 0 auto 22px auto;
|
||||||
|
max-width: 440px;
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Schritt 2: Prüfansicht ────────────────────────────────────────────── */
|
||||||
|
|
||||||
|
.filebar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 8px 12px;
|
||||||
|
background-color: #f9fafb;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filename {
|
||||||
|
color: #374151;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin: 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat {
|
||||||
|
flex: 1 1 130px;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 10px 14px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
display: block;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #374151;
|
||||||
|
line-height: 1.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
display: block;
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-assigned {
|
||||||
|
border-color: #508c4c;
|
||||||
|
background-color: #f3faf3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-assigned .stat-value {
|
||||||
|
color: #2f6b2c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-open .stat-value {
|
||||||
|
color: #92400e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
text-align: center;
|
||||||
|
color: #6b7280;
|
||||||
|
padding: 40px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-icon {
|
||||||
|
font-size: 2rem;
|
||||||
|
color: #508c4c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statement-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statement-table th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 8px 10px;
|
||||||
|
background-color: #f9fafb;
|
||||||
|
color: #374151;
|
||||||
|
border-bottom: 2px solid #d1d5db;
|
||||||
|
font-size: 0.82rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.03em;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statement-table td {
|
||||||
|
padding: 10px;
|
||||||
|
border-bottom: 1px solid #e5e7eb;
|
||||||
|
vertical-align: top;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statement-table .right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nowrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.amount {
|
||||||
|
white-space: nowrap;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #374151;
|
||||||
|
}
|
||||||
|
|
||||||
|
.assignment-column {
|
||||||
|
width: 360px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Zeilenfarbe sagt auf einen Blick, was passiert: grün wird gebucht, gelb will geprüft werden,
|
||||||
|
grau bleibt liegen. */
|
||||||
|
.state-certain td,
|
||||||
|
.state-manual td {
|
||||||
|
background-color: #f6fdf7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state-uncertain td {
|
||||||
|
background-color: #fffbeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state-ignored td,
|
||||||
|
.state-unmatched td {
|
||||||
|
background-color: #fbfbfb;
|
||||||
|
color: #9ca3af;
|
||||||
|
}
|
||||||
|
|
||||||
|
.payer {
|
||||||
|
display: block;
|
||||||
|
color: #374151;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iban {
|
||||||
|
display: block;
|
||||||
|
color: #9ca3af;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purpose {
|
||||||
|
max-width: 320px;
|
||||||
|
word-break: break-word;
|
||||||
|
color: #4b5563;
|
||||||
|
}
|
||||||
|
|
||||||
|
.assignment {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.pill {
|
||||||
|
align-self: flex-start;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
padding: 2px 9px;
|
||||||
|
border-radius: 11px;
|
||||||
|
font-size: 0.72rem;
|
||||||
|
font-weight: bold;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-certain {
|
||||||
|
color: #2f6b2c;
|
||||||
|
background-color: #dcfce7;
|
||||||
|
border-color: #86c884;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-manual {
|
||||||
|
color: #1d4899;
|
||||||
|
background-color: #e4ecfb;
|
||||||
|
border-color: #809dd5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-uncertain {
|
||||||
|
color: #92400e;
|
||||||
|
background-color: #fef3c7;
|
||||||
|
border-color: #d9b45c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-ignored,
|
||||||
|
.pill-unmatched {
|
||||||
|
color: #6b7280;
|
||||||
|
background-color: #f3f4f6;
|
||||||
|
border-color: #d1d5db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill-signedoff {
|
||||||
|
color: #9a3412;
|
||||||
|
background-color: #ffedd5;
|
||||||
|
border-color: #e0a06a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
display: block;
|
||||||
|
color: #9ca3af;
|
||||||
|
font-size: 0.72rem;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint-warning {
|
||||||
|
color: #9a3412;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 16px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 20px;
|
||||||
|
padding-top: 16px;
|
||||||
|
border-top: 1px solid #e5e7eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions-note {
|
||||||
|
color: #6b7280;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions input[disabled] {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Schmale Bildschirme ───────────────────────────────────────────────── */
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.assignment-column {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statement-table th {
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purpose {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -16,8 +16,13 @@ const emit = defineEmits(['close'])
|
|||||||
const dynmicProps = reactive({
|
const dynmicProps = reactive({
|
||||||
localGroups: [],
|
localGroups: [],
|
||||||
eatingHabits:[],
|
eatingHabits:[],
|
||||||
|
participantGroupTypes: [],
|
||||||
|
localGroupLabelPlural: 'Stämme',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Umstellen zwischen Local und Parent Group nur, solange es keine Anmeldungen gibt.
|
||||||
|
const participantGroupTypeLocked = (props.event.totalParticipantCount ?? 0) > 0
|
||||||
|
|
||||||
const contributingLocalGroups = ref([])
|
const contributingLocalGroups = ref([])
|
||||||
const eatingHabits = ref([]);
|
const eatingHabits = ref([]);
|
||||||
|
|
||||||
@@ -27,6 +32,8 @@ const emit = defineEmits(['close'])
|
|||||||
contributingLocalGroups: contributingLocalGroups.value,
|
contributingLocalGroups: contributingLocalGroups.value,
|
||||||
eventName: props.event.name,
|
eventName: props.event.name,
|
||||||
eventLocation: props.event.location,
|
eventLocation: props.event.location,
|
||||||
|
street: props.event.street ?? '',
|
||||||
|
houseNumber: props.event.houseNumber ?? '',
|
||||||
postalCode: props.event.postalCode,
|
postalCode: props.event.postalCode,
|
||||||
email: props.event.email,
|
email: props.event.email,
|
||||||
earlyBirdEnd: props.event.earlyBirdEnd.internal,
|
earlyBirdEnd: props.event.earlyBirdEnd.internal,
|
||||||
@@ -35,8 +42,12 @@ const emit = defineEmits(['close'])
|
|||||||
eatingHabits: eatingHabits.value,
|
eatingHabits: eatingHabits.value,
|
||||||
sendWeeklyReports: props.event.sendWeeklyReports,
|
sendWeeklyReports: props.event.sendWeeklyReports,
|
||||||
registrationAllowed: props.event.registrationAllowed,
|
registrationAllowed: props.event.registrationAllowed,
|
||||||
|
shortRegistration: props.event.shortRegistration,
|
||||||
|
swimmingPermissionRequired: props.event.swimmingPermissionRequired,
|
||||||
|
cocCheckRequired: props.event.cocCheckRequired,
|
||||||
flatSupport: props.event.flatSupportEdit,
|
flatSupport: props.event.flatSupportEdit,
|
||||||
supportPerson: props.event.supportPersonIndex,
|
supportPerson: props.event.supportPersonIndex,
|
||||||
|
participantGroupType: props.event.participantGroupType ?? 'local_group',
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -57,6 +68,8 @@ const emit = defineEmits(['close'])
|
|||||||
body: {
|
body: {
|
||||||
eventName: formData.eventName,
|
eventName: formData.eventName,
|
||||||
eventLocation: formData.eventLocation,
|
eventLocation: formData.eventLocation,
|
||||||
|
street: formData.street,
|
||||||
|
houseNumber: formData.houseNumber,
|
||||||
postalCode: formData.postalCode,
|
postalCode: formData.postalCode,
|
||||||
email: formData.email,
|
email: formData.email,
|
||||||
earlyBirdEnd: formData.earlyBirdEnd,
|
earlyBirdEnd: formData.earlyBirdEnd,
|
||||||
@@ -64,10 +77,14 @@ const emit = defineEmits(['close'])
|
|||||||
alcoholicsAge: formData.alcoholicsAge,
|
alcoholicsAge: formData.alcoholicsAge,
|
||||||
sendWeeklyReports: formData.sendWeeklyReports,
|
sendWeeklyReports: formData.sendWeeklyReports,
|
||||||
registrationAllowed: formData.registrationAllowed,
|
registrationAllowed: formData.registrationAllowed,
|
||||||
|
shortRegistration: formData.shortRegistration,
|
||||||
|
swimmingPermissionRequired: formData.swimmingPermissionRequired,
|
||||||
|
cocCheckRequired: formData.cocCheckRequired,
|
||||||
flatSupport: formData.flatSupport,
|
flatSupport: formData.flatSupport,
|
||||||
supportPerson: formData.supportPerson,
|
supportPerson: formData.supportPerson,
|
||||||
contributingLocalGroups: contributingLocalGroups.value,
|
contributingLocalGroups: contributingLocalGroups.value,
|
||||||
eatingHabits: eatingHabits.value,
|
eatingHabits: eatingHabits.value,
|
||||||
|
participantGroupType: formData.participantGroupType,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -105,6 +122,20 @@ const emit = defineEmits(['close'])
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th>Straße (optional)</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" v-model="formData.street" class="width-full" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th>Hausnummer (optional)</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" v-model="formData.houseNumber" class="width-full" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>Postleitzahl des Veranstaltungsorts</th>
|
<th>Postleitzahl des Veranstaltungsorts</th>
|
||||||
<td>
|
<td>
|
||||||
@@ -151,6 +182,18 @@ const emit = defineEmits(['close'])
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th>Bei der Anmeldung abfragen</th>
|
||||||
|
<td>
|
||||||
|
<select v-model="formData.participantGroupType" class="width-full" :disabled="participantGroupTypeLocked">
|
||||||
|
<option v-for="type in dynmicProps.participantGroupTypes" :key="type.value" :value="type.value">{{ type.label }}</option>
|
||||||
|
</select>
|
||||||
|
<span v-if="participantGroupTypeLocked" style="font-size: 0.8rem; color: #6b7280;">
|
||||||
|
Nicht mehr änderbar, da bereits Anmeldungen vorliegen.
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>Mindestalter für Alkoholkonsum</th>
|
<th>Mindestalter für Alkoholkonsum</th>
|
||||||
<td>
|
<td>
|
||||||
@@ -172,6 +215,37 @@ const emit = defineEmits(['close'])
|
|||||||
<label for="registrationAllowed">Veranstaltung ist für Anmeldungen geöffnet</label>
|
<label for="registrationAllowed">Veranstaltung ist für Anmeldungen geöffnet</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input type="checkbox" v-model="formData.shortRegistration" id="shortRegistration" />
|
||||||
|
<label for="shortRegistration">Verkürzte Anmeldung verwenden</label><br />
|
||||||
|
<span style="font-size: 0.8rem; color: #6b7280;">
|
||||||
|
Fragt nur die nötigsten Daten ab (Name, Kontakt, Allergien, Foto-Erlaubnis).
|
||||||
|
Nicht erhobene Angaben wie Anschrift und An-/Abreise werden automatisch gefüllt.
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input type="checkbox" v-model="formData.swimmingPermissionRequired" id="swimmingPermissionRequired" />
|
||||||
|
<label for="swimmingPermissionRequired">Badeerlaubnis abfragen</label><br />
|
||||||
|
<span style="font-size: 0.8rem; color: #6b7280;">
|
||||||
|
Ist die Abfrage deaktiviert, wird für Minderjährige „Keine Badeerlaubnis" hinterlegt.
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input type="checkbox" v-model="formData.cocCheckRequired" id="cocCheckRequired" />
|
||||||
|
<label for="cocCheckRequired">Erweitertes Führungszeugnis (eFZ) prüfen</label><br />
|
||||||
|
<span style="font-size: 0.8rem; color: #6b7280;">
|
||||||
|
Ist die Prüfung deaktiviert, wird das eFZ bei neuen Anmeldungen als „Nicht erforderlich" hinterlegt.
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
@@ -180,7 +254,7 @@ const emit = defineEmits(['close'])
|
|||||||
<div class="right">
|
<div class="right">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Teilnehmende Stämme</th>
|
<th>Teilnehmende {{ dynmicProps.localGroupLabelPlural }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="localGroup in dynmicProps.localGroups">
|
<tr v-for="localGroup in dynmicProps.localGroups">
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import EventAddons from "./EventAddons.vue";
|
|||||||
import ParticipationSummary from "./ParticipationSummary.vue";
|
import ParticipationSummary from "./ParticipationSummary.vue";
|
||||||
import CommonSettings from "./CommonSettings.vue";
|
import CommonSettings from "./CommonSettings.vue";
|
||||||
import EventManagement from "./EventManagement.vue";
|
import EventManagement from "./EventManagement.vue";
|
||||||
|
import BankStatementImport from "./BankStatementImport.vue";
|
||||||
import Modal from "../../../../Views/Components/Modal.vue";
|
import Modal from "../../../../Views/Components/Modal.vue";
|
||||||
import MailCompose from "./MailCompose.vue";
|
import MailCompose from "./MailCompose.vue";
|
||||||
import FullScreenModal from "../../../../Views/Components/FullScreenModal.vue";
|
import FullScreenModal from "../../../../Views/Components/FullScreenModal.vue";
|
||||||
@@ -21,6 +22,12 @@ const props = defineProps({
|
|||||||
|
|
||||||
const displayData = ref('main');
|
const displayData = ref('main');
|
||||||
const showEventData = ref(false);
|
const showEventData = ref(false);
|
||||||
|
const showBankStatement = ref(false);
|
||||||
|
|
||||||
|
// Nach dem Buchen stimmen die Beitragsstände der Übersicht nicht mehr -- neu laden.
|
||||||
|
async function bankStatementBooked() {
|
||||||
|
await showMain();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async function showMain() {
|
async function showMain() {
|
||||||
@@ -106,6 +113,10 @@ async function showEventAddons() {
|
|||||||
<input type="button" value="Beitragsliste (PDF)" />
|
<input type="button" value="Beitragsliste (PDF)" />
|
||||||
</a><br/>
|
</a><br/>
|
||||||
|
|
||||||
|
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/income-surplus-statement'">
|
||||||
|
<input type="button" value="EüR (PDF)" />
|
||||||
|
</a><br/>
|
||||||
|
|
||||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/drinking-list'">
|
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/drinking-list'">
|
||||||
<input type="button" value="Getränkeliste (PDF)" />
|
<input type="button" value="Getränkeliste (PDF)" />
|
||||||
</a><br/>
|
</a><br/>
|
||||||
@@ -113,9 +124,18 @@ async function showEventAddons() {
|
|||||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
||||||
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
||||||
</a><br/>
|
</a><br/>
|
||||||
|
|
||||||
|
<input type="button" value="Zahlungseingänge einlesen" @click="showBankStatement = true" /><br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Liegt außerhalb der displayData-Umschaltung: Der Import ist ein Vollbild-Dialog über der
|
||||||
|
Übersicht, keine Unter-Ansicht, und soll auch aus einer Unter-Ansicht heraus erreichbar sein. -->
|
||||||
|
<BankStatementImport v-if="showBankStatement && dynamicProps.event"
|
||||||
|
:event="dynamicProps.event"
|
||||||
|
@close="showBankStatement = false"
|
||||||
|
@booked="bankStatementBooked" />
|
||||||
|
|
||||||
<ParticipationFees v-if="displayData === 'participationFees'" :event="dynamicProps.event" @close="showMain" />
|
<ParticipationFees v-if="displayData === 'participationFees'" :event="dynamicProps.event" @close="showMain" />
|
||||||
<ParticipationOptions v-else-if="displayData === 'participationOptions'" :event="dynamicProps.event"
|
<ParticipationOptions v-else-if="displayData === 'participationOptions'" :event="dynamicProps.event"
|
||||||
@close="showMain"/>
|
@close="showMain"/>
|
||||||
@@ -143,6 +163,10 @@ async function showEventAddons() {
|
|||||||
<input type="button" value="Beitragsliste (PDF)" />
|
<input type="button" value="Beitragsliste (PDF)" />
|
||||||
</a><br/>
|
</a><br/>
|
||||||
|
|
||||||
|
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/income-surplus-statement'">
|
||||||
|
<input type="button" value="EüR (PDF)" />
|
||||||
|
</a><br/>
|
||||||
|
|
||||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/drinking-list'">
|
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/drinking-list'">
|
||||||
<input type="button" value="Getränkeliste (PDF)" />
|
<input type="button" value="Getränkeliste (PDF)" />
|
||||||
</a><br/>
|
</a><br/>
|
||||||
@@ -150,6 +174,7 @@ async function showEventAddons() {
|
|||||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
||||||
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
||||||
</a><br/>
|
</a><br/>
|
||||||
|
<input type="button" value="Zahlungseingänge einlesen" @click="showBankStatement = true" /><br/>
|
||||||
<input type="button" @click="sendPaymentReminder" class="fix-button" value="Zahlungserinnerung senden" /><br/>
|
<input type="button" @click="sendPaymentReminder" class="fix-button" value="Zahlungserinnerung senden" /><br/>
|
||||||
<input type="button" class="deny-button" value="Letzte Mahnung senden" style="display: none" /><br/>
|
<input type="button" class="deny-button" value="Letzte Mahnung senden" style="display: none" /><br/>
|
||||||
<input type="button" value="Rundmail senden" @click="mailToGroup" /><br/>
|
<input type="button" value="Rundmail senden" @click="mailToGroup" /><br/>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const form = reactive({
|
|||||||
address_2: '',
|
address_2: '',
|
||||||
postcode: '',
|
postcode: '',
|
||||||
city: '',
|
city: '',
|
||||||
localgroup: '',
|
participantGroup: '',
|
||||||
birthday: '',
|
birthday: '',
|
||||||
email_1: '',
|
email_1: '',
|
||||||
phone_1: '',
|
phone_1: '',
|
||||||
@@ -71,6 +71,9 @@ const form = reactive({
|
|||||||
// Teilnahmeoptionen des Events (Definition mit Titel/Frage/Optionen).
|
// Teilnahmeoptionen des Events (Definition mit Titel/Frage/Optionen).
|
||||||
const participationQuestions = computed(() => staticProps.event?.participationOptions ?? []);
|
const participationQuestions = computed(() => staticProps.event?.participationOptions ?? []);
|
||||||
|
|
||||||
|
// Bezeichnung der gewählten Gruppe (z. B. „Stamm" oder „Bund"), je nach Einstellung der Veranstaltung.
|
||||||
|
const localGroupLabel = computed(() => staticProps.event?.participantGroupLabel ?? 'Stamm');
|
||||||
|
|
||||||
// Zusatzoptionen (Event-Addons) des Events.
|
// Zusatzoptionen (Event-Addons) des Events.
|
||||||
const eventAddons = computed(() => staticProps.event?.addons ?? []);
|
const eventAddons = computed(() => staticProps.event?.addons ?? []);
|
||||||
|
|
||||||
@@ -95,7 +98,7 @@ watch(
|
|||||||
form.address_2 = participant?.address_2 ?? '';
|
form.address_2 = participant?.address_2 ?? '';
|
||||||
form.postcode = participant?.postcode ?? '';
|
form.postcode = participant?.postcode ?? '';
|
||||||
form.city = participant?.city ?? '';
|
form.city = participant?.city ?? '';
|
||||||
form.localgroup = participant?.local_group ?? '';
|
form.participantGroup = participant?.participantGroupValue ?? '';
|
||||||
form.birthday = participant?.birthdayDate ?? '';
|
form.birthday = participant?.birthdayDate ?? '';
|
||||||
form.email_1 = participant?.email_1 ?? '';
|
form.email_1 = participant?.email_1 ?? '';
|
||||||
form.phone_1 = participant?.phone_1 ?? '';
|
form.phone_1 = participant?.phone_1 ?? '';
|
||||||
@@ -229,11 +232,12 @@ function saveParticipant() {
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>Stamm</th>
|
<th>{{ localGroupLabel }}</th>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="!staticProps.editMode">{{ props.participant.localgroup }}</span>
|
<span v-if="!staticProps.editMode">{{ props.participant.participantGroup }}</span>
|
||||||
<select v-else v-model="form.localgroup">
|
<select v-else v-model="form.participantGroup">
|
||||||
<option v-for="group in staticProps.event.contributingLocalGroups" :key="group.id" :value="group.slug">{{ group.name }}</option>
|
<option value="">Keine Angabe</option>
|
||||||
|
<option v-for="group in staticProps.event.participantGroupOptions" :key="group.id" :value="group.value">{{ group.name }}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -386,7 +390,17 @@ function saveParticipant() {
|
|||||||
Bankverbindung des Teilis
|
Bankverbindung des Teilis
|
||||||
</small>
|
</small>
|
||||||
<small v-else-if="props.participant.refund.status === 'accepted'">
|
<small v-else-if="props.participant.refund.status === 'accepted'">
|
||||||
bestätigt am {{ props.participant.refund.acceptedAt }}
|
bestätigt am {{ props.participant.refund.acceptedAt }}<template
|
||||||
|
v-if="props.participant.refund.donation"
|
||||||
|
> – gespendet, keine Auszahlung</template>
|
||||||
|
</small>
|
||||||
|
|
||||||
|
<!-- Was beim Verband geblieben ist und warum. -->
|
||||||
|
<small v-if="props.participant.refund.hasRetention" class="retention-note">
|
||||||
|
<br />Einbehalten: {{ props.participant.refund.retainedAmount }} –
|
||||||
|
{{ props.participant.refund.retentionReasonLabel }}<template
|
||||||
|
v-if="props.participant.refund.retentionReasonNote"
|
||||||
|
> ({{ props.participant.refund.retentionReasonNote }})</template>
|
||||||
</small>
|
</small>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -541,4 +555,8 @@ textarea {
|
|||||||
select {
|
select {
|
||||||
width: 262px;
|
width: 262px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.retention-note {
|
||||||
|
color: #8a6d00;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loaded 100 of 288 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user