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,6 +558,18 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
}
|
||||
|
||||
// get discount and set to meta
|
||||
$discount = $req->request->get('invoice_discount', []);
|
||||
|
||||
// check if discount is greater than 50 or negative number
|
||||
if (($discount > 50) || ($discount < 0))
|
||||
$error_array['invoice_discount'] = 'Invalid discount specified';
|
||||
|
||||
// get list of service charges
|
||||
$service_charges = $req->request->get('service_charges', []);
|
||||
|
||||
if (empty($error_array))
|
||||
{
|
||||
// set priority based on rider's existing open job orders
|
||||
$rider_jos = $rider->getOpenJobOrders();
|
||||
|
||||
|
|
@ -571,18 +583,6 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$priority = $rider_jo->getPriority() + 1;
|
||||
}
|
||||
|
||||
// get discount and set to meta
|
||||
$discount = $req->request->get('invoice_discount', []);
|
||||
|
||||
// check if discount is greater than 50 or negative number
|
||||
if (($discount > 50) || ($discount < 0))
|
||||
$error_array['invoice_discount'] = 'Invalid discount specified';
|
||||
|
||||
// get list of service charges
|
||||
$service_charges = $req->request->get('service_charges', []);
|
||||
|
||||
if (empty($error_array))
|
||||
{
|
||||
// get current user
|
||||
$user = $this->security->getUser();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue