Skip to content

Commit

Permalink
Fix voucher token max usage limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dolmit-tanel-paaro authored and Tanel Pääro committed Jan 29, 2024
1 parent 6ebfd3e commit 8ab92e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/VoucherService/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function isUsedToken(string $code, int $maxUsages = 1): bool
public function check(int $maxUsages = null, bool $isCheckout = false): bool
{
if (isset($maxUsages)) {
if ($this->getUsages() + Reservation::getReservationCount($this->getToken()) - (int)$isCheckout <= $maxUsages) {
if ($this->getUsages() + Reservation::getReservationCount($this->getToken()) - (int)$isCheckout < $maxUsages) {
return true;
}

Expand Down

0 comments on commit 8ab92e4

Please sign in to comment.