fix clear and copy week

This commit is contained in:
2019-11-05 16:58:25 +01:00
committed by Roland Schneider
parent 9c0e2a56ee
commit 2c5db234ce
19 changed files with 692 additions and 142 deletions

View File

@@ -457,15 +457,15 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
public function consumeReservationCount($count){
$newReservationCount = $this->reservation_count + $count;
if ( $newReservationCount > $this->max_reservation_count ){
throw new HttpException(406,"Max ticket seat count exceeded",EventRegistrationManager::MAX_SEAT_COUNT_EXCEEDED);
throw new HttpException(406, 'Max ticket seat count exceeded',EventRegistrationManager::MAX_SEAT_COUNT_EXCEEDED);
}
$this->reservation_count = $newReservationCount;
}
public function restoreReservationCount($usagesToRestore){
$this->reservation_count = $this->reservation_count - $usagesToRestore;
if ( $this->usage_count < 0 ){
$this->usage_count = 0;
$this->reservation_count -= $usagesToRestore;
if ( $this->reservation_count < 0 ){
$this->reservation_count = 0;
}
}