diff --git a/app/Livewire/EinundzwanzigPlebTable.php b/app/Livewire/EinundzwanzigPlebTable.php index d36aaeb..32f705c 100644 --- a/app/Livewire/EinundzwanzigPlebTable.php +++ b/app/Livewire/EinundzwanzigPlebTable.php @@ -49,6 +49,7 @@ final class EinundzwanzigPlebTable extends PowerGridComponent return EinundzwanzigPleb::query() ->with([ 'profile', + 'paymentEvents' => fn($query) => $query->where('year', date('Y')), ]) ->where('association_status', '>', 1) ->orWhereNotNull('application_for'); @@ -74,6 +75,11 @@ final class EinundzwanzigPlebTable extends PowerGridComponent $model->application_for, )->label() . '' : '', ) + ->add( + 'payment', + fn(EinundzwanzigPleb $model) + => $model->paymentEvents->count() > 0 ? $model->paymentEvents->first()->amount : 'keine Zahlung vorhanden', + ) ->add( 'npub', fn(EinundzwanzigPleb $model) @@ -112,6 +118,9 @@ final class EinundzwanzigPlebTable extends PowerGridComponent ->visibleInExport( visible: true) ->sortable(), + Column::make('Beitrag ' . date('Y'), 'payment') + ->visibleInExport( visible: true), + Column::make('Bewirbt sich für', 'for', 'application_for') ->visibleInExport( visible: false) ->sortable(), diff --git a/database/migrations/2024_09_30_131604_add_paid_field_to_payment_events_table.php b/database/migrations/2024_09_30_131604_add_paid_field_to_payment_events_table.php new file mode 100644 index 0000000..bdf03dd --- /dev/null +++ b/database/migrations/2024_09_30_131604_add_paid_field_to_payment_events_table.php @@ -0,0 +1,28 @@ +boolean('paid')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('payment_events', function (Blueprint $table) { + // + }); + } +}; diff --git a/resources/views/components/detail.blade.php b/resources/views/components/detail.blade.php index a5fe684..7ce67e9 100644 --- a/resources/views/components/detail.blade.php +++ b/resources/views/components/detail.blade.php @@ -1,14 +1,60 @@ -
|
+ Satoshis
+ |
+
+
+ ||
|---|---|---|
|
+ {{ $payment->amount }}
+ |
+
+ {{ $payment->year }}
+ |
+
+ {{ $payment->event_id }}
+ |
+