Add job order count for hubs in jo form. #596
This commit is contained in:
parent
625236667b
commit
b761e2bfb5
3 changed files with 62 additions and 60 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -645,67 +645,67 @@
|
|||
</div>
|
||||
|
||||
{% if mode in ['update-processing', 'update-reassign-hub'] %}
|
||||
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||
<div class="m-form__section">
|
||||
<div class="m-form__heading">
|
||||
<h3 class="m-form__heading-title">
|
||||
Nearest Hubs
|
||||
</h3>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-12">
|
||||
<label>Click on a row to select a hub</label>
|
||||
<div class="form-control-feedback hide" data-field="hub"></div>
|
||||
<div class="table-frame" data-name="hub">
|
||||
<table id="hubs-table" class="table table-compact table-hover table-clickable m-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hub</th>
|
||||
<th>Branch</th>
|
||||
<!--
|
||||
<th class="text-right">Distance</th>
|
||||
<th class="text-right">Travel Time</th>
|
||||
-->
|
||||
<th class="text-right">Available Riders</th>
|
||||
<th class="text-right">Jobs For Assignment</th>
|
||||
<th class="text-right">Inventory</th>
|
||||
<th>Contact Numbers</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="placeholder-row{{ hubs|length > 0 ? ' hide' }}">
|
||||
<td colspan="7">
|
||||
No items to display.
|
||||
</td>
|
||||
</tr>
|
||||
<div class="m-form__heading">
|
||||
<h3 class="m-form__heading-title">
|
||||
Nearest Hubs
|
||||
</h3>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-12">
|
||||
<label>Click on a row to select a hub</label>
|
||||
<div class="form-control-feedback hide" data-field="hub"></div>
|
||||
<div class="table-frame" data-name="hub">
|
||||
<table id="hubs-table" class="table table-compact table-hover table-clickable m-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hub</th>
|
||||
<th>Branch</th>
|
||||
<!--<th class="text-right">Distance</th>
|
||||
<th class="text-right">Travel Time</th>
|
||||
-->
|
||||
<th class="text-right">Available Riders</th>
|
||||
<th class="text-right">Job Order Count</th>
|
||||
<th class="text-right">Jobs For Assignment</th>
|
||||
<th class="text-right">Inventory</th>
|
||||
<th>Contact Numbers</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="placeholder-row{{ hubs|length > 0 ? ' hide' }}">
|
||||
<td colspan="8">
|
||||
No items to display.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% for hub in hubs %}
|
||||
<tr data-lat="{{ hub.hub.getCoordinates.getLatitude }}" data-lng="{{ hub.hub.getCoordinates.getLongitude }}" data-id="{{ hub.hub.getID }}"{{ obj.getHub and obj.getHub.getID == hub.hub.getID ? ' class="m-table__row--primary"' }}>
|
||||
<td>{{ hub.hub.getName }}</td>
|
||||
<td>{{ hub.hub.getBranch }}</td>
|
||||
<!--
|
||||
<td class="text-right">{{ hub.distance ? hub.distance : '-' }}</td>
|
||||
<td class="text-right">{{ hub.duration ? hub.duration : '-' }}</td>
|
||||
-->
|
||||
<td class="text-right">{{ hub.rider_count }}</td>
|
||||
<td class="text-right">{{ hub.jo_count }}</td>
|
||||
<td class="text-right">{{ hub.inventory|default('0') }}</td>
|
||||
<td>{{ hub.hub.getContactNumbers|replace({"\n": ', '}) }}</td>
|
||||
<td>
|
||||
{% if hub.flag_rejected %}
|
||||
<button type="button" class="btn btn-danger btn-disabled" disabled>Rejected</button>
|
||||
{% else %}
|
||||
<button type="button" data-hub-id="{{ hub.hub.getID }}" data-hub-name="{{ hub.hub.getName }}" data-hub-branch="{{ hub.hub.getBranch }}" class="btn-reject btn btn-info">Reject</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% for hub in hubs %}
|
||||
<tr data-lat="{{ hub.hub.getCoordinates.getLatitude }}" data-lng="{{ hub.hub.getCoordinates.getLongitude }}" data-id="{{ hub.hub.getID }}"{{ obj.getHub and obj.getHub.getID == hub.hub.getID ? ' class="m-table__row--primary"' }}>
|
||||
<td>{{ hub.hub.getName }}</td>
|
||||
<td>{{ hub.hub.getBranch }}</td>
|
||||
<!--<td class="text-right">{{ hub.distance ? hub.distance : '-' }}</td>
|
||||
<td class="text-right">{{ hub.duration ? hub.duration : '-' }}</td>
|
||||
-->
|
||||
<td class="text-right">{{ hub.rider_count }}</td>
|
||||
<td class="text-right">{{ hub.redis_jo_count }}</td>
|
||||
<td class="text-right">{{ hub.jo_count }}</td>
|
||||
<td class="text-right">{{ hub.inventory|default('0') }}</td>
|
||||
<td>{{ hub.hub.getContactNumbers|replace({"\n": ', '}) }}</td>
|
||||
<td>
|
||||
{% if hub.flag_rejected %}
|
||||
<button type="button" class="btn btn-danger btn-disabled" disabled>Rejected</button>
|
||||
{% else %}
|
||||
<button type="button" data-hub-id="{{ hub.hub.getID }}" data-hub-name="{{ hub.hub.getName }}" data-hub-branch="{{ hub.hub.getBranch }}" class="btn-reject btn btn-info">Reject</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||
<div class="m-form__section">
|
||||
<div class="form-group m-form__group row">
|
||||
|
|
|
|||
Loading…
Reference in a new issue