From 83cd3a008b8661e4565f5bd9b820e190c0ec9c3e Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 31 Jan 2018 20:25:47 +0800 Subject: [PATCH 01/11] Replace warranty personal with warranty private --- src/Controller/APIController.php | 2 +- src/Controller/BatteryController.php | 6 +++--- src/Entity/Battery.php | 10 +++++----- templates/battery/form.html.twig | 6 +++--- templates/battery/list.html.twig | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) 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/Entity/Battery.php b/src/Entity/Battery.php index 87ed9666..c1c95931 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 /** @@ -193,15 +193,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/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 @@
-
diff --git a/templates/battery/list.html.twig b/templates/battery/list.html.twig index f0001f4d..71f8f9b0 100644 --- a/templates/battery/list.html.twig +++ b/templates/battery/list.html.twig @@ -104,7 +104,7 @@ width: 150 }, { - field: 'warr_personal', + field: 'warr_private', title: 'Personal Wty.', width: 170 }, From 14d702c42be43b9f71e16b4ef21a8b4515accfc0 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 31 Jan 2018 20:28:53 +0800 Subject: [PATCH 02/11] Update battery list columns --- templates/battery/list.html.twig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/battery/list.html.twig b/templates/battery/list.html.twig index 71f8f9b0..28fe3a32 100644 --- a/templates/battery/list.html.twig +++ b/templates/battery/list.html.twig @@ -83,14 +83,16 @@ title: 'ID', width: 30 }, + /* { field: 'mfg_name', title: 'Manufacturer', width: 150 }, + */ { field: 'model_name', - title: 'Model', + title: 'Brand', width: 150 }, { @@ -98,14 +100,16 @@ title: 'Size', width: 100 }, + /* { field: 'prod_code', title: 'Product Code', width: 150 }, + */ { field: 'warr_private', - title: 'Personal Wty.', + title: 'Private Wty.', width: 170 }, { @@ -115,7 +119,7 @@ }, { field: 'sell_price', - title: 'SRP' + title: 'Price' }, { field: 'Actions', From fa5122235a678dc97f29bc7aa111e2ea072a5d59 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 31 Jan 2018 23:55:16 +0800 Subject: [PATCH 03/11] Add customer classification field --- src/Entity/Customer.php | 47 +++++++++++++++++++++++++++ src/Ramcar/CustomerClassification.php | 20 ++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/Ramcar/CustomerClassification.php 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/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', + ]; +} From 7bf2b7aa5df622da77a186113f56e9796be8d5e2 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 31 Jan 2018 23:55:51 +0800 Subject: [PATCH 04/11] Add branch field to hub and outlet, create location trait --- src/Entity/Hub.php | 123 ++------------------------------ src/Entity/Outlet.php | 124 ++------------------------------- src/Ramcar/Location.php | 151 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 160 insertions(+), 238 deletions(-) create mode 100644 src/Ramcar/Location.php 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/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/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 From 8f4b745025bc5d44ec873059c2b3c92b711ad705 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 31 Jan 2018 23:56:25 +0800 Subject: [PATCH 05/11] Update list columns and fields based on feedback --- src/Controller/CustomerController.php | 18 ++++++++- src/Controller/HubController.php | 2 + src/Controller/JobOrderController.php | 40 +++++--------------- src/Controller/OutletController.php | 3 ++ src/Entity/JobOrder.php | 3 +- templates/customer/form.html.twig | 17 +++++++-- templates/customer/list.html.twig | 33 ++++++++++++++++ templates/hub/form.html.twig | 48 +++++++++++++++--------- templates/hub/list.html.twig | 6 ++- templates/job-order/form.html.twig | 29 ++++++-------- templates/job-order/list.html.twig | 31 +++++++-------- templates/outlet/form.html.twig | 54 +++++++++++++++------------ templates/outlet/list.html.twig | 6 ++- 13 files changed, 175 insertions(+), 115 deletions(-) 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..be3db619 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -188,9 +188,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 +212,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 +233,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']]); 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/JobOrder.php b/src/Entity/JobOrder.php index 201052b4..b026768a 100644 --- a/src/Entity/JobOrder.php +++ b/src/Entity/JobOrder.php @@ -142,7 +142,8 @@ class JobOrder // delivery address /** - * @ORM\Column(type="text", nullable=true) + * @ORM\Column(type="text") + * @Assert\NotBlank() */ protected $delivery_address; diff --git a/templates/customer/form.html.twig b/templates/customer/form.html.twig index 62ebc0a7..84d28664 100644 --- a/templates/customer/form.html.twig +++ b/templates/customer/form.html.twig @@ -53,23 +53,34 @@
-
+
-
+
+
+
+ + +
-
+
diff --git a/templates/customer/list.html.twig b/templates/customer/list.html.twig index 298d3eea..507e3f89 100644 --- a/templates/customer/list.html.twig +++ b/templates/customer/list.html.twig @@ -91,6 +91,20 @@ field: 'last_name', title: 'Last Name' }, + { + field: 'customer_classification', + title: 'Classification' + }, + { + field: 'mobile_numbers', + title: 'Mobile Numbers', + sortable: false + }, + { + field: 'plate_numbers', + title: 'Plate Numbers', + sortable: false + }, { field: 'flag_confirmed', title: 'Status', @@ -106,6 +120,25 @@ return tag; } }, + { + field: 'flag_mobile_app', + title: 'Has Mobile App?', + template: function (row, index, datatable) { + var tag = ''; + + if (row.flag_mobile_app === true) { + tag = 'Yes'; + } else { + tag = 'No'; + } + + return tag; + } + }, + { + field: 'app_mobile_number', + title: 'Registered Number' + }, { field: 'Actions', width: 110, diff --git a/templates/hub/form.html.twig b/templates/hub/form.html.twig index 7b78ce59..8b3c54ee 100644 --- a/templates/hub/form.html.twig +++ b/templates/hub/form.html.twig @@ -58,6 +58,31 @@
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
-
-
- - - -
-
- - - -
-