Moved bank transfer logic to special module
This commit is contained in:
@@ -27,6 +27,8 @@ class EventParticipantResource extends JsonResource
|
||||
$amountLeft->subtractAmount($this->resource->amount_paid);
|
||||
}
|
||||
|
||||
$paymentSummary = $this->resource->paymentSummary();
|
||||
|
||||
$presenceDays = $this->resource->arrival_date->diff($this->resource->departure_date)->days;
|
||||
if ($presenceDays === 0) {
|
||||
$presenceDays = 1;
|
||||
@@ -57,6 +59,12 @@ class EventParticipantResource extends JsonResource
|
||||
'needs_payment' => $this->resource->amount->getAmount() > 0
|
||||
&& $this->resource->payment_method === PaymentMethod::PAYMENT_ACCOUNT_TRANSACTION
|
||||
&& $this->resource->amount_paid?->getAmount() < $this->resource->amount->getAmount(),
|
||||
'paymentSummary' => [
|
||||
'hasPaymentInformation' => $paymentSummary->hasPaymentInformation,
|
||||
'lines' => $paymentSummary->lines,
|
||||
'html' => $paymentSummary->html,
|
||||
'showGiroCode' => $paymentSummary->showGiroCode,
|
||||
],
|
||||
'nicename' => $this->resource->getNicename(),
|
||||
'arrival' => $this->resource->arrival_date->format('d.m.Y'),
|
||||
'departure' => $this->resource->departure_date->format('d.m.Y'),
|
||||
|
||||
Reference in New Issue
Block a user