From 97eccf8ab8afb28a762b44e7068c3a7c8583bbf4 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 19 May 2021 09:11:56 +0000 Subject: [PATCH] Fix for issues found during testing. #567 --- src/Controller/CAPI/CustomerWarrantyController.php | 1 + src/Service/WarrantyHandler.php | 6 +++++- templates/warranty/form.html.twig | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Controller/CAPI/CustomerWarrantyController.php b/src/Controller/CAPI/CustomerWarrantyController.php index 55e966cb..e0c74f22 100644 --- a/src/Controller/CAPI/CustomerWarrantyController.php +++ b/src/Controller/CAPI/CustomerWarrantyController.php @@ -460,6 +460,7 @@ class CustomerWarrantyController extends APIController // default date purchase to today // NOTE: might need to change this later $date_pur = new DateTime(); + $date_pur_cust = new DateTime(); // get date purchase specified by customer if (!empty($req->request->get('date_purchase'))) diff --git a/src/Service/WarrantyHandler.php b/src/Service/WarrantyHandler.php index 6ce685a8..aadb8eac 100644 --- a/src/Service/WarrantyHandler.php +++ b/src/Service/WarrantyHandler.php @@ -100,6 +100,10 @@ class WarrantyHandler // log warranty creation $action = 'create'; + $exp_date = ''; + if ($date_expire != null) + $exp_date = $date_expire->format('d-M-y'); + $log_data = [ 'serial' => $serial, 'warranty_class' => $warranty_class, @@ -107,7 +111,7 @@ class WarrantyHandler 'last_name' => $last_name, 'mobile_number' => $mobile_number, '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_size' => $bsize_name, 'sap_battery' => $sap_batt_id, diff --git a/templates/warranty/form.html.twig b/templates/warranty/form.html.twig index 4af98004..a1210ca9 100644 --- a/templates/warranty/form.html.twig +++ b/templates/warranty/form.html.twig @@ -98,6 +98,7 @@ SAP Battery + {% for model in batt_models %} {% endfor %}