Add serial as a parameter when rider fulfills a job order. #783
This commit is contained in:
parent
ae46d64f5b
commit
86744afde3
1 changed files with 9 additions and 1 deletions
|
|
@ -804,6 +804,15 @@ class RiderAppController extends ApiController
|
||||||
if (!empty($msg))
|
if (!empty($msg))
|
||||||
return new APIResponse(false, $msg);
|
return new APIResponse(false, $msg);
|
||||||
|
|
||||||
|
// need to check if service type is battery sales
|
||||||
|
// if so, serial is a required parameter
|
||||||
|
$serial = $req->request->get('serial', '');
|
||||||
|
if ($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
|
{
|
||||||
|
if (empty($serial))
|
||||||
|
return new APIResponse(false, 'Missing parameter(s): serial');
|
||||||
|
}
|
||||||
|
|
||||||
// set invoice to paid
|
// set invoice to paid
|
||||||
$jo->getInvoice()->setStatus(InvoiceStatus::PAID);
|
$jo->getInvoice()->setStatus(InvoiceStatus::PAID);
|
||||||
|
|
||||||
|
|
@ -855,7 +864,6 @@ class RiderAppController extends ApiController
|
||||||
// create warranty
|
// create warranty
|
||||||
if($jo_handler->checkIfNewBattery($jo))
|
if($jo_handler->checkIfNewBattery($jo))
|
||||||
{
|
{
|
||||||
$serial = null;
|
|
||||||
$warranty_class = $jo->getWarrantyClass();
|
$warranty_class = $jo->getWarrantyClass();
|
||||||
$first_name = $jo->getCustomer()->getFirstName();
|
$first_name = $jo->getCustomer()->getFirstName();
|
||||||
$last_name = $jo->getCustomer()->getLastName();
|
$last_name = $jo->getCustomer()->getLastName();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue