Add color coding for JOs that are for VIP customers or emergencies. #673

This commit is contained in:
Korina Cordero 2022-05-31 09:37:29 +00:00
parent 9ac0c1613d
commit fe0243a4cc
3 changed files with 56 additions and 5 deletions

View file

@ -155,6 +155,30 @@ span.has-danger,
color: #fff !important; color: #fff !important;
} }
.m-table__row--is_vip td {
background-color: #ffff00 !important;
color: #fff !important;
}
.m-table__row--is_vip td > span,
.m-table__row--is_vip td > span a,
.m-table__row--is_vip td > span a i {
color: #fff !important;
}
.m-table__row--is_emergency td {
background-color: #ffa500 !important;
color: #fff !important;
}
.m-table__row--is_emergency td > span,
.m-table__row--is_emergency td > span a,
.m-table__row--is_emergency td > span a i {
color: #fff !important;
}
.m-datatable.m-datatable--default > .m-datatable__table { .m-datatable.m-datatable--default > .m-datatable__table {
min-height: 0 !important; min-height: 0 !important;
} }

View file

@ -46,6 +46,7 @@ use App\Ramcar\HubCriteria;
use App\Ramcar\DeliveryStatus; use App\Ramcar\DeliveryStatus;
use App\Ramcar\SourceOfAwareness; use App\Ramcar\SourceOfAwareness;
use App\Ramcar\InitialConcern; use App\Ramcar\InitialConcern;
use App\Ramcar\CustomerClassification;
use App\Service\InvoiceGeneratorInterface; use App\Service\InvoiceGeneratorInterface;
use App\Service\JobOrderHandlerInterface; use App\Service\JobOrderHandlerInterface;
@ -185,8 +186,20 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
$service_types = ServiceType::getCollection(); $service_types = ServiceType::getCollection();
// process rows // process rows
$is_vip = false;
$is_emergency = false;
$rows = []; $rows = [];
foreach ($obj_rows as $orow) { foreach ($obj_rows as $orow) {
// check if customer is vip
$cust_class = $orow->getCustomer()->getCustomerClassification();
if ($cust_class == CustomerClassification::VIP)
$is_vip = true;
// check if customer is not willing to wait
$will_not_wait = $orow->getWillWait();
if ($will_not_wait == WillingToWaitContent::NOT_WILLING_TO_WAIT)
$is_emergency = true;
// add row data // add row data
$row['id'] = $orow->getID(); $row['id'] = $orow->getID();
$row['customer_name'] = $orow->getCustomer()->getFirstName() . ' ' . $orow->getCustomer()->getLastName(); $row['customer_name'] = $orow->getCustomer()->getFirstName() . ' ' . $orow->getCustomer()->getLastName();
@ -198,6 +211,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
$row['flag_advance'] = $orow->isAdvanceOrder(); $row['flag_advance'] = $orow->isAdvanceOrder();
$row['plate_number'] = $orow->getCustomerVehicle()->getPlateNumber(); $row['plate_number'] = $orow->getCustomerVehicle()->getPlateNumber();
$row['is_mobile'] = $orow->getSource() == TransactionOrigin::MOBILE_APP; $row['is_mobile'] = $orow->getSource() == TransactionOrigin::MOBILE_APP;
$row['is_vip'] = $is_vip;
$row['is_emergency'] = $is_emergency;
$processor = $orow->getProcessedBy(); $processor = $orow->getProcessedBy();
if ($processor == null) if ($processor == null)

View file

@ -67,13 +67,25 @@
}, },
rows: { rows: {
beforeTemplate: function (row, data, index) { beforeTemplate: function (row, data, index) {
if (data.flag_advance) { // TODO: create function getRowColor that will return
// what class to display
if (data.is_vip) {
console.log('is vip');
$(row).addClass('m-table__row--is_vip');
}
if ($(row).hasClass('m-table__row--is_vip') == false) {
if (data.flag_advance) {
$(row).addClass('m-table__row--danger'); $(row).addClass('m-table__row--danger');
} }
if (data.is_mobile) { if (data.is_mobile) {
$(row).addClass('m-table__row--is_mobile'); $(row).addClass('m-table__row--is_mobile');
} }
if (data.is_emergency) {
console.log('is emergency');
$(row).addClass('m-table__row--is_emergency');
}
}
} }
}, },
columns: [ columns: [