From 115b99eb7377e4a2147b55c876d080f09e936823 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 30 Apr 2019 10:58:46 +0000 Subject: [PATCH 1/6] Add details form for legacy job order search results. #207 --- config/routes/search.yaml | 4 + src/Controller/SearchController.php | 20 ++ templates/search/form.html.twig | 2 + templates/search/legacyjo_details.html.twig | 229 ++++++++++++++++++++ 4 files changed, 255 insertions(+) create mode 100644 templates/search/legacyjo_details.html.twig diff --git a/config/routes/search.yaml b/config/routes/search.yaml index 54bebd51..b21d8562 100644 --- a/config/routes/search.yaml +++ b/config/routes/search.yaml @@ -6,3 +6,7 @@ search_history: path: /search/history controller: App\Controller\SearchController::search methods: [GET] + +search_legacyjo_details: + path: /search/legacyjo/{id}/details + controller: App\Controller\SearchController::legacyJODetails diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 1e660e16..9706e914 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -3,8 +3,11 @@ namespace App\Controller; use App\Ramcar\BaseController; + use App\Service\GeneralSearch; +use App\Entity\LegacyJobOrder; + use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -46,4 +49,21 @@ class SearchController extends BaseController // response return $this->render('search/form.html.twig', $params); } + + public function legacyJODetails($id) + { + $this->denyAccessUnlessGranted('general.search', null, 'No access.'); + + // get legacy job order + $em = $this->getDoctrine()->getManager(); + $legacy_jo = $em->getRepository(LegacyJobOrder::class)->find($id); + + $params = $this->initParameters('general.search'); + $params['data'] = $legacy_jo; + $params['search_term'] = $search_term; + $params['mode'] = "details"; + + // response + return $this->render('search/legacyjo_details.html.twig', $params); + } } diff --git a/templates/search/form.html.twig b/templates/search/form.html.twig index 9e9d22c7..fc830136 100644 --- a/templates/search/form.html.twig +++ b/templates/search/form.html.twig @@ -86,6 +86,7 @@ Last Name First Name Plate Number + @@ -95,6 +96,7 @@ {{ result.getCustLastName|default('') }} {{ result.getCustFirstName|default('') }} {{ result.getPlateNumber|default('') }} + Details {% endfor %} diff --git a/templates/search/legacyjo_details.html.twig b/templates/search/legacyjo_details.html.twig new file mode 100644 index 00000000..9177e9c9 --- /dev/null +++ b/templates/search/legacyjo_details.html.twig @@ -0,0 +1,229 @@ +{% extends 'base.html.twig' %} + +{% block body %} + +
+
+
+

Job Order

+
+
+
+ +
+ +
+
+
+
+

+ Customer Details +

+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+ +63 + + +
+
+
+ +
+ +63 + + +
+
+
+
+
+ +
+ +63 + + +
+
+
+
+
+
+

+ Vehicle Details +

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+
+

+ Transaction Details +

+ + + +
+
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+
+
+ + + +
+
+
+
+
+ + + +
+
+
+ + +
+
+
+
+ + + +
+
+
+ + + +
+
+
+
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+
+
+

+ Location +

