Resolve "Resq - message prompt for non-serviceable area" #1353

Merged
korina.cordero merged 176 commits from 463-resq-message-prompt-for-non-serviceable-area into 465-resq-august-13-release 2020-08-12 05:41:57 +00:00
Showing only changes of commit 22c1fab15c - Show all commits

View file

@ -1180,10 +1180,22 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
public function generateInvoice(Request $req) public function generateInvoice(Request $req)
{ {
$required_params = ['jo_id']; $required_params = ['jo_id'];
$data = $this->checkJO($req, $required_params, $jo); $data = $this->checkParamsAndKey($req, $required_params);
if (isset($data['error'])) if (isset($data['error']))
return $data; return $data;
// get jo
$jo_id = $req->query->get('jo_id');
$jo = $this->em->getRepository(JobOrder::class)->find($jo_id);
if ($jo == null)
{
$data = [
'invoice' => null
];
}
else
{
$inv = $jo->getInvoice(); $inv = $jo->getInvoice();
$promo = $inv->getPromo(); $promo = $inv->getPromo();
@ -1238,6 +1250,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
'promo' => $promo_data, 'promo' => $promo_data,
] ]
]; ];
}
return $data; return $data;
} }