Merge branch '546-additional-fields' into 'master'

Resolve "Additional fields"

Closes #546

See merge request jankstudio/resq!639
This commit is contained in:
Kendrick Chan 2021-03-18 11:55:22 +00:00
commit 20987e305b
11 changed files with 98 additions and 10 deletions

View file

@ -58,7 +58,7 @@ Yes, we accept Visa and Mastercard issued in the Philippines.
How can I pay for your services/ products?
</h2>
<p>
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.
</p>
<h2 style="font-weight: bold; font-size: 40px;">
@ -93,7 +93,7 @@ Delivery for battery purchase is free of charge.
Can you deliver anywhere in the Philippines?
</h2>
<p>
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.
</p>
<h2 style="font-weight: bold; font-size: 40px;">

View file

@ -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)

View file

@ -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)

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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'))

View file

@ -71,6 +71,15 @@
<div class="form-control-feedback hide" data-field="tip_other"></div>
</div>
</div>
<div class="form-group m-form__group row no-border">
<label class="col-lg-3 col-form-label" data-field="tip_lazada">
{% trans %}battery_size_tradein_lazada{% endtrans %}
</label>
<div class="col-lg-9">
<input type="text" name="tip_lazada" class="form-control m-input" value="{{ obj.getTIPriceLazada }}">
<div class="form-control-feedback hide" data-field="tip_lazada"></div>
</div>
</div>
</div>
<div class="m-portlet__foot m-portlet__foot--fit">
<div class="m-form__actions m-form__actions--solid m-form__actions--right">

View file

@ -119,6 +119,12 @@
<span></span>
<div class="form-control-feedback hide" data-field="flag_promo_email"></div>
</label>
<label class="m-checkbox">
<input type="checkbox" name="flag_promo_marketing_research" value="1"{{ obj.isPromoMarketingResearch ? ' checked' }} >
Marketing Research
<span></span>
<div class="form-control-feedback hide" data-field="flag_promo_marketing_research"></div>
</label>
</div>
</div>
</div>

View file

@ -96,6 +96,16 @@
</span>
<div class="form-control-feedback hide" data-field="flag_new"></div>
</div>
<div class="col-lg-4">
<span class="m-switch m-switch--icon block-switch">
<label>
<input type="checkbox" name="flag_inventory" id="flag_inventory" value="1"{{ obj.isInventory() ? ' checked' }}>
<label class="switch-label">Inventory</label>
<span></span>
</label>
</span>
<div class="form-control-feedback hide" data-field="flag_inventory"></div>
</div>
</div>
</div>
<div class="m-portlet__foot m-portlet__foot--fit">

View file

@ -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'