+
+
+
+ + + +
+
+ + + +
+
+
+
+
+
+{% endblock %} From 32fa839e2c478da3ee9f90064f6117491ac4c011 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 30 Apr 2019 11:53:47 +0000 Subject: [PATCH 2/6] Display the legacy job order details when Details is clicked. #207 --- src/Controller/SearchController.php | 1 - src/Entity/LegacyJobOrder.php | 8 ++++---- templates/search/form.html.twig | 2 +- templates/search/legacyjo_details.html.twig | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 9706e914..3afbe85c 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -60,7 +60,6 @@ class SearchController extends BaseController $params = $this->initParameters('general.search'); $params['data'] = $legacy_jo; - $params['search_term'] = $search_term; $params['mode'] = "details"; // response diff --git a/src/Entity/LegacyJobOrder.php b/src/Entity/LegacyJobOrder.php index fde4d7ff..17485fc7 100644 --- a/src/Entity/LegacyJobOrder.php +++ b/src/Entity/LegacyJobOrder.php @@ -642,15 +642,15 @@ class LegacyJobOrder return $this->dispatch_date; } - public function setDispatchBy($dispatch_by) + public function setDispatchedBy($dispatched_by) { - $this->dispatch_by = $dispatch_by; + $this->dispatched_by = $dispatched_by; return $this; } - public function getDispatchBy() + public function getDispatchedBy() { - return $this->dispatch_by; + return $this->dispatched_by; } public function setAddress($address) diff --git a/templates/search/form.html.twig b/templates/search/form.html.twig index fc830136..892ca1ed 100644 --- a/templates/search/form.html.twig +++ b/templates/search/form.html.twig @@ -96,7 +96,7 @@ {{ result.getCustLastName|default('') }} {{ result.getCustFirstName|default('') }} {{ result.getPlateNumber|default('') }} - Details + Details {% endfor %} diff --git a/templates/search/legacyjo_details.html.twig b/templates/search/legacyjo_details.html.twig index 9177e9c9..23d11f55 100644 --- a/templates/search/legacyjo_details.html.twig +++ b/templates/search/legacyjo_details.html.twig @@ -80,7 +80,7 @@
- +
@@ -178,7 +178,7 @@
- +
From 55bd686b3452881ccddf2e1042e2789d5c3eb8d8 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 30 Apr 2019 11:58:36 +0000 Subject: [PATCH 3/6] Disable the text areas and advance order slider. #207 --- templates/search/legacyjo_details.html.twig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/search/legacyjo_details.html.twig b/templates/search/legacyjo_details.html.twig index 23d11f55..2c96b5b5 100644 --- a/templates/search/legacyjo_details.html.twig +++ b/templates/search/legacyjo_details.html.twig @@ -104,7 +104,7 @@ @@ -152,7 +152,7 @@
- +
@@ -166,7 +166,7 @@
- +
@@ -193,12 +193,12 @@
- +
- +
@@ -213,12 +213,12 @@
- +
- +
From 2a31a2823dc7214ffdc3723c1938f279915c4442 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 30 Apr 2019 12:27:41 +0000 Subject: [PATCH 4/6] Fix the look of the details form. #207 --- templates/search/legacyjo_details.html.twig | 404 +++++++++++--------- 1 file changed, 213 insertions(+), 191 deletions(-) diff --git a/templates/search/legacyjo_details.html.twig b/templates/search/legacyjo_details.html.twig index 2c96b5b5..f43e9e49 100644 --- a/templates/search/legacyjo_details.html.twig +++ b/templates/search/legacyjo_details.html.twig @@ -11,217 +11,239 @@
+ +
+
+
+
+
+
+ + + +

+ Legacy Job Order +

+
+
+
+
+
+
+
-
-
-

- Customer Details -

-
-
-
- - - +
+
+
+

+ Customer Details +

-
- - - -
-
-
-
- -
- +63 - - +
+
+ + + +
+
+ + +
-
- -
- +63 - - +
+
+ +
+ +63 + + +
+
+
+ +
+ +63 + + +
+
+
+
+
+ +
+ +63 + + +
-
-
- -
- +63 - - +
+
+

+ Vehicle Details +

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ + +
-
-
-
-

- Vehicle Details -

-
-
-
- - - +
+
+

+ Transaction Details +

+ + +
-
- - - +
+
+ + + +
+
+ + + +
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
-

- Transaction Details -

- - - -
-
-
- - - -
-
- - - -
-
-
-
- - - -
-
- -
- - - - +
+
+ + + +
+
+ +
+ + + + +
+
- -
-
- -
- - - - -
- -
-
-
-
- - - -
-
-
-
-
- - - -
-
-
- - -
-
-
-
- - - -
-
-
- - - +
+ +
+ + + + +
+
+
+
+ + + +
+
+
+
+
+ + + +
+
+
+ + +
+
+
+
+ + + +
+
+
+ + + +
+
+
+
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
-
-
- - - +
+
+
+

