@@ -159,7 +159,6 @@ |
||
159 | 159 | * Scope Until. |
160 | 160 | * |
161 | 161 | * @param Illuminate\Database\Query $query |
162 | - * @param \Carbon\Carbon $since |
|
163 | 162 | * |
164 | 163 | * @return Illuminate\Database\Query Scoped query |
165 | 164 | */ |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | public function hasRoomBetween(Carbon $startAt, Carbon $finishAt) |
267 | 267 | { |
268 | 268 | return $this->capacity > $this->business |
269 | - ->bookings() |
|
270 | - ->active() |
|
271 | - ->affectingInterval($startAt, $finishAt) |
|
272 | - ->affectingHumanresource($this->humanresource_id) |
|
273 | - ->count() && |
|
269 | + ->bookings() |
|
270 | + ->active() |
|
271 | + ->affectingInterval($startAt, $finishAt) |
|
272 | + ->affectingHumanresource($this->humanresource_id) |
|
273 | + ->count() && |
|
274 | 274 | ($this->start_at <= $startAt && $this->finish_at >= $finishAt); |
275 | 275 | } |
276 | 276 | |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | $count = $this->business |
289 | - ->bookings() |
|
290 | - ->active() |
|
291 | - ->affectingHumanresource($this->humanresource_id) |
|
292 | - ->affectingInterval($startAt, $finishAt) |
|
293 | - ->count(); |
|
289 | + ->bookings() |
|
290 | + ->active() |
|
291 | + ->affectingHumanresource($this->humanresource_id) |
|
292 | + ->affectingInterval($startAt, $finishAt) |
|
293 | + ->count(); |
|
294 | 294 | |
295 | 295 | return $this->capacity - intval($count); |
296 | 296 | } |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | $comments = $request['comments']; |
73 | 73 | |
74 | 74 | $vacancies = $this->calendar() |
75 | - ->forService($service->id) |
|
76 | - ->withDuration($service->duration) |
|
77 | - ->forDate($request['date']) |
|
78 | - ->atTime($request['time'], $request['timezone']) |
|
79 | - ->find(); |
|
75 | + ->forService($service->id) |
|
76 | + ->withDuration($service->duration) |
|
77 | + ->forDate($request['date']) |
|
78 | + ->atTime($request['time'], $request['timezone']) |
|
79 | + ->find(); |
|
80 | 80 | |
81 | 81 | if ($vacancies->count() == 0) { |
82 | 82 | // TODO: Log failure feedback message / raise exception |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | public function isBookable($fromDate = 'today', $days = 7) |
159 | 159 | { |
160 | 160 | $count = $this->business |
161 | - ->vacancies() |
|
162 | - ->future(Carbon::parse($fromDate)) |
|
163 | - ->until(Carbon::parse($fromDate)->addDays($days)) |
|
164 | - ->count(); |
|
161 | + ->vacancies() |
|
162 | + ->future(Carbon::parse($fromDate)) |
|
163 | + ->until(Carbon::parse($fromDate)->addDays($days)) |
|
164 | + ->count(); |
|
165 | 165 | |
166 | 166 | return $count > 0; |
167 | 167 | } |