fleetmap-reports 1.0.383 → 1.0.384
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/activity-report.js +7 -10
- package/src/events-report.js +5 -7
- package/src/fuelconsumption-report.js +4 -3
- package/src/fueldrop-report.js +17 -10
- package/src/idle-report.js +5 -5
- package/src/kms-report.js +5 -6
- package/src/location-report.js +5 -7
- package/src/refueling-report.js +5 -5
- package/src/speeding-report.js +2 -4
- package/src/trip-report.js +3 -7
- package/src/util/device.js +10 -0
- package/src/zone-report.js +5 -6
package/package.json
CHANGED
package/src/activity-report.js
CHANGED
|
@@ -9,6 +9,7 @@ const {getUserPartner} = require("fleetmap-partners")
|
|
|
9
9
|
const traccar = require("./util/traccar")
|
|
10
10
|
const {isInsideTimetable, isPartialInsideTimetable, calculateTrip} = require("./util/trips");
|
|
11
11
|
const tripHelper = require("./util/trips");
|
|
12
|
+
const {devicesToProcess} = require("./util/device");
|
|
12
13
|
|
|
13
14
|
const fileName = 'ActivityReport'
|
|
14
15
|
|
|
@@ -71,27 +72,23 @@ async function createActivityReportByGroup(from, to, userData, traccarInstance){
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
async function createActivityReportByDevice(from, to, userData, traccarInstance){
|
|
74
|
-
const
|
|
75
|
-
const devicesToProcess = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
75
|
+
const devices = devicesToProcess(userData)
|
|
76
76
|
|
|
77
77
|
const allData = {
|
|
78
78
|
devices: [],
|
|
79
|
-
xpert:
|
|
79
|
+
xpert: devices.filter(d => d.attributes.xpert).length > 0,
|
|
80
80
|
from: from,
|
|
81
81
|
to: to
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
//Get report data from traccar
|
|
85
|
-
devicesToProcess.sort((a, b) => (a.name > b.name) ? 1 : -1)
|
|
86
|
-
|
|
87
84
|
let summaries = []
|
|
88
|
-
const {trips, route, summary} = await traccar.getAllInOne(traccarInstance, from, to,
|
|
85
|
+
const {trips, route, summary} = await traccar.getAllInOne(traccarInstance, from, to, devices, true, true, false, !userData.groupByDay)
|
|
89
86
|
|
|
90
87
|
if(userData.groupByDay) {
|
|
91
88
|
console.log('trips:' + trips.length)
|
|
92
89
|
|
|
93
90
|
if (trips.length) {
|
|
94
|
-
tripHelper.checkTripsKms(traccarInstance, from, to,
|
|
91
|
+
tripHelper.checkTripsKms(traccarInstance, from, to, devices, {trips, route})
|
|
95
92
|
}
|
|
96
93
|
|
|
97
94
|
const dates = getDates(from, to)
|
|
@@ -100,7 +97,7 @@ async function createActivityReportByDevice(from, to, userData, traccarInstance)
|
|
|
100
97
|
const fromByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0)
|
|
101
98
|
const toByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59)
|
|
102
99
|
|
|
103
|
-
const summary = await traccar.getSummary(traccarInstance, fromByDay, toByDay,
|
|
100
|
+
const summary = await traccar.getSummary(traccarInstance, fromByDay, toByDay, devices)
|
|
104
101
|
summary.forEach(s => s.date = date)
|
|
105
102
|
summaries = summaries.concat(summary)
|
|
106
103
|
}
|
|
@@ -113,7 +110,7 @@ async function createActivityReportByDevice(from, to, userData, traccarInstance)
|
|
|
113
110
|
|
|
114
111
|
//Process report data
|
|
115
112
|
if (summaries.length || trips.length) {
|
|
116
|
-
allData.devices = processDevices(from, to,
|
|
113
|
+
allData.devices = processDevices(from, to, devices, {summaries: summaries, trips, route}, userData)
|
|
117
114
|
}
|
|
118
115
|
|
|
119
116
|
return allData
|
package/src/events-report.js
CHANGED
|
@@ -5,6 +5,7 @@ const {getStyle} = require("./reportStyle");
|
|
|
5
5
|
const {headerFromUser} = require("./util/pdfDocument");
|
|
6
6
|
const {getUserPartner} = require("fleetmap-partners");
|
|
7
7
|
const {convertToLocaleString, getTranslations} = require("./util/utils");
|
|
8
|
+
const {devicesToProcess} = require("./util/device");
|
|
8
9
|
|
|
9
10
|
const fileName = 'EventReport'
|
|
10
11
|
|
|
@@ -36,17 +37,14 @@ async function createEventsReport(from, to, userData, traccar) {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
const
|
|
40
|
-
const withoutGroupDevices = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
40
|
+
const devices = devicesToProcess(userData)
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const data = await getReportData(from, to, withoutGroupDevices, userData.eventTypes, traccar)
|
|
42
|
+
const data = await getReportData(from, to, devices, userData.eventTypes, traccar)
|
|
45
43
|
|
|
46
44
|
if(data.length > 0) {
|
|
47
45
|
reportData.push({
|
|
48
|
-
devices: await processDevices(from, to,
|
|
49
|
-
xpert:
|
|
46
|
+
devices: await processDevices(from, to, devices, userData.geofences, userData.drivers, data, traccar),
|
|
47
|
+
xpert: devices.filter(d => d.attributes.xpert).length > 0
|
|
50
48
|
})
|
|
51
49
|
}
|
|
52
50
|
|
|
@@ -2,6 +2,7 @@ const automaticReports = require("./automaticReports")
|
|
|
2
2
|
const refuelingReport = require("./refueling-report")
|
|
3
3
|
const traccarHelper = require("./util/traccar")
|
|
4
4
|
const odoo = require("./util/odoo")
|
|
5
|
+
const {devicesToProcess} = require("./util/device");
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -16,9 +17,9 @@ async function createFuelConsumptionReport(from, to, userData, traccar) {
|
|
|
16
17
|
to: to
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const devices = devicesToProcess(userData)
|
|
20
21
|
|
|
21
|
-
const allInOne = await traccarHelper.getAllInOne(traccar, from, to,
|
|
22
|
+
const allInOne = await traccarHelper.getAllInOne(traccar, from, to, devices, true, true, false, false)
|
|
22
23
|
const tripsData = allInOne.trips
|
|
23
24
|
const routeData = allInOne.route
|
|
24
25
|
|
|
@@ -33,7 +34,7 @@ async function createFuelConsumptionReport(from, to, userData, traccar) {
|
|
|
33
34
|
|
|
34
35
|
allData.totalDevices = 0
|
|
35
36
|
|
|
36
|
-
for (const d of
|
|
37
|
+
for (const d of devices) {
|
|
37
38
|
const trips = tripsData.filter(t => t.deviceId===d.id)
|
|
38
39
|
const route = routeData.filter(r => r.deviceId===d.id)
|
|
39
40
|
const deviceFuelServices = fuelServicesData.filter(f => d.attributes.odooId === f.vehicle_id[0])
|
package/src/fueldrop-report.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const automaticReports = require("./automaticReports");
|
|
2
|
+
const {devicesToProcess} = require("./util/device");
|
|
2
3
|
|
|
3
4
|
function calculateFuelDrop(position, positions) {
|
|
4
5
|
const index = positions.indexOf(position)
|
|
@@ -28,9 +29,9 @@ async function createFuelDropReport(from, to, userData, traccar) {
|
|
|
28
29
|
to: to
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
const devices = devicesToProcess(userData)
|
|
32
33
|
|
|
33
|
-
const arrayOfArrays = automaticReports.sliceArray(
|
|
34
|
+
const arrayOfArrays = automaticReports.sliceArray(devices)
|
|
34
35
|
let data = []
|
|
35
36
|
const types = ['deviceFuelDrop']
|
|
36
37
|
|
|
@@ -48,7 +49,7 @@ async function createFuelDropReport(from, to, userData, traccar) {
|
|
|
48
49
|
allData.totalFuelDrops = 0
|
|
49
50
|
allData.totalFuelDropLiters = 0
|
|
50
51
|
|
|
51
|
-
for (const d of
|
|
52
|
+
for (const d of devices) {
|
|
52
53
|
const alerts = data.filter(t => t.deviceId===d.id)
|
|
53
54
|
|
|
54
55
|
if(alerts.length > 0) {
|
|
@@ -67,13 +68,19 @@ async function createFuelDropReport(from, to, userData, traccar) {
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
//Filter wrong fuel drop values
|
|
72
|
+
const filteredAlerts = alerts.filter(a => a.fuelDropLiters < d.attributes.fuel_tank_capacity && a.fuelDropLiters > 0)
|
|
73
|
+
|
|
74
|
+
if(filteredAlerts.length > 0) {
|
|
75
|
+
allData.devices.push({
|
|
76
|
+
device: d,
|
|
77
|
+
alerts: filteredAlerts
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
allData.totalDevices = allData.totalDevices + 1
|
|
81
|
+
allData.totalFuelDrops = allData.totalFuelDrops + filteredAlerts.length
|
|
82
|
+
allData.totalFuelDropLiters = allData.totalFuelDropLiters + filteredAlerts.reduce((a, b) => a + b.fuelDropLiters, 0)
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|
package/src/idle-report.js
CHANGED
|
@@ -4,6 +4,7 @@ const {headerFromUser, AmiriRegular} = require("./util/pdfDocument");
|
|
|
4
4
|
const {convertToLocaleString, convertMS, getTranslations} = require("./util/utils");
|
|
5
5
|
const {getStyle} = require("./reportStyle");
|
|
6
6
|
const {getUserPartner} = require("fleetmap-partners");
|
|
7
|
+
const {devicesToProcess} = require("./util/device");
|
|
7
8
|
|
|
8
9
|
const fileName = 'IdleReport'
|
|
9
10
|
|
|
@@ -17,7 +18,7 @@ async function createIdleReport(from, to, userData, traccarInstance) {
|
|
|
17
18
|
reportData.push(...allData)
|
|
18
19
|
} else {
|
|
19
20
|
console.log("ByDevice")
|
|
20
|
-
const report = await createTripReportByDevice(from, to, userData
|
|
21
|
+
const report = await createTripReportByDevice(from, to, userData, traccarInstance)
|
|
21
22
|
reportData.push(report)
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -60,17 +61,16 @@ async function createTripReportByGroup(from, to, userData, traccarInstance) {
|
|
|
60
61
|
return reportData
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
async function createTripReportByDevice(from, to,
|
|
64
|
+
async function createTripReportByDevice(from, to, userData, traccarInstance) {
|
|
64
65
|
const allData = {
|
|
65
66
|
devices: [],
|
|
66
67
|
from: from,
|
|
67
68
|
to: to
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
devices
|
|
71
|
+
const devices = devicesToProcess(userData)
|
|
71
72
|
|
|
72
|
-
const
|
|
73
|
-
const route = await traccar.getRoute(traccarInstance, from, to, devicesToSlice)
|
|
73
|
+
const route = await traccar.getRoute(traccarInstance, from, to, devices)
|
|
74
74
|
|
|
75
75
|
console.log('Route:' + route.length)
|
|
76
76
|
|
package/src/kms-report.js
CHANGED
|
@@ -10,6 +10,7 @@ const trips = require("./util/trips")
|
|
|
10
10
|
const drivers = require("./util/driver")
|
|
11
11
|
const { isInsideTimetable, isPartialInsideTimetable, calculateTrip} = require("./util/trips")
|
|
12
12
|
const traccarHelper = require("./util/traccar");
|
|
13
|
+
const {devicesToProcess} = require("./util/device");
|
|
13
14
|
|
|
14
15
|
const fileName = 'KmsReport'
|
|
15
16
|
|
|
@@ -37,8 +38,7 @@ async function createKmsReport(from, to, userData, traccarInstance) {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
async function createKmsReportByDevice(from, to, userData, traccarInstance) {
|
|
40
|
-
const
|
|
41
|
-
const devicesToProcess = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
41
|
+
const devices = devicesToProcess(userData)
|
|
42
42
|
|
|
43
43
|
const allData = {
|
|
44
44
|
devices: [],
|
|
@@ -46,16 +46,15 @@ async function createKmsReportByDevice(from, to, userData, traccarInstance) {
|
|
|
46
46
|
to: to
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devicesToProcess, true, true, false, false)
|
|
49
|
+
const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devices, true, true, false, false)
|
|
51
50
|
const tripsData = allInOne.trips
|
|
52
51
|
const routeData = allInOne.route
|
|
53
52
|
|
|
54
53
|
console.log('trips:' + tripsData.length)
|
|
55
54
|
|
|
56
55
|
if (tripsData.length > 0) {
|
|
57
|
-
trips.checkTripsKms(traccarInstance, from, to,
|
|
58
|
-
allData.devices = processDevices(from, to,
|
|
56
|
+
trips.checkTripsKms(traccarInstance, from, to, devices, {trips: tripsData, route: routeData})
|
|
57
|
+
allData.devices = processDevices(from, to, devices, {trips: tripsData, route: routeData}, userData)
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
return allData
|
package/src/location-report.js
CHANGED
|
@@ -5,6 +5,7 @@ const {getStyle} = require("./reportStyle")
|
|
|
5
5
|
const {getUserPartner} = require("fleetmap-partners");
|
|
6
6
|
const {convertToLocaleString, getTranslations} = require("./util/utils");
|
|
7
7
|
const traccarHelper = require("./util/traccar");
|
|
8
|
+
const {devicesToProcess} = require("./util/device");
|
|
8
9
|
|
|
9
10
|
const fileName = 'LocationReport'
|
|
10
11
|
|
|
@@ -79,23 +80,20 @@ async function createLocationReportByGroup(from, to, userData, traccar) {
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
async function createLocationReportByDevice(from, to, userData, traccar) {
|
|
82
|
-
const
|
|
83
|
-
const withoutGroupDevices = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
83
|
+
const devices = devicesToProcess(userData)
|
|
84
84
|
|
|
85
85
|
const allData = {
|
|
86
86
|
devices: [],
|
|
87
|
-
xpert:
|
|
87
|
+
xpert: devices.filter(d => d.attributes.xpert).length > 0
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
const devicesToSlice = withoutGroupDevices.slice()
|
|
92
|
-
const allInOne = await traccarHelper.getAllInOne(traccar, from, to, devicesToSlice, true, false, false, false)
|
|
90
|
+
const allInOne = await traccarHelper.getAllInOne(traccar, from, to, devices, true, false, false, false)
|
|
93
91
|
const routeData = allInOne.route
|
|
94
92
|
|
|
95
93
|
console.log('Locations:'+routeData.length)
|
|
96
94
|
|
|
97
95
|
if(routeData.length > 0) {
|
|
98
|
-
allData.devices = processDevices(from, to,
|
|
96
|
+
allData.devices = processDevices(from, to, devices, userData.drivers, routeData)
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
return allData
|
package/src/refueling-report.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const helpers = require("turf")
|
|
2
2
|
const automaticReports = require("./automaticReports")
|
|
3
|
+
const {devicesToProcess} = require("./util/device");
|
|
3
4
|
|
|
4
5
|
const positionsToCheck = 15
|
|
5
6
|
|
|
@@ -14,12 +15,11 @@ async function createRefuelingReport(from, to, userData, traccar) {
|
|
|
14
15
|
to: to
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
const devices = devicesToProcess(userData).filter(d => automaticReports.deviceWithFuelInfo(d))
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
console.log('Devices:'+devicesToSlice.length)
|
|
20
|
+
console.log('Devices:'+devices.length)
|
|
21
21
|
|
|
22
|
-
const arrayOfArrays = automaticReports.sliceArray(
|
|
22
|
+
const arrayOfArrays = automaticReports.sliceArray(devices)
|
|
23
23
|
let data = []
|
|
24
24
|
for (const a of arrayOfArrays) {
|
|
25
25
|
const response = await traccar.reports.reportsRouteGet(from, to, a.map(d => d.id))
|
|
@@ -36,7 +36,7 @@ async function createRefuelingReport(from, to, userData, traccar) {
|
|
|
36
36
|
allData.totalRefueling = 0
|
|
37
37
|
allData.totalRefuelingLiters = 0
|
|
38
38
|
|
|
39
|
-
for (const d of
|
|
39
|
+
for (const d of devices) {
|
|
40
40
|
const positions = data.filter(t => t.deviceId===d.id)
|
|
41
41
|
|
|
42
42
|
if(positions.length > 0) {
|
package/src/speeding-report.js
CHANGED
|
@@ -11,6 +11,7 @@ const {distance, point} = require('turf')
|
|
|
11
11
|
const here = require('./here')
|
|
12
12
|
const {getUserPartner} = require("fleetmap-partners");
|
|
13
13
|
const traccarHelper = require("./util/traccar");
|
|
14
|
+
const {devicesToProcess} = require("./util/device");
|
|
14
15
|
|
|
15
16
|
const fileName = 'SpeedingReport'
|
|
16
17
|
const eventTypes = ['deviceOverspeed']
|
|
@@ -67,10 +68,7 @@ async function createSpeedingReportByGroup(from, to, userData, traccarInstance){
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
async function createSpeedingReportByDevice(from, to, userData, traccarInstance) {
|
|
70
|
-
const
|
|
71
|
-
const devices = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
72
|
-
|
|
73
|
-
devices.sort((a, b) => (a.name > b.name) ? 1 : -1)
|
|
71
|
+
const devices = devicesToProcess(userData)
|
|
74
72
|
|
|
75
73
|
const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devices, true, false, false, false)
|
|
76
74
|
const routes = allInOne.route
|
package/src/trip-report.js
CHANGED
|
@@ -8,6 +8,7 @@ const {getStyle} = require("./reportStyle")
|
|
|
8
8
|
const traccarHelper = require("./util/traccar")
|
|
9
9
|
const trips = require("./util/trips");
|
|
10
10
|
const {isInsideTimetable, addNearestPOIs, isPartialInsideTimetable, calculateTrip} = require("./util/trips")
|
|
11
|
+
const {devicesToProcess} = require("./util/device");
|
|
11
12
|
|
|
12
13
|
const fileName = 'TripReport'
|
|
13
14
|
|
|
@@ -34,20 +35,15 @@ async function createTripReport(from, to, userData, traccar) {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
async function createTripReportByDevice(from, to, userData, traccar) {
|
|
37
|
-
const
|
|
38
|
-
const devices = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
38
|
+
const devices = devicesToProcess(userData)
|
|
39
39
|
|
|
40
40
|
const allData = {
|
|
41
41
|
devices: [],
|
|
42
42
|
xpert: devices.filter(d => d.attributes.xpert).length > 0
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const sliced = automaticReports.sliceArray(devices, 5)
|
|
46
46
|
|
|
47
|
-
const devicesToSlice = devices.slice()
|
|
48
|
-
const sliced = automaticReports.sliceArray(devicesToSlice, 5)
|
|
49
|
-
|
|
50
|
-
console.log('LOADING_MESSAGE:' + devices.map(d => d.name).join(', '))
|
|
51
47
|
let deviceCount = 0
|
|
52
48
|
for(const slice of sliced) {
|
|
53
49
|
const allInOne = await traccarHelper.getAllInOne(traccar, from, to, slice, true, true, true, false)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function devicesToProcess(userData) {
|
|
2
|
+
const groupIds = userData.groups.map(g => g.id)
|
|
3
|
+
const devices = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
4
|
+
devices.sort((a, b) => (a.name > b.name) ? 1 : -1)
|
|
5
|
+
|
|
6
|
+
console.log('LOADING_MESSAGE:' + devices.map(d => d.name).join(', '))
|
|
7
|
+
return devices
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
exports.devicesToProcess = devicesToProcess
|
package/src/zone-report.js
CHANGED
|
@@ -6,6 +6,7 @@ require('jspdf-autotable')
|
|
|
6
6
|
const {headerFromUser} = require("./util/pdfDocument");
|
|
7
7
|
const {getStyle} = require("./reportStyle")
|
|
8
8
|
const {getUserPartner} = require("fleetmap-partners");
|
|
9
|
+
const {devicesToProcess} = require("./util/device");
|
|
9
10
|
|
|
10
11
|
const fileName = 'ZoneReport'
|
|
11
12
|
|
|
@@ -42,17 +43,15 @@ async function createZoneReport(from, to, userData, traccar) {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
const
|
|
46
|
-
const withoutGroupDevices = userData.byGroup ? userData.devices.filter(d => !groupIds.includes(d.groupId)) : userData.devices
|
|
46
|
+
const devices = devicesToProcess(userData)
|
|
47
47
|
|
|
48
48
|
const allData = {
|
|
49
49
|
devices: [],
|
|
50
|
-
xpert:
|
|
50
|
+
xpert: devices.filter(d => d.attributes.xpert).length > 0
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
withoutGroupDevices.sort((a, b) => (a.name > b.name) ? 1 : -1)
|
|
54
53
|
|
|
55
|
-
const arrayOfArrays = automaticReports.sliceArray(
|
|
54
|
+
const arrayOfArrays = automaticReports.sliceArray(devices)
|
|
56
55
|
let data = []
|
|
57
56
|
for (const a of arrayOfArrays) {
|
|
58
57
|
const response = await traccar.reports.reportsEventsGet(from, to, a.map(d => d.id), null, types)
|
|
@@ -65,7 +64,7 @@ async function createZoneReport(from, to, userData, traccar) {
|
|
|
65
64
|
return reportData
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
allData.devices = await processDevices(from, to,
|
|
67
|
+
allData.devices = await processDevices(from, to, devices, userData.drivers, userData.geofences, data, traccar)
|
|
69
68
|
|
|
70
69
|
reportData.push(allData)
|
|
71
70
|
|