Fix error when rider is not selected. #424
This commit is contained in:
parent
21ae94c5b6
commit
0f5bf2e8d6
1 changed files with 13 additions and 13 deletions
|
|
@ -558,19 +558,6 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set priority based on rider's existing open job orders
|
|
||||||
$rider_jos = $rider->getOpenJobOrders();
|
|
||||||
|
|
||||||
// get maximum priority then add 1
|
|
||||||
// NOTE: this can be a bit buggy due to concurrency issues
|
|
||||||
// ideally have to lock jo table, but that isn't feasible right now
|
|
||||||
$priority = 0;
|
|
||||||
foreach ($rider_jos as $rider_jo)
|
|
||||||
{
|
|
||||||
if ($priority < $rider_jo->getPriority())
|
|
||||||
$priority = $rider_jo->getPriority() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get discount and set to meta
|
// get discount and set to meta
|
||||||
$discount = $req->request->get('invoice_discount', []);
|
$discount = $req->request->get('invoice_discount', []);
|
||||||
|
|
||||||
|
|
@ -583,6 +570,19 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||||
|
|
||||||
if (empty($error_array))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
|
// set priority based on rider's existing open job orders
|
||||||
|
$rider_jos = $rider->getOpenJobOrders();
|
||||||
|
|
||||||
|
// get maximum priority then add 1
|
||||||
|
// NOTE: this can be a bit buggy due to concurrency issues
|
||||||
|
// ideally have to lock jo table, but that isn't feasible right now
|
||||||
|
$priority = 0;
|
||||||
|
foreach ($rider_jos as $rider_jo)
|
||||||
|
{
|
||||||
|
if ($priority < $rider_jo->getPriority())
|
||||||
|
$priority = $rider_jo->getPriority() + 1;
|
||||||
|
}
|
||||||
|
|
||||||
// get current user
|
// get current user
|
||||||
$user = $this->security->getUser();
|
$user = $this->security->getUser();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue