Merge branch '355-cmb-display-amount-when-loading-existing-service-charges' into '270-final-cmb-fixes'
Resolve "CMB - display amount when loading existing service charges" See merge request jankstudio/resq!396
This commit is contained in:
commit
506908d266
5 changed files with 41 additions and 19 deletions
22
.env.dist
22
.env.dist
|
|
@ -15,7 +15,7 @@ APP_SECRET=b344cd6cd151ae1d61403ed55806c5ce
|
|||
# Configure your db driver and server_version in config/packages/doctrine.yaml
|
||||
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
|
||||
###< doctrine/doctrine-bundle ###
|
||||
GMAPS_API_KEY=insertgmapsapikeyhere
|
||||
GMAPS_API_KEY=insert_gmapsapikey_here
|
||||
|
||||
# rising tide sms gateway
|
||||
RT_USER=rt_user
|
||||
|
|
@ -28,7 +28,7 @@ RT_SHORTCODE=1234
|
|||
MQTT_IP_ADDRESS=localhost
|
||||
MQTT_PORT=8883
|
||||
MQTT_CERT=/location/of/cert/file.crt
|
||||
MQTT_WS_HOST=insertiphere
|
||||
MQTT_WS_HOST=insert_ip_here
|
||||
MQTT_WS_PORT=8083
|
||||
|
||||
# redis client
|
||||
|
|
@ -38,20 +38,22 @@ REDIS_CLIENT_PORT=6379
|
|||
REDIS_CLIENT_PASSWORD=foobared
|
||||
|
||||
# privacy policy ids
|
||||
POLICY_PROMO=insertpromopolicyidhere
|
||||
POLICY_THIRD_PARTY=insertthirdpartypolicyidhere
|
||||
POLICY_MOBILE=insertmobilepolicyidhere
|
||||
POLICY_PROMO=insert_promopolicyid_here
|
||||
POLICY_THIRD_PARTY=insert_thirdpartypolicyid_here
|
||||
POLICY_MOBILE=insert_mobilepolicyid_here
|
||||
|
||||
# OTP
|
||||
OTP_MODE=settotestorrandom
|
||||
OTP_MODE=set_to_test_or_random
|
||||
|
||||
# geofence
|
||||
GEOFENCE_ENABLE=settotrueorfalse
|
||||
GEOFENCE_ENABLE=set_to_true_or_false
|
||||
|
||||
# unknown manufacturer and vehicle ids
|
||||
CVU_MFG_ID=insertmfgidforunknownvehicles
|
||||
CVU_BRAND_ID=insertbrandidforunknownvehicles
|
||||
CVU_MFG_ID=insert_mfgid_for_unknown_vehicles
|
||||
CVU_BRAND_ID=insert_brandid_for_unknown_vehicles
|
||||
|
||||
# country code prefix
|
||||
COUNTRY_CODE=+insertcountrycodehere
|
||||
COUNTRY_CODE=+insert_country_code_here
|
||||
|
||||
# dashboard
|
||||
DASHBOARD_ENABLE=set_to_true_or_false
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@ twig:
|
|||
gmaps_api_key: "%env(GMAPS_API_KEY)%"
|
||||
mqtt_host: "%env(MQTT_WS_HOST)%"
|
||||
mqtt_port: "%env(MQTT_WS_PORT)%"
|
||||
dashboard_enable: "%env(DASHBOARD_ENABLE)%"
|
||||
|
|
|
|||
|
|
@ -1407,7 +1407,22 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['mode'] = 'onestep-edit';
|
||||
$params['cvid'] = $obj->getCustomerVehicle()->getID();
|
||||
$params['vid'] = $obj->getCustomerVehicle()->getVehicle()->getID();
|
||||
$params['jo_service_charges'] = $obj->getMeta('service_charges');
|
||||
|
||||
// get service charges
|
||||
$sc_array = [];
|
||||
$jo_service_charges = $obj->getMeta('service_charges');
|
||||
if (!(empty($jo_service_charges)))
|
||||
{
|
||||
foreach ($jo_service_charges as $jo_sc_id)
|
||||
{
|
||||
// find service charge
|
||||
$sc_obj = $em->getRepository(ServiceCharge::class)->find($jo_sc_id);
|
||||
|
||||
$sc_array[] = $sc_obj;
|
||||
}
|
||||
}
|
||||
|
||||
$params['jo_service_charges'] = $sc_array;
|
||||
|
||||
$this->fillDropdownParameters($params);
|
||||
$this->fillFormTags($params);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@
|
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script>
|
||||
<script src="{{ asset('assets/js/dashboard_map.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/map_mqtt.js') }}"></script>
|
||||
{{ include('map/' ~ map_js_file) }}
|
||||
{% if dashboard_enable == 'true' %}
|
||||
{{ include('map/' ~ map_js_file) }}
|
||||
{% endif %}
|
||||
<script>
|
||||
|
||||
function initMap(r_markers, c_markers, icons) {
|
||||
|
|
@ -58,6 +60,7 @@ function initEventHandler(dashmap) {
|
|||
event_handler.connect('{{ app.user.getID }}', '{{ mqtt_host }}', {{ mqtt_port }});
|
||||
}
|
||||
|
||||
{% if dashboard_enable == 'true' %}
|
||||
// create icons
|
||||
var icons = {
|
||||
'rider_active_jo': L.divIcon({
|
||||
|
|
@ -80,11 +83,12 @@ var icons = {
|
|||
})
|
||||
};
|
||||
|
||||
var r_markers = {};
|
||||
var c_markers = {};
|
||||
var r_markers = {};
|
||||
var c_markers = {};
|
||||
|
||||
var dashmap = initMap(r_markers, c_markers, icons);
|
||||
initEventHandler(dashmap, icons);
|
||||
var dashmap = initMap(r_markers, c_markers, icons);
|
||||
initEventHandler(dashmap, icons);
|
||||
{% endif %}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -508,19 +508,19 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<!-- loop through existing service charges for job order -->
|
||||
{% for jo_sc_key, jo_sc in obj.getMeta('service_charges')|default([]) %}
|
||||
{% for jo_sc in jo_service_charges %}
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-12 form-group-inner">
|
||||
<select class="form-control m-input sc-select" name="service_charges">
|
||||
{% for key, sc in service_charges %}
|
||||
<option value="{{ sc.getID }}" data-amount="{{ sc.getAmount }}"{{ jo_sc.id == sc.getID ? ' selected' }}>{{ sc.getName }}</option>
|
||||
<option value="{{ sc.getID }}" data-amount="{{ sc.getAmount }}"{{ jo_sc.getID == sc.getID ? ' selected' }}>{{ sc.getName }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<input class="form-control sc-amount" type="text" value="0" disabled>
|
||||
<input class="form-control sc-amount" type="text" value="{{ jo_sc.getAmount }}" disabled>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<button class="btn btn-danger btn-sc-remove">X</button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue