diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php
index 3367a365..08a90c5a 100644
--- a/src/Controller/APIController.php
+++ b/src/Controller/APIController.php
@@ -635,7 +635,7 @@ class APIController extends Controller
'size_id' => $batt->getSize()->getID(),
'size_name' => $batt->getSize()->getName(),
'price' => $batt->getSellingPrice(),
- 'wty_personal' => $batt->getWarrantyPersonal(),
+ 'wty_private' => $batt->getWarrantyPrivate(),
'wty_commercial' => $batt->getWarrantyCommercial(),
];
}
diff --git a/src/Controller/BatteryController.php b/src/Controller/BatteryController.php
index 9991d5d5..238738f7 100644
--- a/src/Controller/BatteryController.php
+++ b/src/Controller/BatteryController.php
@@ -116,7 +116,7 @@ class BatteryController extends BaseController
$row['size_name'] = $orow['size_name'];
$row['prod_code'] = $orow[0]->getProductCode();
$row['sell_price'] = $orow[0]->getSellingPrice();
- $row['warr_personal'] = $orow[0]->getWarrantyPersonal();
+ $row['warr_private'] = $orow[0]->getWarrantyPrivate();
$row['warr_commercial'] = $orow[0]->getWarrantyCommercial();
$row['res_capacity'] = $orow[0]->getReserveCapacity();
$row['length'] = $orow[0]->getLength();
@@ -176,7 +176,7 @@ class BatteryController extends BaseController
// set and save values
$row->setProductCode($req->request->get('prod_code'))
- ->setWarrantyPersonal($req->request->get('warr_personal'))
+ ->setWarrantyPrivate($req->request->get('warr_private'))
->setWarrantyCommercial($req->request->get('warr_commercial'))
->setReserveCapacity($req->request->get('res_capacity'))
->setLength($req->request->get('length'))
@@ -296,7 +296,7 @@ class BatteryController extends BaseController
// set and save values
$row->setProductCode($req->request->get('prod_code'))
- ->setWarrantyPersonal($req->request->get('warr_personal'))
+ ->setWarrantyPrivate($req->request->get('warr_private'))
->setWarrantyCommercial($req->request->get('warr_commercial'))
->setReserveCapacity($req->request->get('res_capacity'))
->setLength($req->request->get('length'))
diff --git a/src/Controller/BatteryManufacturerController.php b/src/Controller/BatteryManufacturerController.php
index e0836c5d..d68b96f3 100644
--- a/src/Controller/BatteryManufacturerController.php
+++ b/src/Controller/BatteryManufacturerController.php
@@ -289,7 +289,10 @@ class BatteryManufacturerController extends BaseController
'mfg_name' => $battery->getManufacturer()->getName(),
'model_name' => $battery->getModel()->getName(),
'size_name' => $battery->getSize()->getName(),
- 'prod_code' => $battery->getProductCode()
+ 'prod_code' => $battery->getProductCode(),
+ 'sell_price' => $battery->getSellingPrice(),
+ 'warr_private' => $battery->getWarrantyPrivate(),
+ 'warr_commercial' => $battery->getWarrantyCommercial(),
];
}
diff --git a/src/Controller/CustomerController.php b/src/Controller/CustomerController.php
index e93f867f..0081d61e 100644
--- a/src/Controller/CustomerController.php
+++ b/src/Controller/CustomerController.php
@@ -3,6 +3,7 @@
namespace App\Controller;
use App\Ramcar\BaseController;
+use App\Ramcar\CustomerClassification;
use App\Ramcar\FuelType;
use App\Ramcar\VehicleStatusCondition;
use App\Entity\Customer;
@@ -103,10 +104,19 @@ class CustomerController extends BaseController
// process rows
$rows = [];
foreach ($obj_rows as $orow) {
+ $classifications = CustomerClassification::getCollection();
+
// add row data
$row['id'] = $orow->getID();
$row['first_name'] = $orow->getFirstName();
$row['last_name'] = $orow->getLastName();
+ $row['customer_classification'] = $classifications[$orow->getCustomerClassification()];
+ $row['flag_mobile_app'] = $orow->hasMobileApp();
+ $row['app_mobile_number'] = $orow->hasMobileApp() && !empty($orow->getMobileSessions()) ? $orow->getMobileSessions()[0]->getPhoneNumber() : '';
+
+ // TODO: properly add mobile numbers and plate numbers as searchable/sortable fields, use doctrine events
+ $row['mobile_numbers'] = implode("
", $orow->getMobileNumberList());
+ $row['plate_numbers'] = implode("
", $orow->getPlateNumberList());
// add row metadata
$row['meta'] = [
@@ -143,6 +153,7 @@ class CustomerController extends BaseController
// get parent associations
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
$params['vmfgs'] = $em->getRepository(VehicleManufacturer::class)->findAll();
+ $params['classifications'] = CustomerClassification::getCollection();
$params['fuel_types'] = FuelType::getCollection();
$params['status_conditions'] = VehicleStatusCondition::getCollection();
@@ -163,8 +174,8 @@ class CustomerController extends BaseController
// set and save values
$row->setFirstName($req->request->get('first_name'))
->setLastName($req->request->get('last_name'))
- ->setCustomerNotes($req->request->get('customer_notes'))
- ->setConfirmed(false);
+ ->setCustomerClassification($req->request->get('customer_classification'))
+ ->setCustomerNotes($req->request->get('customer_notes'));
// initialize error lists
$error_array = [];
@@ -317,6 +328,7 @@ class CustomerController extends BaseController
// get parent associations
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
$params['vmfgs'] = $em->getRepository(VehicleManufacturer::class)->findAll();
+ $params['classifications'] = CustomerClassification::getCollection();
$params['fuel_types'] = FuelType::getCollection();
$params['status_conditions'] = VehicleStatusCondition::getCollection();
@@ -343,6 +355,7 @@ class CustomerController extends BaseController
// set and save values
$row->setFirstName($req->request->get('first_name'))
->setLastName($req->request->get('last_name'))
+ ->setCustomerClassification($req->request->get('customer_classification'))
->setCustomerNotes($req->request->get('customer_notes'));
// initialize error lists
@@ -716,6 +729,7 @@ class CustomerController extends BaseController
if (isset($datatable['query']['data-rows-search']) && !empty($datatable['query']['data-rows-search'])) {
$query->where('q.first_name LIKE :filter')
->orWhere('q.last_name LIKE :filter')
+ ->orWhere('q.customer_classification LIKE :filter')
->setParameter('filter', '%' . $datatable['query']['data-rows-search'] . '%');
}
}
diff --git a/src/Controller/HubController.php b/src/Controller/HubController.php
index 8df4f6d4..5d361eee 100644
--- a/src/Controller/HubController.php
+++ b/src/Controller/HubController.php
@@ -84,6 +84,7 @@ class HubController extends BaseController
// add row data
$row['id'] = $orow->getID();
$row['name'] = $orow->getName();
+ $row['branch'] = $orow->getBranch();
$row['address'] = $orow->getAddress();
$row['contact_nums'] = $orow->getContactNumbers();
$row['time_open'] = $orow->getTimeOpen()->format('g:i A');
@@ -135,6 +136,7 @@ class HubController extends BaseController
// set and save values
$obj->setName($req->request->get('name'))
+ ->setBranch($req->request->get('branch'))
->setAddress($req->request->get('address'))
->setContactNumbers($req->request->get('contact_nums'))
->setTimeOpen($time_open)
diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php
index cda7fa32..5f101732 100644
--- a/src/Controller/JobOrderController.php
+++ b/src/Controller/JobOrderController.php
@@ -5,6 +5,7 @@ namespace App\Controller;
use App\Ramcar\BaseController;
use App\Ramcar\ServiceType;
use App\Ramcar\JOStatus;
+use App\Ramcar\WarrantyClass;
use App\Entity\JobOrder;
use App\Entity\BatteryManufacturer;
use App\Entity\Customer;
@@ -43,6 +44,7 @@ class JobOrderController extends BaseController
$params['outlet'] = $em->getRepository(Outlet::class)->findAll();
$params['rider'] = $em->getRepository(Rider::class)->findAll();
$params['service_types'] = ServiceType::getCollection();
+ $params['warranty_classes'] = WarrantyClass::getCollection();
$params['statuses'] = JOStatus::getCollection();
// response
@@ -88,6 +90,7 @@ class JobOrderController extends BaseController
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
->setCreatedBy($this->getUser())
->setServiceType($req->request->get('service_type'))
+ ->setWarrantyClass($req->request->get('warranty_class'))
->setCustomer($cust_vehicle->getCustomer())
->setCustomerVehicle($cust_vehicle)
->setSource('web')
@@ -188,9 +191,7 @@ class JobOrderController extends BaseController
$datatable = $req->request->get('datatable');
// count total records
- $tquery = $qb->select('COUNT(q)')
- ->join('q.cus_vehicle', 'cv')
- ->join('q.customer', 'c');
+ $tquery = $qb->select('COUNT(q)');
$this->setQueryFilters($datatable, $tquery, $qb, $tier_params['jo_status']);
@@ -214,22 +215,14 @@ class JobOrderController extends BaseController
];
// build query
- $query = $qb->select('q')
- ->addSelect('cv.plate_number as plate_number')
- ->addSelect('c.first_name as customer_name')
- ->addSelect('c.last_name as cust_last_name');
+ $query = $qb->select('q');
$this->setQueryFilters($datatable, $query, $qb, $tier_params['jo_status']);
// check if sorting is present, otherwise use default
if (isset($datatable['sort']['field']) && !empty($datatable['sort']['field'])) {
- $prefix = '';
-
- if (!in_array($datatable['sort']['field'], ['plate_number', 'customer_name']))
- $prefix = 'q.';
-
$order = $datatable['sort']['sort'] ?? 'asc';
- $query->orderBy($prefix . $datatable['sort']['field'], $order);
+ $query->orderBy('q.' . $datatable['sort']['field'], $order);
} else {
$query->orderBy('q.date_schedule', 'asc');
}
@@ -243,26 +236,16 @@ class JobOrderController extends BaseController
// process rows
$rows = [];
foreach ($obj_rows as $orow) {
- // get service type name
- $service_type = false;
+ $statuses = JOStatus::getCollection();
$service_types = ServiceType::getCollection();
- foreach ($service_types as $key => $service) {
- if ($key == $orow[0]->getServiceType()) {
- $service_type = $service;
- break;
- }
- }
// add row data
- $row['id'] = $orow[0]->getID();
- $row['date_schedule'] = $orow[0]->getDateSchedule()->format("d M Y");
- $row['date_schedule_time'] = $orow[0]->getDateSchedule()->format("g:i A");
- $row['service_type'] = $service_type;
- $row['plate_number'] = $orow['plate_number'];
- $row['customer_name'] = $orow['customer_name'] . " " . $orow['cust_last_name'];
- $row['mobile_numbers'] = implode("
", $orow[0]->getCustomer()->getMobileNumberList());
- $row['source'] = ucfirst($orow[0]->getSource());
- $row['flag_advance'] = $orow[0]->isAdvanceOrder();
+ $row['id'] = $orow->getID();
+ $row['delivery_address'] = $orow->getDeliveryAddress();
+ $row['date_schedule'] = $orow->isAdvanceOrder() ? $orow->getDateSchedule()->format("d M Y g:i A") : 'Immediate';
+ $row['service_type'] = $service_types[$orow->getServiceType()];
+ $row['status'] = $statuses[$orow->getStatus()];
+ $row['flag_advance'] = $orow->isAdvanceOrder();
// add crud urls
$row['meta']['update_url'] = $this->generateUrl($tier_params['edit_route'], ['id' => $row['id']]);
@@ -296,6 +279,7 @@ class JobOrderController extends BaseController
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
$params['customers'] = $em->getRepository(Customer::class)->findAll();
$params['service_types'] = ServiceType::getCollection();
+ $params['warranty_classes'] = WarrantyClass::getCollection();
$params['statuses'] = JOStatus::getCollection();
// get closest outlets
@@ -378,6 +362,7 @@ class JobOrderController extends BaseController
->setCoordinates($point)
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
->setServiceType($req->request->get('service_type'))
+ ->setWarrantyClass($req->request->get('warranty_class'))
->setSource('web')
->setStatus($req->request->get('status'))
->setDeliveryInstructions($req->request->get('delivery_instructions'))
@@ -431,6 +416,7 @@ class JobOrderController extends BaseController
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
$params['customers'] = $em->getRepository(Customer::class)->findAll();
$params['service_types'] = ServiceType::getCollection();
+ $params['warranty_classes'] = WarrantyClass::getCollection();
$params['statuses'] = JOStatus::getCollection();
// get closest outlets
@@ -513,6 +499,7 @@ class JobOrderController extends BaseController
->setCoordinates($point)
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
->setServiceType($req->request->get('service_type'))
+ ->setWarrantyClass($req->request->get('warranty_class'))
->setSource('web')
->setStatus($req->request->get('status'))
->setDeliveryInstructions($req->request->get('delivery_instructions'))
diff --git a/src/Controller/OutletController.php b/src/Controller/OutletController.php
index da270a2c..65d2a1b8 100644
--- a/src/Controller/OutletController.php
+++ b/src/Controller/OutletController.php
@@ -96,6 +96,7 @@ class OutletController extends BaseController
// add row data
$row['id'] = $orow[0]->getID();
$row['name'] = $orow[0]->getName();
+ $row['branch'] = $orow[0]->getBranch();
$row['address'] = $orow[0]->getAddress();
$row['contact_nums'] = $orow[0]->getContactNumbers();
$row['time_open'] = $orow[0]->getTimeOpen()->format('g:i A');
@@ -153,6 +154,7 @@ class OutletController extends BaseController
// set and save values
$obj->setName($req->request->get('name'))
+ ->setBranch($req->request->get('branch'))
->setAddress($req->request->get('address'))
->setContactNumbers($req->request->get('contact_nums'))
->setTimeOpen($time_open)
@@ -165,6 +167,7 @@ class OutletController extends BaseController
if (isset($datatable['query']['data-rows-search']) && !empty($datatable['query']['data-rows-search'])) {
$query->where('hub.name LIKE :filter')
->orWhere('q.name LIKE :filter')
+ ->orWhere('q.branch LIKE :filter')
->orWhere('q.address LIKE :filter')
->setParameter('filter', '%' . $datatable['query']['data-rows-search'] . '%');
}
diff --git a/src/Entity/Battery.php b/src/Entity/Battery.php
index 8af81bcc..07d9d33c 100644
--- a/src/Entity/Battery.php
+++ b/src/Entity/Battery.php
@@ -71,7 +71,7 @@ class Battery
* @ORM\Column(type="smallint")
* @Assert\NotBlank()
*/
- protected $warr_personal;
+ protected $warr_private;
// warranty commercial
/**
@@ -118,6 +118,8 @@ class Battery
// selling price (vat inclusive)
/**
* @ORM\Column(type="decimal", precision=7, scale=2, nullable=true)
+ * @Assert\NotBlank()
+ * @Assert\Range(min=0, minMessage="This value should be a valid number.")
*/
protected $sell_price;
@@ -193,15 +195,15 @@ class Battery
return $this->prod_code;
}
- public function setWarrantyPersonal($warr_personal)
+ public function setWarrantyPrivate($warr_private)
{
- $this->warr_personal = $warr_personal;
+ $this->warr_private = $warr_private;
return $this;
}
- public function getWarrantyPersonal()
+ public function getWarrantyPrivate()
{
- return $this->warr_personal;
+ return $this->warr_private;
}
public function setWarrantyCommercial($warr_commercial)
diff --git a/src/Entity/Customer.php b/src/Entity/Customer.php
index f9939d1f..fb1b083b 100644
--- a/src/Entity/Customer.php
+++ b/src/Entity/Customer.php
@@ -34,6 +34,13 @@ class Customer
*/
protected $last_name;
+ // customer classification
+ /**
+ * @ORM\Column(type="string", length=80)
+ * @Assert\NotBlank()
+ */
+ protected $customer_classification;
+
/**
* @ORM\Column(type="text", length=80)
*/
@@ -75,12 +82,21 @@ class Customer
*/
protected $flag_confirmed;
+ // if registered on mobile app
+ /**
+ * @ORM\Column(type="boolean")
+ */
+ protected $flag_mobile_app;
+
public function __construct()
{
$this->numbers = new ArrayCollection();
$this->sessions = new ArrayCollection();
$this->vehicles = new ArrayCollection();
$this->job_orders = new ArrayCollection();
+
+ $this->flag_confirmed = false;
+ $this->flag_mobile_app = false;
}
public function getID()
@@ -110,6 +126,17 @@ class Customer
return $this->last_name;
}
+ public function setCustomerClassification($customer_classification)
+ {
+ $this->customer_classification = $customer_classification;
+ return $this;
+ }
+
+ public function getCustomerClassification()
+ {
+ return $this->customer_classification;
+ }
+
public function setCustomerNotes($customer_notes)
{
$this->customer_notes = $customer_notes;
@@ -147,6 +174,15 @@ class Customer
return $numbers;
}
+ public function getPlateNumberList()
+ {
+ $plate_numbers = [];
+ foreach ($this->vehicles as $vehicle)
+ $plate_numbers[] = $vehicle->getPlateNumber();
+
+ return $plate_numbers;
+ }
+
public function addMobileSession(MobileSession $session)
{
$this->sessions->add($session);
@@ -192,6 +228,17 @@ class Customer
return $this->flag_confirmed;
}
+ public function setHasMobileApp($flag_mobile_app = true)
+ {
+ $this->flag_mobile_app = $flag_mobile_app;
+ return $this;
+ }
+
+ public function hasMobileApp()
+ {
+ return $this->flag_mobile_app;
+ }
+
public function getJobOrders()
{
return $this->job_orders;
diff --git a/src/Entity/Hub.php b/src/Entity/Hub.php
index 1251cf03..74eb1b41 100644
--- a/src/Entity/Hub.php
+++ b/src/Entity/Hub.php
@@ -2,64 +2,20 @@
namespace App\Entity;
+use App\Ramcar\Location;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
-use CrEOF\Spatial\PHP\Types\Geometry\Point;
use DateTime;
-
/**
* @ORM\Entity
* @ORM\Table(name="hub")
*/
class Hub
{
- // unique id
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $id;
-
- // name of hub
- /**
- * @ORM\Column(type="string", length=80)
- */
- protected $name;
-
- // address
- /**
- * @ORM\Column(type="string", length=80)
- */
- protected $address;
-
- // address coordinates
- /**
- * @ORM\Column(type="point")
- */
- protected $coordinates;
-
- // contact numbers
- // this is displayed in a textarea
- /**
- * @ORM\Column(type="string", length=200)
- */
- protected $contact_nums;
-
- // opening time
- /**
- * @ORM\Column(type="time")
- */
- protected $time_open;
-
- // closing time
- /**
- * @ORM\Column(type="time")
- */
- protected $time_close;
+ use Location;
// riders assigned to this hub
/**
@@ -75,81 +31,10 @@ class Hub
public function __construct()
{
- $this->riders = new ArrayCollection();
$this->time_open = new DateTime();
$this->time_close = new DateTime();
-
- }
-
- public function getID()
- {
- return $this->id;
- }
-
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- public function setAddress($address)
- {
- $this->address = $address;
- return $this;
- }
-
- public function getAddress()
- {
- return $this->address;
- }
-
- public function setCoordinates(Point $point)
- {
- $this->coordinates = $point;
- return $this;
- }
-
- public function getCoordinates()
- {
- return $this->coordinates;
- }
-
- public function setContactNumbers($nums)
- {
- $this->contact_nums = $nums;
- return $this;
- }
-
- public function getContactNumbers()
- {
- return $this->contact_nums;
- }
-
- public function setTimeOpen(DateTime $time_open)
- {
- $this->time_open = $time_open;
- return $this;
- }
-
- public function getTimeOpen()
- {
- return $this->time_open;
- }
-
- public function setTimeClose(DateTime $time_close)
- {
- $this->time_close = $time_close;
- return $this;
- }
-
- public function getTimeClose()
- {
- return $this->time_close;
+ $this->riders = new ArrayCollection();
+ $this->outlets = new ArrayCollection();
}
public function getRiders()
diff --git a/src/Entity/JobOrder.php b/src/Entity/JobOrder.php
index 201052b4..c834bca4 100644
--- a/src/Entity/JobOrder.php
+++ b/src/Entity/JobOrder.php
@@ -86,6 +86,12 @@ class JobOrder
*/
protected $service_type;
+ // warranty class
+ /**
+ * @ORM\Column(type="string", length=25)
+ */
+ protected $warranty_class;
+
// customer that requested job order
/**
* @ORM\ManyToOne(targetEntity="Customer", inversedBy="job_orders")
@@ -142,7 +148,8 @@ class JobOrder
// delivery address
/**
- * @ORM\Column(type="text", nullable=true)
+ * @ORM\Column(type="text")
+ * @Assert\NotBlank()
*/
protected $delivery_address;
@@ -259,6 +266,17 @@ class JobOrder
return $this->service_type;
}
+ public function setWarrantyClass($warranty_class)
+ {
+ $this->warranty_class = $warranty_class;
+ return $this;
+ }
+
+ public function getWarrantyClass()
+ {
+ return $this->warranty_class;
+ }
+
public function setCustomer(Customer $customer)
{
$this->customer = $customer;
diff --git a/src/Entity/Outlet.php b/src/Entity/Outlet.php
index abd7aa22..c52dcd36 100644
--- a/src/Entity/Outlet.php
+++ b/src/Entity/Outlet.php
@@ -2,11 +2,11 @@
namespace App\Entity;
+use App\Ramcar\Location;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
-use CrEOF\Spatial\PHP\Types\Geometry\Point;
use DateTime;
/**
@@ -15,55 +15,7 @@ use DateTime;
*/
class Outlet
{
- // unique id
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $id;
-
- // name of enrollee
- /**
- * @ORM\Column(type="string", length=80)
- * @Assert\NotBlank()
- */
- protected $name;
-
- // address
- /**
- * @ORM\Column(type="string", length=80)
- * @Assert\NotBlank()
- */
- protected $address;
-
- // address coordinates
- /**
- * @ORM\Column(type="point")
- */
- protected $coordinates;
-
- // contact numbers
- // this is displayed in a textarea
- /**
- * @ORM\Column(type="string", length=200)
- * @Assert\NotBlank()
- */
- protected $contact_nums;
-
- // opening time
- /**
- * @ORM\Column(type="time")
- * @Assert\NotBlank()
- */
- protected $time_open;
-
- // closing time
- /**
- * @ORM\Column(type="time")
- * @Assert\NotBlank()
- */
- protected $time_close;
+ use Location;
// job orders assigned to outlet
/**
@@ -81,78 +33,12 @@ class Outlet
{
$this->time_open = new DateTime();
$this->time_close = new DateTime();
+ $this->job_orders = new ArrayCollection();
}
-
- public function getID()
+ public function getJobOrders()
{
- return $this->id;
- }
-
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- public function setAddress($address)
- {
- $this->address = $address;
- return $this;
- }
-
- public function getAddress()
- {
- return $this->address;
- }
-
- public function setCoordinates(Point $point)
- {
- $this->coordinates = $point;
- return $this;
- }
-
- public function getCoordinates()
- {
- return $this->coordinates;
- }
-
- public function setContactNumbers($nums)
- {
- $this->contact_nums = $nums;
- return $this;
- }
-
- public function getContactNumbers()
- {
- return $this->contact_nums;
- }
-
- public function setTimeOpen(DateTime $time_open)
- {
- $this->time_open = $time_open;
- return $this;
- }
-
- public function getTimeOpen()
- {
- return $this->time_open;
- }
-
- public function setTimeClose(DateTime $time_close)
- {
- $this->time_close = $time_close;
- return $this;
- }
-
- public function getTimeClose()
- {
- return $this->time_close;
+ return $this->job_orders;
}
public function setHub(Hub $hub)
diff --git a/src/Ramcar/CustomerClassification.php b/src/Ramcar/CustomerClassification.php
new file mode 100644
index 00000000..f75b50aa
--- /dev/null
+++ b/src/Ramcar/CustomerClassification.php
@@ -0,0 +1,20 @@
+ 'Regular',
+ 'media' => 'Media',
+ 'vip' => 'VIP',
+ 'blacklisted' => 'Blacklisted',
+ 'other' => 'Other',
+ ];
+}
diff --git a/src/Ramcar/Location.php b/src/Ramcar/Location.php
new file mode 100644
index 00000000..31a4ef51
--- /dev/null
+++ b/src/Ramcar/Location.php
@@ -0,0 +1,151 @@
+id;
+ }
+
+ public function setName($name)
+ {
+ $this->name = $name;
+ return $this;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function setBranch($branch)
+ {
+ $this->branch = $branch;
+ return $this;
+ }
+
+ public function getBranch()
+ {
+ return $this->branch;
+ }
+
+ public function setAddress($address)
+ {
+ $this->address = $address;
+ return $this;
+ }
+
+ public function getAddress()
+ {
+ return $this->address;
+ }
+
+ public function setCoordinates(Point $point)
+ {
+ $this->coordinates = $point;
+ return $this;
+ }
+
+ public function getCoordinates()
+ {
+ return $this->coordinates;
+ }
+
+ public function setContactNumbers($nums)
+ {
+ $this->contact_nums = $nums;
+ return $this;
+ }
+
+ public function getContactNumbers()
+ {
+ return $this->contact_nums;
+ }
+
+ public function setTimeOpen(DateTime $time_open)
+ {
+ $this->time_open = $time_open;
+ return $this;
+ }
+
+ public function getTimeOpen()
+ {
+ return $this->time_open;
+ }
+
+ public function setTimeClose(DateTime $time_close)
+ {
+ $this->time_close = $time_close;
+ return $this;
+ }
+
+ public function getTimeClose()
+ {
+ return $this->time_close;
+ }
+}
\ No newline at end of file
diff --git a/src/Ramcar/WarrantyClass.php b/src/Ramcar/WarrantyClass.php
new file mode 100644
index 00000000..ca850d9b
--- /dev/null
+++ b/src/Ramcar/WarrantyClass.php
@@ -0,0 +1,14 @@
+ 'Private',
+ 'commercial' => 'Commercial',
+ ];
+}
diff --git a/templates/battery/form.html.twig b/templates/battery/form.html.twig
index dc7ee01e..51c8cdb8 100644
--- a/templates/battery/form.html.twig
+++ b/templates/battery/form.html.twig
@@ -114,11 +114,11 @@
| Name | -Address | -Numbers | -Opening | -Closing | -Sales Count | -Sales Amount | -Service Count | +Outlet | +Branch | Distance | Travel Time | -Sales (Day) | +Services (Day) | +Contact Numbers | @@ -361,15 +368,12 @@ {% for outlet in outlets %}|||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ outlet.outlet.getName }} | -{{ outlet.outlet.getAddress }} | -{{ outlet.outlet.getContactNumbers }} | -{{ outlet.outlet.getTimeOpen|date("g:i A") }} | -{{ outlet.outlet.getTimeClose|date("g:i A") }} | -0.00 | -0.00 | -0 | +{{ outlet.outlet.getBranch }} | {{ outlet.distance ? outlet.distance : '-' }} | {{ outlet.duration ? outlet.duration : '-' }} | +0 | +0 | +{{ outlet.outlet.getContactNumbers }} | ||||
| ' + battery.find('option:selected').text() + ' | ' + '' + qty.val() + ' | ' + - 'Base Price | ' + // TODO: static for now - '' + (Math.round(unitPrice * 100) / 100).toFixed(2) + ' | ' + // TODO: not sure if this is correct since it says w/ tax - '0.00 | ' + // TODO: static for now - '' + (Math.round(subtotal * 100) / 100).toFixed(2) + ' | ' + // TODO: I assumed this is unit price * qty - 'Yes | ' + // TODO: static for now - 'Regular | ' + - '' + - ' | ' + - ' | ' + - ' | ' + - ' | ' + + ' | ' + warrantyClasses[warrantyClass] + ' | ' + + '' + warrantyLength + ' month' + (warrantyLength > 1 ? 's' : '') + ' | ' + + '' + // TODO: Date of Purchase, blank for now + ' | ' + // TODO: Warranty until, blank for now ' | ' + ' |