From 8ab92e4778f7397ffb7313185a0fcee7e7c04515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tanel=20P=C3=A4=C3=A4ro?= Date: Mon, 29 Jan 2024 15:22:16 +0200 Subject: [PATCH] Fix voucher token max usage limit --- src/VoucherService/Token.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VoucherService/Token.php b/src/VoucherService/Token.php index d7e3a2a3b..73a336de3 100644 --- a/src/VoucherService/Token.php +++ b/src/VoucherService/Token.php @@ -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; }