fleetmap-reports 2.0.293 → 2.0.295
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 +1 -1
- package/src/trip-report.js +2 -1
- package/src/util/trips.js +1 -0
package/package.json
CHANGED
package/src/trip-report.js
CHANGED
|
@@ -173,6 +173,7 @@ async function processDevices (from, to, devices, data, userData, traccar) {
|
|
|
173
173
|
const stops = data.stops.filter(s => s.deviceId === d.id)
|
|
174
174
|
|
|
175
175
|
trips.forEach(trip => {
|
|
176
|
+
trip.model = d.model
|
|
176
177
|
const stop = getStop(new Date(trip.startTime), stops)
|
|
177
178
|
|
|
178
179
|
trip.totalKms = getTripTotalKms(trip, stop, deviceRoute)
|
|
@@ -554,7 +555,7 @@ function exportTripReportToExcel (userData, reportData) {
|
|
|
554
555
|
maxTemp: a.maxTemp,
|
|
555
556
|
minTemp: a.minTemp,
|
|
556
557
|
avgTemp: a.avgTemp && Number(a.avgTemp.toFixed(1)),
|
|
557
|
-
model:
|
|
558
|
+
model: a.model
|
|
558
559
|
}
|
|
559
560
|
}))
|
|
560
561
|
// Totals
|
package/src/util/trips.js
CHANGED
|
@@ -159,6 +159,7 @@ function calculateTrip (device, route) {
|
|
|
159
159
|
return {
|
|
160
160
|
deviceId: device.id,
|
|
161
161
|
deviceName: device.name,
|
|
162
|
+
model: device.model,
|
|
162
163
|
distance: calculateDistance(route, device.attributes['report.ignoreOdometer']) * 1000,
|
|
163
164
|
averageSpeed: Math.round((route.map(p => p.speed).reduce((a, b) => a + b, 0)) / route.length),
|
|
164
165
|
maxSpeed: route.map(p => p.speed).reduce(function (a, b) { return Math.max(a, b) }),
|