Fix for issues found during testing. #567

This commit is contained in:
Korina Cordero 2021-05-19 09:11:56 +00:00
parent c9e16b4774
commit 97eccf8ab8
3 changed files with 8 additions and 1 deletions

View file

@ -460,6 +460,7 @@ class CustomerWarrantyController extends APIController
// default date purchase to today // default date purchase to today
// NOTE: might need to change this later // NOTE: might need to change this later
$date_pur = new DateTime(); $date_pur = new DateTime();
$date_pur_cust = new DateTime();
// get date purchase specified by customer // get date purchase specified by customer
if (!empty($req->request->get('date_purchase'))) if (!empty($req->request->get('date_purchase')))

View file

@ -100,6 +100,10 @@ class WarrantyHandler
// log warranty creation // log warranty creation
$action = 'create'; $action = 'create';
$exp_date = '';
if ($date_expire != null)
$exp_date = $date_expire->format('d-M-y');
$log_data = [ $log_data = [
'serial' => $serial, 'serial' => $serial,
'warranty_class' => $warranty_class, 'warranty_class' => $warranty_class,
@ -107,7 +111,7 @@ class WarrantyHandler
'last_name' => $last_name, 'last_name' => $last_name,
'mobile_number' => $mobile_number, 'mobile_number' => $mobile_number,
'date_purchase' => $date_purchase->format('d-M-y'), 'date_purchase' => $date_purchase->format('d-M-y'),
'date_expire' => $date_expire->format('d-M-y'), 'date_expire' => $exp_date,
'battery_model' => $bmodel_name, 'battery_model' => $bmodel_name,
'battery_size' => $bsize_name, 'battery_size' => $bsize_name,
'sap_battery' => $sap_batt_id, 'sap_battery' => $sap_batt_id,

View file

@ -98,6 +98,7 @@
SAP Battery SAP Battery
</label> </label>
<select name="sap_battery" class="form-control m-input"> <select name="sap_battery" class="form-control m-input">
<option value=""></option>
{% for sap_battery in sap_batts %} {% for sap_battery in sap_batts %}
<option value="{{ sap_battery.getID }}"{{ obj.getSAPBattery.getID|default(0) == sap_battery.getID ? ' selected' }}>{{ sap_battery.getID }}</option> <option value="{{ sap_battery.getID }}"{{ obj.getSAPBattery.getID|default(0) == sap_battery.getID ? ' selected' }}>{{ sap_battery.getID }}</option>
{% endfor %} {% endfor %}
@ -109,6 +110,7 @@
Battery Model Battery Model
</label> </label>
<select name="battery_model" class="form-control m-input"> <select name="battery_model" class="form-control m-input">
<option value=""></option>
{% for model in batt_models %} {% for model in batt_models %}
<option value="{{ model.getID }}"{{ obj.getBatteryModel.getID|default(0) == model.getID ? ' selected' }}>{{ model.getName }}</option> <option value="{{ model.getID }}"{{ obj.getBatteryModel.getID|default(0) == model.getID ? ' selected' }}>{{ model.getName }}</option>
{% endfor %} {% endfor %}