Merge branch '386-resq-comment-out-auto-assign-with-advance-order' into 'master'
Resolve "Resq - comment out auto assign with advance order" Closes #386 See merge request jankstudio/resq!429
This commit is contained in:
commit
70de3bcbae
1 changed files with 7 additions and 2 deletions
|
|
@ -989,6 +989,8 @@ class APIController extends Controller implements LoggedController
|
||||||
$invoice = $ic->generateInvoice($icrit);
|
$invoice = $ic->generateInvoice($icrit);
|
||||||
$jo->setInvoice($invoice);
|
$jo->setInvoice($invoice);
|
||||||
|
|
||||||
|
// NOTE: Start of code for auto assign advance JO. Uncomment the whole IF snippet when implementing auto assign advance order JO
|
||||||
|
/*
|
||||||
// check if advance order
|
// check if advance order
|
||||||
// check for time when request came in
|
// check for time when request came in
|
||||||
$request_time_in_int = time();
|
$request_time_in_int = time();
|
||||||
|
|
@ -1079,7 +1081,8 @@ class APIController extends Controller implements LoggedController
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ */
|
||||||
|
// NOTE: End of IF snippet for auto assign JO. Uncomment the whole IF snippet when implementing auto assign advance order JO
|
||||||
// assign hub and rider
|
// assign hub and rider
|
||||||
if (($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW) ||
|
if (($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW) ||
|
||||||
($jo->getServicetype() == ServiceType::BATTERY_REPLACEMENT_WARRANTY))
|
($jo->getServicetype() == ServiceType::BATTERY_REPLACEMENT_WARRANTY))
|
||||||
|
|
@ -1095,6 +1098,7 @@ class APIController extends Controller implements LoggedController
|
||||||
|
|
||||||
if (!empty($nearest_hub))
|
if (!empty($nearest_hub))
|
||||||
{
|
{
|
||||||
|
//error_log('found nearest hub ' . $nearest_hub->getID());
|
||||||
// assign rider
|
// assign rider
|
||||||
$available_riders = $nearest_hub->getAvailableRiders();
|
$available_riders = $nearest_hub->getAvailableRiders();
|
||||||
if (count($available_riders) > 0)
|
if (count($available_riders) > 0)
|
||||||
|
|
@ -1116,6 +1120,7 @@ class APIController extends Controller implements LoggedController
|
||||||
else
|
else
|
||||||
$assigned_rider = $available_riders[0];
|
$assigned_rider = $available_riders[0];
|
||||||
|
|
||||||
|
//error_log('found rider ' . $assigned_rider->getID());
|
||||||
$jo->setHub($nearest_hub);
|
$jo->setHub($nearest_hub);
|
||||||
$jo->setRider($assigned_rider);
|
$jo->setRider($assigned_rider);
|
||||||
$jo->setStatus(JOStatus::ASSIGNED);
|
$jo->setStatus(JOStatus::ASSIGNED);
|
||||||
|
|
@ -1191,7 +1196,7 @@ class APIController extends Controller implements LoggedController
|
||||||
|
|
||||||
// set data
|
// set data
|
||||||
$res->setData($data);
|
$res->setData($data);
|
||||||
}
|
//} // NOTE: uncomment this curly when auto assign advance order JO is to be implemented
|
||||||
|
|
||||||
return $res->getReturnResponse();
|
return $res->getReturnResponse();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue