Fix edit invoice bug for rider api

This commit is contained in:
root 2018-08-27 03:57:44 +08:00
parent cc6c00ab02
commit 45a84d1cc8

View file

@ -731,8 +731,16 @@ class RAPIController extends Controller
return $res->getReturnResponse(); return $res->getReturnResponse();
} }
protected function debugRequest(Request $req)
{
$all = $req->request->all();
error_log(print_r($all, true));
}
public function changeService(Request $req, InvoiceCreator $ic) public function changeService(Request $req, InvoiceCreator $ic)
{ {
// $this->debugRequest($req);
// allow rider to change service, promo, battery and trade-in options // allow rider to change service, promo, battery and trade-in options
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$required_params = ['jo_id', 'stype_id', 'promo_id']; $required_params = ['jo_id', 'stype_id', 'promo_id'];
@ -801,6 +809,7 @@ class RAPIController extends Controller
// generate new invoice // generate new invoice
$crit = new InvoiceCriteria(); $crit = new InvoiceCriteria();
$crit->setServiceType($stype_id); $crit->setServiceType($stype_id);
$crit->setCustomerVehicle($jo->getCustomerVehicle());
if ($promo != null) if ($promo != null)
$crit->addPromo($promo); $crit->addPromo($promo);