Direct payments for invoices

Events can be moved to archive and moved back
Fixed validation
This commit is contained in:
2026-05-12 16:04:15 +02:00
parent e2fb616565
commit 0cf9602958
42 changed files with 851 additions and 132 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ class CostUnitResource {
$amounts = [];
$overAllAmount = new Amount(0, 'Euro');
foreach (InvoiceType::all() as $invoiceType) {
foreach (InvoiceType::orderBy('sort_order')->get() as $invoiceType) {
$overAllAmount->addAmount($costUnitRepository->sumupByInvoiceType($this->costUnit, $invoiceType));
$amounts[$invoiceType->slug]['string'] = $costUnitRepository->sumupByInvoiceType($this->costUnit, $invoiceType)->toString();
$amounts[$invoiceType->slug]['name'] = $invoiceType->name;
+1 -2
View File
@@ -32,11 +32,10 @@ class EventResource extends JsonResource{
'email' => $this->event->email,
'accountOwner' => $this->event->account_owner,
'accountIban' => $this->event->account_iban,
'accountOwner' => $this->event->account_owner,
'accountIban' => $this->event->account_iban,
'alcoholicsAge' => $this->event->alcoholics_age,
'sendWeeklyReports' => $this->event->send_weekly_report,
'registrationAllowed' => $this->event->registration_allowed,
'archived' => $this->event->archived,
'earlyBirdEnd' => ['internal' => $this->event->early_bird_end->format('Y-m-d'), 'formatted' => $this->event->early_bird_end->format('d.m.Y')],
'registrationFinalEnd' => ['internal' => $this->event->registration_final_end->format('Y-m-d'), 'formatted' => $this->event->registration_final_end->format('d.m.Y')],
'refundAfterEarlyBirdEnd' => 100 - $this->event->early_bird_end_amount_increase,
+3 -2
View File
@@ -38,7 +38,8 @@ class InvoiceResource {
$returnData['amount'] = Amount::fromString($this->invoice->amount, ' Euro')->toString();
$returnData['id'] = $this->invoice->id;
$returnData['donation'] = $this->invoice->donation;
$returnData['alreadyPaid'] = !$this->invoice->donation && null === $this->invoice->contact_bank_iban;
$returnData['externalPayment'] = null !== $this->invoice->payment_purpose;
$returnData['paymentPurpose'] = $this->invoice->payment_purpose ?? 'Auslagenerstattung Rechnungsnummer ' . $returnData['invoiceNumber'];
$returnData['accountOwner'] = $this->invoice->contact_bank_owner ?? '--';
$returnData['accountIban'] = $this->invoice->contact_bank_iban ?? '--';
$returnData['status'] = $this->invoice->status;
@@ -67,7 +68,7 @@ class InvoiceResource {
$returnData['approvedBy'] = $this->invoice->approvedBy()->first()->username ?? '--';
}
$returnData['alreadyPaid'] = $returnData['alreadyPaid'] == '' ? 0 : 1;
$returnData['externalPayment'] = $returnData['externalPayment'] == '' ? 0 : 1;
return $returnData;
}