+ Location +

+
+
+ + + +
+
+ + + +
+
-
-
- - - -
-
- - - -
-
-
-
-
-
-

- Location -

-
-
-
- - - -
-
- - - -
-
From 92054296621b48569fdf7c6074869ace953dec34 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 1 May 2019 09:34:00 +0000 Subject: [PATCH 5/6] Add the legacy job order row details to the details page. #207 --- src/Controller/SearchController.php | 1 + src/Entity/LegacyJobOrder.php | 9 + src/Entity/LegacyJobOrderRow.php | 106 +++++ templates/search/legacyjo_details.html.twig | 475 +++++++++++--------- 4 files changed, 374 insertions(+), 217 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 3afbe85c..9632c0fc 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -7,6 +7,7 @@ use App\Ramcar\BaseController; use App\Service\GeneralSearch; use App\Entity\LegacyJobOrder; +use App\Entity\LegacyJobOrderRow; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Entity/LegacyJobOrder.php b/src/Entity/LegacyJobOrder.php index 17485fc7..e9cbd660 100644 --- a/src/Entity/LegacyJobOrder.php +++ b/src/Entity/LegacyJobOrder.php @@ -343,6 +343,10 @@ class LegacyJobOrder */ protected $plate_number; + /** + * @ORM\OneToMany(targetEntity="LegacyJobOrderRow", mappedBy="job_order") + */ + protected $rows; public function setID($id) @@ -696,4 +700,9 @@ class LegacyJobOrder { return $this->plate_number; } + + public function getRows() + { + return $this->rows; + } } diff --git a/src/Entity/LegacyJobOrderRow.php b/src/Entity/LegacyJobOrderRow.php index 6927afb2..dd8ac461 100644 --- a/src/Entity/LegacyJobOrderRow.php +++ b/src/Entity/LegacyJobOrderRow.php @@ -59,6 +59,12 @@ class LegacyJobOrderRow */ protected $enrollee; + /** + * @ORM\ManyToOne(targetEntity="LegacyJobOrder", inversedBy="rows") + * @ORM\JoinColumn(name="legacy_job_order_id", referencedColumnName="id", nullable=true) + */ + protected $job_order; + public function setID($id) { $this->id = $id; @@ -69,4 +75,104 @@ class LegacyJobOrderRow { return $this->id; } + + public function setJobOrderID($job_order_id) + { + $this->job_order_id = $job_order_id; + return $this; + } + + public function getJobOrderID() + { + return $this->job_order_id; + } + + public function setItem($item) + { + $this->item = $item; + return $this; + } + + public function getItem() + { + return $this->item; + } + + public function setQty($qty) + { + $this->qty = $qty; + return $this; + } + + public function getQty() + { + return $this->qty; + } + + public function setPrice($price) + { + $this->price = $price; + return $this; + } + + public function getPrice() + { + return $this->price; + } + + public function setPriceLevel($price_level) + { + $this->price_level = $price_level; + return $this; + } + + public function getPriceLevel() + { + return $this->price_level; + } + + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + public function getStatus() + { + return $this->status; + } + + public function setAccount($account) + { + $this->account = $account; + return $this; + } + + public function getAccount() + { + return $this->account; + } + + public function setEnrollee($enrollee) + { + $this->enrollee = $enrollee; + return $this; + } + + public function getEnrollee() + { + return $this->enrollee; + } + + public function setJobOrder(LegacyJobOrder $job_order) + { + $this->job_order = $job_order; + return $this; + } + + public function getJobOrder() + { + return $this->job_order; + } + } diff --git a/templates/search/legacyjo_details.html.twig b/templates/search/legacyjo_details.html.twig index f43e9e49..7b1bafd4 100644 --- a/templates/search/legacyjo_details.html.twig +++ b/templates/search/legacyjo_details.html.twig @@ -27,225 +27,266 @@
+ +
+
+
+
+
+

+ Customer Details +

+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+ +63 + + +
+
+
+ +
+ +63 + + +
+
+
+
+
+ +
+ +63 + + +
+
+
+
+
+
+

+ Vehicle Details +

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+
+

+ Transaction Details +

+ + + +
+
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+
+
+ + + +
+
+
+
+
+ + + +
+
+
+ + +
+
+
+
+ + + +
+
+
+ + + +
+
+
+
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+ {% if data.getRows is empty %} + + {% else %} + + + + + + + + + + + + + + + {% for row in data.getRows %} + + + + + + + + + + {% endfor %} + +
IDItemQuantityPricePrice LevelStatusAccountEnrollee
{{ row.getID|default("") }}{{ row.getItem|default('') }}{{ row.getQuantity|default('') }}{{ row.getPrice|default('') }}{{ row.getStatus|default('') }}{{ row.getAccount|default('') }}{{ row.getEnrollee|default('') }}
+ {% endif %} +
+
+
+
+
+
+

+ Location +

+
+
+
+ + + +
+
+ + + +
+
+
+
+
- - -
-
-
-
-
-

- Customer Details -

-
-
-
- - - -
-
- - - -
-
-
-
- -
- +63 - - -
-
-
- -
- +63 - - -
-
-
-
-
- -
- +63 - - -
-
-
-
-
-
-

- Vehicle Details -

-
-
-
- - - -
-
- - - -
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
-

- Transaction Details -

- - - -
-
-
- - - -
-
- - - -
-
-
-
- - - -
-
- -
- - - - -
- -
-
- -
- - - - -
- -
-
-
-
- - - -
-
-
-
-
- - - -
-
-
- - -
-
-
-
- - - -
-
-
- - - -
-
-
-
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
-
-

- Location -

-
-
-
- - - -
-
- - - -
-
-
-
-
-
{% endblock %} From fbbfaa56373ce91c60ab3c9876df7dad50442114 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 1 May 2019 09:55:47 +0000 Subject: [PATCH 6/6] Fix wiring and missing fields for legacy_job_order_row. #207 --- src/Entity/LegacyJobOrderRow.php | 22 +++------------------ templates/search/legacyjo_details.html.twig | 1 + 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/Entity/LegacyJobOrderRow.php b/src/Entity/LegacyJobOrderRow.php index dd8ac461..1b52ee6a 100644 --- a/src/Entity/LegacyJobOrderRow.php +++ b/src/Entity/LegacyJobOrderRow.php @@ -19,11 +19,6 @@ class LegacyJobOrderRow */ protected $id; - /** - * @ORM\Column(type="integer") - */ - protected $job_order_id; - /** * @ORM\Column(type="string", length=40) */ @@ -61,7 +56,7 @@ class LegacyJobOrderRow /** * @ORM\ManyToOne(targetEntity="LegacyJobOrder", inversedBy="rows") - * @ORM\JoinColumn(name="legacy_job_order_id", referencedColumnName="id", nullable=true) + * @ORM\JoinColumn(name="job_order_id", referencedColumnName="id", nullable=true) */ protected $job_order; @@ -76,17 +71,6 @@ class LegacyJobOrderRow return $this->id; } - public function setJobOrderID($job_order_id) - { - $this->job_order_id = $job_order_id; - return $this; - } - - public function getJobOrderID() - { - return $this->job_order_id; - } - public function setItem($item) { $this->item = $item; @@ -98,13 +82,13 @@ class LegacyJobOrderRow return $this->item; } - public function setQty($qty) + public function setQuantity($qty) { $this->qty = $qty; return $this; } - public function getQty() + public function getQuantity() { return $this->qty; } diff --git a/templates/search/legacyjo_details.html.twig b/templates/search/legacyjo_details.html.twig index 7b1bafd4..c221f3e0 100644 --- a/templates/search/legacyjo_details.html.twig +++ b/templates/search/legacyjo_details.html.twig @@ -252,6 +252,7 @@ {{ row.getItem|default('') }} {{ row.getQuantity|default('') }} {{ row.getPrice|default('') }} + {{ row.getPriceLevel|default('') }} {{ row.getStatus|default('') }} {{ row.getAccount|default('') }} {{ row.getEnrollee|default('') }}