Commented out auto assign advance order JO. #386
This commit is contained in:
parent
38e0b8a204
commit
61278c81a4
1 changed files with 7 additions and 2 deletions
|
|
@ -989,6 +989,8 @@ class APIController extends Controller implements LoggedController
|
|||
$invoice = $ic->generateInvoice($icrit);
|
||||
$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 for time when request came in
|
||||
$request_time_in_int = time();
|
||||
|
|
@ -1079,7 +1081,8 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
}
|
||||
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
|
||||
if (($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW) ||
|
||||
($jo->getServicetype() == ServiceType::BATTERY_REPLACEMENT_WARRANTY))
|
||||
|
|
@ -1095,6 +1098,7 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
if (!empty($nearest_hub))
|
||||
{
|
||||
//error_log('found nearest hub ' . $nearest_hub->getID());
|
||||
// assign rider
|
||||
$available_riders = $nearest_hub->getAvailableRiders();
|
||||
if (count($available_riders) > 0)
|
||||
|
|
@ -1116,6 +1120,7 @@ class APIController extends Controller implements LoggedController
|
|||
else
|
||||
$assigned_rider = $available_riders[0];
|
||||
|
||||
//error_log('found rider ' . $assigned_rider->getID());
|
||||
$jo->setHub($nearest_hub);
|
||||
$jo->setRider($assigned_rider);
|
||||
$jo->setStatus(JOStatus::ASSIGNED);
|
||||
|
|
@ -1191,7 +1196,7 @@ class APIController extends Controller implements LoggedController
|
|||
|
||||
// set data
|
||||
$res->setData($data);
|
||||
}
|
||||
//} // NOTE: uncomment this curly when auto assign advance order JO is to be implemented
|
||||
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue