fleetmap-reports 1.0.766 → 1.0.767

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.766",
3
+ "version": "1.0.767",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -74,6 +74,9 @@ async function createPerformanceReport (from, to, userData, traccar) {
74
74
  const hardBreakingData = getRowData(7, device, 'Freinage brusque', hardBreaking, '', '', drivingDistance > 0 ? hardBreaking * 100 / drivingDistance : 0)
75
75
  const hardAccelerationData = getRowData(8, device, 'Accéleration brusque', hardAcceleration, '', '', drivingDistance > 0 ? hardAcceleration * 100 / drivingDistance : 0)
76
76
 
77
+ drivingData.used = (totalTime > 0 ? drivingTime * 100 / totalTime : 0).toFixed(0)
78
+ idleData.used = (totalTime > 0 ? idleTime * 100 / totalTime : 0).toFixed(0)
79
+
77
80
  reportData.push(totalData)
78
81
  reportData.push(drivingData)
79
82
  reportData.push(idleData)
@@ -100,15 +103,15 @@ function getDeviceXpertData (allInOne, d) {
100
103
  return { endTripData, canDriverStyle }
101
104
  }
102
105
 
103
- function getRowData (index, device, description, time, consumption, economicDistance, totalTime) {
106
+ function getRowData (index, device, description, time, consumption, distance, indicator) {
104
107
  return {
105
108
  index,
106
109
  device: device.name,
107
110
  description,
108
111
  time,
109
112
  consumption,
110
- distance: economicDistance,
111
- indicator: totalTime > 0 ? time * 100 / totalTime : 0
113
+ distance,
114
+ indicator
112
115
  }
113
116
  }
114
117