Add checking for service type for no trade in reason. #471
This commit is contained in:
parent
a6f8dfb333
commit
82671a80a3
1 changed files with 22 additions and 16 deletions
|
|
@ -341,15 +341,20 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$more_reason = $req->request->get('not_wait_notes');
|
$more_reason = $req->request->get('not_wait_notes');
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if trade in
|
// check if service is battery sales
|
||||||
$is_trade_in = $req->request->get('invoice_trade_in_type');
|
$stype = $req->request->get('service_type');
|
||||||
$no_trade_in_reason = '';
|
$no_trade_in_reason = '';
|
||||||
if (empty($is_trade_in))
|
if ($stype == ServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
{
|
{
|
||||||
$no_trade_in_reason = $req->request->get('no_trade_in_reason');
|
// check if trade in
|
||||||
|
$is_trade_in = $req->request->get('invoice_trade_in_type');
|
||||||
|
if (empty($is_trade_in))
|
||||||
|
{
|
||||||
|
$no_trade_in_reason = $req->request->get('no_trade_in_reason');
|
||||||
|
|
||||||
if (empty($no_trade_in_reason))
|
if (empty($no_trade_in_reason))
|
||||||
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: check status before saving since JO might already
|
// TODO: check status before saving since JO might already
|
||||||
|
|
@ -362,8 +367,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
// coordinates
|
// coordinates
|
||||||
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
||||||
|
|
||||||
$stype = $req->request->get('service_type');
|
|
||||||
|
|
||||||
// set and save values
|
// set and save values
|
||||||
$jo->setDateSchedule(DateTime::createFromFormat("d M Y h:i A", $req->request->get('date_schedule_date') . " " . $req->request->get('date_schedule_time')))
|
$jo->setDateSchedule(DateTime::createFromFormat("d M Y h:i A", $req->request->get('date_schedule_date') . " " . $req->request->get('date_schedule_time')))
|
||||||
->setCoordinates($point)
|
->setCoordinates($point)
|
||||||
|
|
@ -491,15 +494,20 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$more_reason = $req->request->get('not_wait_notes');
|
$more_reason = $req->request->get('not_wait_notes');
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if trade in
|
// check if service type is battery sales
|
||||||
$is_trade_in = $req->request->get('invoice_trade_in_type');
|
$stype = $req->request->get('service_type');
|
||||||
$no_trade_in_reason = '';
|
$no_trade_in_reason = '';
|
||||||
if (empty($is_trade_in))
|
if ($stype == ServiceType::BATTERY_REPLACEMENT_NEW)
|
||||||
{
|
{
|
||||||
$no_trade_in_reason = $req->request->get('no_trade_in_reason');
|
// check if trade in
|
||||||
|
$is_trade_in = $req->request->get('invoice_trade_in_type');
|
||||||
|
if (empty($is_trade_in))
|
||||||
|
{
|
||||||
|
$no_trade_in_reason = $req->request->get('no_trade_in_reason');
|
||||||
|
|
||||||
if (empty($no_trade_in_reason))
|
if (empty($no_trade_in_reason))
|
||||||
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error_array))
|
if (empty($error_array))
|
||||||
|
|
@ -510,8 +518,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
// coordinates
|
// coordinates
|
||||||
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
||||||
|
|
||||||
$stype = $req->request->get('service_type');
|
|
||||||
|
|
||||||
// set and save values
|
// set and save values
|
||||||
$obj->setDateSchedule(DateTime::createFromFormat("d M Y h:i A", $req->request->get('date_schedule_date') . " " . $req->request->get('date_schedule_time')))
|
$obj->setDateSchedule(DateTime::createFromFormat("d M Y h:i A", $req->request->get('date_schedule_date') . " " . $req->request->get('date_schedule_time')))
|
||||||
->setCoordinates($point)
|
->setCoordinates($point)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue