Add Willing to Wait tickbox and Reason for not waiting text field. #445
This commit is contained in:
parent
18dd63ac16
commit
964dce9842
4 changed files with 68 additions and 2 deletions
|
|
@ -334,6 +334,18 @@ class JobOrder
|
||||||
*/
|
*/
|
||||||
protected $phone_mobile;
|
protected $phone_mobile;
|
||||||
|
|
||||||
|
// flag if customer is willing to wait
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="boolean", nullable=true)
|
||||||
|
*/
|
||||||
|
protected $flag_will_wait;
|
||||||
|
|
||||||
|
// reason for not willing to wait
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=80, nullable=true)
|
||||||
|
*/
|
||||||
|
protected $reasons_not_waiting;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->date_create = new DateTime();
|
$this->date_create = new DateTime();
|
||||||
|
|
@ -356,6 +368,8 @@ class JobOrder
|
||||||
$this->meta = [];
|
$this->meta = [];
|
||||||
|
|
||||||
$this->phone_mobile = '';
|
$this->phone_mobile = '';
|
||||||
|
|
||||||
|
$this->flag_will_wait = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getID()
|
public function getID()
|
||||||
|
|
@ -962,5 +976,25 @@ class JobOrder
|
||||||
return $this->phone_mobile;
|
return $this->phone_mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setWillingToWait($flag = true)
|
||||||
|
{
|
||||||
|
$this->flag_will_wait = $flag;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isWillingToWait()
|
||||||
|
{
|
||||||
|
return $this->flag_will_wait;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setReasonsNotWait($reasons)
|
||||||
|
{
|
||||||
|
$this->reasons_not_waiting = $reasons;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getReasonsNotWait()
|
||||||
|
{
|
||||||
|
return $this->reasons_not_waiting;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,6 +324,12 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
if (empty($req->request->get('landmark')))
|
if (empty($req->request->get('landmark')))
|
||||||
$error_array['landmark'] = 'Landmark is required.';
|
$error_array['landmark'] = 'Landmark is required.';
|
||||||
|
|
||||||
|
// check if customer is not willing to wait
|
||||||
|
$will_wait = $req->request->get('flag_will_wait');
|
||||||
|
$reason = $req->request->get('no_wait_reason');
|
||||||
|
if ((!($will_wait)) && (empty($reason)))
|
||||||
|
$error_array['no_wait_reason'] = 'Reason is needed.';
|
||||||
|
|
||||||
// TODO: check status before saving since JO might already
|
// TODO: check status before saving since JO might already
|
||||||
// have a status that needs to be retained
|
// have a status that needs to be retained
|
||||||
|
|
||||||
|
|
@ -353,7 +359,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setORName($req->request->get('or_name'))
|
->setORName($req->request->get('or_name'))
|
||||||
->setPromoDetail($req->request->get('promo_detail'))
|
->setPromoDetail($req->request->get('promo_detail'))
|
||||||
->setModeOfPayment($req->request->get('mode_of_payment'))
|
->setModeOfPayment($req->request->get('mode_of_payment'))
|
||||||
->setLandmark($req->request->get('landmark'));
|
->setLandmark($req->request->get('landmark'))
|
||||||
|
->setWillingToWait($req->request->get('flag_will_wait', false))
|
||||||
|
->setReasonsNotWait($req->request->get('no_wait_reason'));
|
||||||
|
|
||||||
// check if user is null, meaning call to create came from API
|
// check if user is null, meaning call to create came from API
|
||||||
if ($user != null)
|
if ($user != null)
|
||||||
|
|
@ -444,6 +452,16 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$error_array['coordinates'] = 'No map coordinates provided. Please click on a location on the map.';
|
$error_array['coordinates'] = 'No map coordinates provided. Please click on a location on the map.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if landmark is set
|
||||||
|
if (empty($req->request->get('landmark')))
|
||||||
|
$error_array['landmark'] = 'Landmark is required.';
|
||||||
|
|
||||||
|
// check if customer is not willing to wait
|
||||||
|
$will_wait = $req->request->get('flag_will_wait');
|
||||||
|
$reason = $req->request->get('no_wait_reason');
|
||||||
|
if ((!($will_wait)) && (empty($reason)))
|
||||||
|
$error_array['no_wait_reason'] = 'Reason is needed.';
|
||||||
|
|
||||||
if (empty($error_array))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
// get current user
|
// get current user
|
||||||
|
|
@ -468,7 +486,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setORName($req->request->get('or_name'))
|
->setORName($req->request->get('or_name'))
|
||||||
->setPromoDetail($req->request->get('promo_detail'))
|
->setPromoDetail($req->request->get('promo_detail'))
|
||||||
->setModeOfPayment($req->request->get('mode_of_payment'))
|
->setModeOfPayment($req->request->get('mode_of_payment'))
|
||||||
->setLandmark($req->request->get('landmark'));
|
->setLandmark($req->request->get('landmark'))
|
||||||
|
->setWillingToWait($req->request->get('flag_will_wait', false))
|
||||||
|
->setReasonsNotWait($req->request->get('no_wait_reason'));
|
||||||
|
|
||||||
// did they change invoice?
|
// did they change invoice?
|
||||||
$invoice_items = $req->request->get('invoice_items', []);
|
$invoice_items = $req->request->get('invoice_items', []);
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,18 @@
|
||||||
<div class="form-control-feedback hide" data-field="date_schedule_time"></div>
|
<div class="form-control-feedback hide" data-field="date_schedule_time"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group m-form__group row">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="checkbox" name="flag_will_wait" id="flag-will-wait" value="1"{{ obj.isWillingToWait ? ' checked' }} >
|
||||||
|
<label class="switch-label">Willing to Wait</label>
|
||||||
|
<div class="form-control-feedback hide" data-field="flag_will_wait"></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<label data-field="no_wait_reason">Reason Why Not Willing to Wait</label>
|
||||||
|
<input type="text" name="no_wait_reason" class="form-control m-input" value="{{ obj.getReasonsNotWait|default('') }}">
|
||||||
|
<div class="form-control-feedback hide" data-field="no_wait_reason"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group m-form__group row">
|
<div class="form-group m-form__group row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<label data-field="tier1_notes">Tier 1 Notes</label>
|
<label data-field="tier1_notes">Tier 1 Notes</label>
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue