add some stuff
This commit is contained in:
parent
2820752248
commit
1fb8e3fa81
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Enum\TicketData;
|
||||
use App\Repository\PaymentRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
@ -63,4 +64,11 @@ class Payment
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTotal(): float
|
||||
{
|
||||
return $this->customer->getTickets()
|
||||
->map(fn (Ticket $ticket) => TicketData::TICKET_DATA[$ticket->getType()]['price'])
|
||||
->reduce(fn (float $carry, float $price) => $carry + $price, 0);
|
||||
}
|
||||
}
|
||||
|
@ -7,20 +7,22 @@
|
||||
<body>
|
||||
Hallo {{ payment.customer.firstname }}
|
||||
<br>
|
||||
text
|
||||
placeholder text
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
{% for ticket in payment.customer.tickets %}
|
||||
{{ (ticket.type | ticket)['name'] }} ({{ (ticket.type | ticket)['price'] }}€)
|
||||
Ticket: {{ (ticket.type | ticket)['name'] }} ({{ (ticket.type | ticket)['price'] }}€)
|
||||
<br>
|
||||
{{ ticket.foodType | food }}
|
||||
Essen: {{ ticket.foodType | food }}
|
||||
<br>
|
||||
{% if ticket.note %}
|
||||
Anmerkung: {{ ticket.note }}
|
||||
<br>
|
||||
{{ ticket.note }}
|
||||
{% endif %}
|
||||
{% if not loop.last %}
|
||||
<hr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<br>
|
||||
Gesamtpreis: {{ payment.total }}€
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user