Make sure rider's active jo is in an open status #362
This commit is contained in:
parent
de9e803ad4
commit
bf535e37f5
1 changed files with 12 additions and 1 deletions
|
|
@ -320,7 +320,18 @@ class Rider
|
||||||
{
|
{
|
||||||
// check if we have set a custom active
|
// check if we have set a custom active
|
||||||
if ($this->active_job_order != null)
|
if ($this->active_job_order != null)
|
||||||
return $this->active_job_order;
|
{
|
||||||
|
switch ($this->active_job_order->getStatus())
|
||||||
|
{
|
||||||
|
// if jo is open, return it
|
||||||
|
case JOStatus::ASSIGNED:
|
||||||
|
case JOStatus::IN_TRANSIT:
|
||||||
|
case JOStatus::IN_PROGRESS:
|
||||||
|
return $this->active_job_order;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if active jo is not open, get the next open one
|
||||||
|
}
|
||||||
|
|
||||||
// no custom active job order
|
// no custom active job order
|
||||||
$active_status = [
|
$active_status = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue