Merge branch '471-resq-no-trade-in-reason-should-not-be-required' into '485-resq-september-10-release'
Add checking for service type for no trade in reason. #471 See merge request jankstudio/resq!571
This commit is contained in:
commit
e1769470de
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');
|
||||
}
|
||||
|
||||
// check if trade in
|
||||
$is_trade_in = $req->request->get('invoice_trade_in_type');
|
||||
// check if service is battery sales
|
||||
$stype = $req->request->get('service_type');
|
||||
$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))
|
||||
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
||||
if (empty($no_trade_in_reason))
|
||||
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: check status before saving since JO might already
|
||||
|
|
@ -362,8 +367,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
// coordinates
|
||||
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
||||
|
||||
$stype = $req->request->get('service_type');
|
||||
|
||||
// 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')))
|
||||
->setCoordinates($point)
|
||||
|
|
@ -491,15 +494,20 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$more_reason = $req->request->get('not_wait_notes');
|
||||
}
|
||||
|
||||
// check if trade in
|
||||
$is_trade_in = $req->request->get('invoice_trade_in_type');
|
||||
// check if service type is battery sales
|
||||
$stype = $req->request->get('service_type');
|
||||
$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))
|
||||
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
||||
if (empty($no_trade_in_reason))
|
||||
$error_array['no_trade_in_reason'] = 'No trade in reason required.';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error_array))
|
||||
|
|
@ -510,8 +518,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
// coordinates
|
||||
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
||||
|
||||
$stype = $req->request->get('service_type');
|
||||
|
||||
// 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')))
|
||||
->setCoordinates($point)
|
||||
|
|
|
|||
Loading…
Reference in a new issue