fleetmap-reports 1.0.829 → 1.0.837
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
package/src/activity-report.js
CHANGED
|
@@ -213,7 +213,7 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
213
213
|
summaryCurrentDay.endTime = tripsByDay.length && tripsByDay[tripsByDay.length - 1].endTime
|
|
214
214
|
summaryCurrentDay.endAddress = tripsByDay.length && tripsByDay[tripsByDay.length - 1].endAddress
|
|
215
215
|
summaryCurrentDay.startOdometer = tripsByDay.length ? tripsByDay[0].startOdometer : 0
|
|
216
|
-
summaryCurrentDay.endOdometer = tripsByDay.length ? tripsByDay[
|
|
216
|
+
summaryCurrentDay.endOdometer = tripsByDay.length ? tripsByDay[tripsByDay.length - 1].endOdometer : 0
|
|
217
217
|
summary.push(summaryCurrentDay)
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const automaticReports = require('../automaticReports')
|
|
2
|
+
const traccarHelper = require('../util/traccar')
|
|
3
|
+
|
|
4
|
+
async function createGPSJumpReport (from, to, userData, traccar) {
|
|
5
|
+
const reportData = []
|
|
6
|
+
|
|
7
|
+
const devices = userData.devices
|
|
8
|
+
|
|
9
|
+
const sliced = automaticReports.sliceArray(devices, 5)
|
|
10
|
+
let deviceCount = 0
|
|
11
|
+
for (const slice of sliced) {
|
|
12
|
+
slice.forEach(d => {
|
|
13
|
+
const deviceData = {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
deviceData.device = d.name
|
|
17
|
+
reportData.push(deviceData)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
deviceCount = deviceCount + slice.length
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return reportData
|
|
24
|
+
}
|