From 1fdd935b7f4398583d2727cb2b226aed6d3556ee Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 18 Mar 2021 03:25:49 +0000 Subject: [PATCH 1/4] Add Trade-in Lazada field for battery size. #546 --- src/Controller/BatterySizeController.php | 3 ++- src/Entity/BatterySize.php | 19 +++++++++++++++++++ templates/battery-size/form.html.twig | 11 ++++++++++- translations/messages.en.yaml | 1 + 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Controller/BatterySizeController.php b/src/Controller/BatterySizeController.php index 5dc2906a..177780e8 100644 --- a/src/Controller/BatterySizeController.php +++ b/src/Controller/BatterySizeController.php @@ -129,7 +129,8 @@ class BatterySizeController extends Controller $obj->setName($req->request->get('name')) ->setTIPriceMotolite($req->request->get('tip_motolite')) ->setTIPricePremium($req->request->get('tip_premium')) - ->setTIPriceOther($req->request->get('tip_other')); + ->setTIPriceOther($req->request->get('tip_other')) + ->setTIPriceLazada($req->request->get('tip_lazada')); } public function addSubmit(Request $req, ValidatorInterface $validator) diff --git a/src/Entity/BatterySize.php b/src/Entity/BatterySize.php index 9fff4d44..8b47d6af 100644 --- a/src/Entity/BatterySize.php +++ b/src/Entity/BatterySize.php @@ -51,12 +51,19 @@ class BatterySize */ protected $tip_other; + // lazada trade-in price + /** + * @ORM\Column(type="decimal", precision=7, scale=2) + */ + protected $tip_lazada; + public function __construct() { $this->batteries = new ArrayCollection(); $this->tip_motolite = 0; $this->tip_premium = 0; $this->tip_other = 0; + $this->tip_lazada = 0; } public function getID() @@ -130,4 +137,16 @@ class BatterySize { return $this->tip_other; } + + public function setTIPriceLazada($price) + { + $this->tip_lazada = $price; + return $this; + } + + public function getTIPriceLazada() + { + return $this->tip_lazada; + } + } diff --git a/templates/battery-size/form.html.twig b/templates/battery-size/form.html.twig index 1af1f342..06d3fadd 100644 --- a/templates/battery-size/form.html.twig +++ b/templates/battery-size/form.html.twig @@ -70,7 +70,16 @@
- + +
+ +
+ + +
+
diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index c0fb8ca1..e9f077a3 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -8,6 +8,7 @@ copyright: Motolite Res-Q battery_size_tradein_brand: Trade-in Motolite battery_size_tradein_premium: Trade-in Premium battery_size_tradein_other: Trade-in Other +battery_size_tradein_lazada: Trade-in Lazada add_cust_vehicle_battery_info: This vehicle is using a Motolite battery jo_title_pdf: Motolite Res-Q Job Order country_code_prefix: '+63' From d0eade30126cd812938207b3abd83b2402981d64 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 18 Mar 2021 03:54:34 +0000 Subject: [PATCH 2/4] Add inventory flag to SAP battery. #546 --- src/Controller/SAPBatteryController.php | 10 ++++++++-- src/Entity/SAPBattery.php | 17 +++++++++++++++++ templates/sap-battery/form.html.twig | 16 +++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/Controller/SAPBatteryController.php b/src/Controller/SAPBatteryController.php index 099c1998..a06f4ef9 100644 --- a/src/Controller/SAPBatteryController.php +++ b/src/Controller/SAPBatteryController.php @@ -171,9 +171,12 @@ class SAPBatteryController extends Controller $error_array['id'] = 'SAP code is required.'; $flag_new = $req->request->get('flag_new', false); + $flag_inventory = $req->request->get('flag_inventory', false); + // set and save values $row->setID($id) - ->setNew($flag_new); + ->setNew($flag_new) + ->setInventory($flag_inventory); // custom validation for battery brand $brand = $em->getRepository(SAPBatteryBrand::class) @@ -277,9 +280,12 @@ class SAPBatteryController extends Controller $error_array['id'] = 'SAP code is required.'; $flag_new = $req->request->get('flag_new', false); + $flag_inventory = $req->request->get('flag_inventory', false); + // set and save values $row->setID($id) - ->setNew($flag_new); + ->setNew($flag_new) + ->setInventory($flag_inventory); // custom validation for battery brand $brand = $em->getRepository(SAPBatteryBrand::class) diff --git a/src/Entity/SAPBattery.php b/src/Entity/SAPBattery.php index 284e2e32..df4303d4 100644 --- a/src/Entity/SAPBattery.php +++ b/src/Entity/SAPBattery.php @@ -58,10 +58,17 @@ class SAPBattery */ protected $container_size; + // flag to indicate if this SAP battery is inventory or non-inventory + /** + * @ORM\Column(type="boolean") + */ + protected $flag_inventory; + public function __construct() { $this->date_create = new DateTime(); $this->flag_new = false; + $this->flag_inventory = false; } public function setID($id) @@ -129,4 +136,14 @@ class SAPBattery return $this->container_size; } + public function setInventory($inventory = false) + { + $this->flag_inventory = $inventory; + return $this; + } + + public function isInventory() + { + return $this->flag_inventory; + } } diff --git a/templates/sap-battery/form.html.twig b/templates/sap-battery/form.html.twig index 84e12d85..6e21086f 100644 --- a/templates/sap-battery/form.html.twig +++ b/templates/sap-battery/form.html.twig @@ -86,15 +86,25 @@
+
+ + + + +
- +
From c0ef8be34c84c4725edb92ee306d985ea027c1b5 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 18 Mar 2021 06:02:56 +0000 Subject: [PATCH 3/4] Add Marketing Research checkbox under Marketing Promo for Customer. #546 --- src/Entity/Customer.php | 17 +++++++++++++++++ .../CustomerHandler/ResqCustomerHandler.php | 4 +++- templates/customer/form.html.twig | 6 ++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Entity/Customer.php b/src/Entity/Customer.php index 281c9fa9..f99df0d5 100644 --- a/src/Entity/Customer.php +++ b/src/Entity/Customer.php @@ -192,6 +192,11 @@ class Customer */ protected $date_create; + /** + * @ORM\Column(type="boolean", options={"default":false}) + */ + protected $flag_promo_marketing_research; + public function __construct() { $this->numbers = new ArrayCollection(); @@ -222,6 +227,7 @@ class Customer $this->flag_promo_email = false; $this->flag_promo_sms = false; $this->flag_dpa_consent = false; + $this->flag_promo_marketing_research = false; $this->date_create = new DateTime(); } @@ -555,4 +561,15 @@ class Customer { return $this->flag_dpa_consent; } + + public function setPromoMarketingResearch($flag_promo_marketing_research = true) + { + $this->flag_promo_marketing_research = $flag_promo_marketing_research; + return $this; + } + + public function isPromoMarketingResearch() + { + return $this->flag_promo_marketing_research; + } } diff --git a/src/Service/CustomerHandler/ResqCustomerHandler.php b/src/Service/CustomerHandler/ResqCustomerHandler.php index 5f3653dd..cf2a71d7 100644 --- a/src/Service/CustomerHandler/ResqCustomerHandler.php +++ b/src/Service/CustomerHandler/ResqCustomerHandler.php @@ -539,6 +539,7 @@ class ResqCustomerHandler implements CustomerHandlerInterface 'flag_dpa_consent' => $customer->isDpaConsent(), 'flag_promo_sms' => $customer->isPromoSms(), 'flag_promo_email' => $customer->isPromoEmail(), + 'flag_promo_marketing_research' => $customer->isPromoMarketingResearch(), ], 'vehicle' => [ 'id' => $vehicle->getID(), @@ -599,7 +600,8 @@ class ResqCustomerHandler implements CustomerHandlerInterface ->setActive($req->request->get('flag_active') ? true : false) ->setPromoSms($req->request->get('flag_promo_sms', false)) ->setPromoEmail($req->request->get('flag_promo_email', false)) - ->setDpaConsent($is_dpa_checked); + ->setDpaConsent($is_dpa_checked) + ->setPromoMarketingResearch($req->request->get('flag_promo_marketing_research', false)); // phone numbers $obj->setPhoneMobile($req->request->get('phone_mobile')) diff --git a/templates/customer/form.html.twig b/templates/customer/form.html.twig index 97b80884..26b350e0 100644 --- a/templates/customer/form.html.twig +++ b/templates/customer/form.html.twig @@ -119,6 +119,12 @@ + From a879e94615719dd4d56dafd6bb2fd070f4add8d6 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 18 Mar 2021 07:24:58 +0000 Subject: [PATCH 4/4] Update answers in FAQ. #546 --- public/static/faq.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/static/faq.html b/public/static/faq.html index 2e0cdea3..42b4110d 100644 --- a/public/static/faq.html +++ b/public/static/faq.html @@ -58,7 +58,7 @@ Yes, we accept Visa and Mastercard issued in the Philippines. How can I pay for your services/ products?

-We accept COD, local Credit Cards, Debit Cards, and ATM Cards only. +We accept COD, local credit cards, debit cards, and ATM cards for battery replacement transactions. We only accept cash payment for flat tire, refuel and overheat transactions.

@@ -93,7 +93,7 @@ Delivery for battery purchase is free of charge. Can you deliver anywhere in the Philippines?

-Not yet. Res-Q is offered initially in Metro Manila only. +Not yet. Res-Q is offered Metro Manila, Baguio City and Binan, Laguna only.