From bdad8ef20dec38efb1608b3fd9d35318dbb3cf18 Mon Sep 17 00:00:00 2001 From: Manuel Maier Date: Wed, 20 Nov 2024 22:25:06 +0100 Subject: [PATCH] feat: add new prices property --- backend/app/DomainObjects/TicketPriceDomainObject.php | 5 +++++ backend/app/Resources/Ticket/TicketPriceResource.php | 1 + backend/app/Resources/Ticket/TicketPriceResourcePublic.php | 1 + .../ticket-widget/SelectTickets/Prices/Tiered/index.tsx | 2 +- frontend/src/types.ts | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/app/DomainObjects/TicketPriceDomainObject.php b/backend/app/DomainObjects/TicketPriceDomainObject.php index d2d312e9..6a1ba088 100644 --- a/backend/app/DomainObjects/TicketPriceDomainObject.php +++ b/backend/app/DomainObjects/TicketPriceDomainObject.php @@ -59,6 +59,11 @@ public function getPriceIncludingTaxAndServiceFee(): float return Currency::round($this->getPrice() + $this->getTaxTotal() + $this->getFeeTotal()); } + public function getPriceIncludingTax(): float + { + return Currency::round($this->getPrice() + $this->getTaxTotal()); + } + public function isBeforeSaleStartDate(): bool { return (!is_null($this->getSaleStartDate()) diff --git a/backend/app/Resources/Ticket/TicketPriceResource.php b/backend/app/Resources/Ticket/TicketPriceResource.php index 7a4844e3..6b43c914 100644 --- a/backend/app/Resources/Ticket/TicketPriceResource.php +++ b/backend/app/Resources/Ticket/TicketPriceResource.php @@ -28,6 +28,7 @@ public function toArray(Request $request): array 'is_hidden' => $this->getIsHidden(), 'off_sale_reason' => $this->getOffSaleReason(), 'price_including_taxes_and_fees' => $this->getPriceIncludingTaxAndServiceFee(), + 'price_including_taxes' => $this->getPriceIncludingTax(), ]; } } diff --git a/backend/app/Resources/Ticket/TicketPriceResourcePublic.php b/backend/app/Resources/Ticket/TicketPriceResourcePublic.php index 1b20b128..4975ecba 100644 --- a/backend/app/Resources/Ticket/TicketPriceResourcePublic.php +++ b/backend/app/Resources/Ticket/TicketPriceResourcePublic.php @@ -22,6 +22,7 @@ public function toArray(Request $request): array 'sale_start_date' => $this->getSaleStartDate(), 'sale_end_date' => $this->getSaleEndDate(), 'price_including_taxes_and_fees' => $this->getPriceIncludingTaxAndServiceFee(), + 'price_including_taxes' => $this->getPriceIncludingTax(), 'price_before_discount' => $this->getPriceBeforeDiscount(), 'is_discounted' => (bool)$this->getPriceBeforeDiscount(), 'tax_total' => $this->getTaxTotal(), diff --git a/frontend/src/components/routes/ticket-widget/SelectTickets/Prices/Tiered/index.tsx b/frontend/src/components/routes/ticket-widget/SelectTickets/Prices/Tiered/index.tsx index 6ceec0dd..daf3dca5 100644 --- a/frontend/src/components/routes/ticket-widget/SelectTickets/Prices/Tiered/index.tsx +++ b/frontend/src/components/routes/ticket-widget/SelectTickets/Prices/Tiered/index.tsx @@ -48,7 +48,7 @@ export const TieredPricing = ({ticket, event, form, ticketIndex}: TieredPricingP )} {ticket.type !== 'DONATION' && (