feat: add payment tracking to user profiles

- Added a check to update the 'paid' status of a user's paymentEvents if the current year's payment has been made
- Updated the user profile view to display past payments
- Added 'paymentEvents' to the query in EinundzwanzigPlebTable.php to fetch the current year's payments
- Added a 'payment' column to the table in EinundzwanzigPlebTable.php to display the amount of the user's current year's payment
This commit is contained in:
fsociety
2024-09-30 15:22:33 +02:00
parent 0bdd890dd3
commit 65fb920150
4 changed files with 99 additions and 12 deletions

View File

@@ -126,6 +126,10 @@ $searchPaymentEvent = function () {
fn($yearPaid) => $yearPaid['year'] == date('Y') && $yearPaid['amount'] == $this->amountToPay,
);
if ($this->currentYearIsPaid) {
$this->currentPleb->paymentEvents->first()->update(['paid' => true]);
}
$this->paid = true;
}
};