Skip to content

Commit

Permalink
feat: add new prices property
Browse files Browse the repository at this point in the history
  • Loading branch information
mnlmaier committed Nov 20, 2024
1 parent 54386e0 commit bdad8ef
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions backend/app/DomainObjects/TicketPriceDomainObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions backend/app/Resources/Ticket/TicketPriceResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
];
}
}
1 change: 1 addition & 0 deletions backend/app/Resources/Ticket/TicketPriceResourcePublic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const TieredPricing = ({ticket, event, form, ticketIndex}: TieredPricingP
)}
{ticket.type !== 'DONATION' && (
<TicketPriceDisplay
price={ticket.price_before_discount + ticket.tax_total}
price={ticket.price_including_taxes}
ticket={ticket}
currency={event?.currency}
className={'hi-price-tier-price-amount'}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export interface Ticket {
tax_total?: number;
service_fee_total?: number;
price_including_taxes_and_fees?: number;
price_including_taxes?: number;
tax_and_fee_ids?: IdParam[];
taxes_and_fees?: TaxAndFee[];
is_hidden?: boolean;
Expand Down

0 comments on commit bdad8ef

Please sign in to comment.