diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 8b270f9..ba319ce 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -248,7 +248,7 @@ class ReportsController extends Controller $list = DB::select("SELECT t.crt_d , t.latitude, t.longitude, t.speed, tgta.fulladdress, - t.pre_milleage, t.vhc_milleage + t.pre_milleage, t.vhc_milleage, fuel_count FROM t_gps_tracks t left join t_gps_tracks_address tgta on tgta.master_id = t.id @@ -280,6 +280,7 @@ class ReportsController extends Controller $duration = "{$hours} hour" . ($hours > 1 ? 's' : '') . " {$minutes} minute" . ($minutes > 1 ? 's' : ''); $distance = $list[count($list) - 1]->vhc_milleage - $list[0]->vhc_milleage; + $fuel_consumed = $list[count($list) - 1]->fuel_count - $list[0]->fuel_count; $data = [ 'nopol1' => $nopol1, @@ -291,6 +292,7 @@ class ReportsController extends Controller 'finish' => $finish, 'duration' => $duration, 'distance' => $distance, + 'fuel_consumed' => $fuel_consumed, ]; // dd($list); return view('menu_v1.reports._trip_detail', $data); diff --git a/app/Models/Tracks.php b/app/Models/Tracks.php index 564f73f..7f5c341 100755 --- a/app/Models/Tracks.php +++ b/app/Models/Tracks.php @@ -324,7 +324,7 @@ class Tracks extends Model tr_addr.state_text AS lst_state_text, tr_addr.city_text AS lst_city_text, tr_addr.district_text AS lst_district_text, tr_addr.village_text AS lst_village_text, tr_addr.postcode AS lst_postcode, tr_addr.streets AS lst_streets, - tr_addr.fulladdress AS lst_fulladdress"; + tr_addr.fulladdress AS lst_fulladdress, tr.fuel_curr"; if (isset($filter["active_rates"])) { $query .= ", diff --git a/resources/views/menu_v1/dashboard.blade.php b/resources/views/menu_v1/dashboard.blade.php index 7fb8004..e0652dc 100755 --- a/resources/views/menu_v1/dashboard.blade.php +++ b/resources/views/menu_v1/dashboard.blade.php @@ -272,6 +272,10 @@

Engine Status

Idling

+
  • +

    Fuel

    +

    0

    +
  • {{--
  • Durasi Berhenti (min)

    @@ -2569,6 +2573,7 @@ $('#infoVehicles-trackSch').text(truck?.track_schedule); $('#infoVehicles-company').text(truck?.client_group_name); $('#infoVehicles-serviceStart').text(moment.unix(truck?.vhc_crt).format('DD MMM YYYY HH:mm:ss')); + $('#infoVehicles-fuel').text((truck?.fuel_curr/10) + " L"); // driver $('#infoDrv-updt').text((truck?.ord_crt) ? moment.unix(truck?.ord_crt).format('DD MMM YYYY HH:mm:ss') : '-'); $('#infoDrv-name').text(truck?.ord_drv_name ?? 'Off Duty'); diff --git a/resources/views/menu_v1/reports/_trip_detail.blade.php b/resources/views/menu_v1/reports/_trip_detail.blade.php index 5cc09b1..cfce1c8 100644 --- a/resources/views/menu_v1/reports/_trip_detail.blade.php +++ b/resources/views/menu_v1/reports/_trip_detail.blade.php @@ -44,27 +44,31 @@

    {{$nopol1}}

    -
    +

    Start

    {{ $start['time'] }}

    Vehicle Mileage: {{number_format($start['mileage'], 2)}} km

    {{$start['fulladdress']}}

    -
    +

    Finish

    {{ $finish['time'] }}

    Vehicle Mileage: {{number_format($finish['mileage'], 2)}} km

    {{$finish['fulladdress']}}

    -
    +

    Distance

    {{number_format($distance, 2)}} km

    -
    +

    Duration

    {{$duration}}

    -
    +
    +

    Fuel consumed

    +

    {{$fuel_consumed/10}} L

    +
    +