diff --git a/src/Service/HubDistributor.php b/src/Service/HubDistributor.php
index 2b32cce5..44069f03 100644
--- a/src/Service/HubDistributor.php
+++ b/src/Service/HubDistributor.php
@@ -95,14 +95,20 @@ class HubDistributor
usort($arranged_hubs, function($a, $b) {
if ($a['jo_count'] == $b['jo_count'])
- return 0;
+ {
+ if ($a['distance'] == $b['distance'])
+ return 0;
+ if ($a['distance'] < $b['distance'])
+ return -1;
+ return 1;
+ }
if ($a['jo_count'] < $b['jo_count'])
return -1;
else
return 1;
});
- //error_log('arranged hubs ' . json_encode($arranged_hubs));
+ error_log('arranged hubs ' . json_encode($arranged_hubs));
return $arranged_hubs;
}
diff --git a/src/Service/HubSelector.php b/src/Service/HubSelector.php
index ab810c20..87aea726 100644
--- a/src/Service/HubSelector.php
+++ b/src/Service/HubSelector.php
@@ -92,7 +92,7 @@ class HubSelector
$hubs_round_robin = $this->filterHubsByRoundRobin($filtered_hubs, $flag_round_robin);
$filtered_hubs = $hubs_round_robin;
- //error_log('round robin hubs ' . json_encode($filtered_hubs));
+ error_log('round robin hubs ' . json_encode($filtered_hubs));
// max results filter
$hubs_max_result = $this->filterHubsByMaxResults($filtered_hubs, $limit_results, $jo_id, $customer_id);
diff --git a/src/Service/JobOrderHandler/ResqJobOrderHandler.php b/src/Service/JobOrderHandler/ResqJobOrderHandler.php
index 971f6903..32a2db28 100644
--- a/src/Service/JobOrderHandler/ResqJobOrderHandler.php
+++ b/src/Service/JobOrderHandler/ResqJobOrderHandler.php
@@ -1985,7 +1985,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
if ($this->hub_geofence->isCovered($long, $lat))
{
// if true, set other values for HubCriteria
- // error_log('Area is covered by hub filtering');
+ error_log('Area is covered by hub filtering');
$hub_criteria->setPaymentMethod($obj->getModeOfPayment())
->setJoType($obj->getServiceType())
->setRoundRobin(true);
@@ -2035,6 +2035,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
// counters
$hub['rider_count'] = count($hub['hub']->getAvailableRiders());
+ $hub['redis_jo_count'] = $hub['jo_count'];
$hub['jo_count'] = count($hub['hub']->getForAssignmentJobOrders());
// check for rejection
@@ -2337,6 +2338,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
// counters
$hub['rider_count'] = count($hub['hub']->getAvailableRiders());
+ $hub['redis_jo_count'] = $hub['jo_count'];
$hub['jo_count'] = count($hub['hub']->getForAssignmentJobOrders());
// check for rejection
diff --git a/templates/job-order/form.html.twig b/templates/job-order/form.html.twig
index fede693a..e29d7aa5 100644
--- a/templates/job-order/form.html.twig
+++ b/templates/job-order/form.html.twig
@@ -645,67 +645,67 @@
{% if mode in ['update-processing', 'update-reassign-hub'] %}
-
+