fleetmap-reports 2.0.94 → 2.0.95
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/tests/kms.test.js +1 -1
- package/src/util/traccar.js +3 -5
package/package.json
CHANGED
package/src/tests/kms.test.js
CHANGED
|
@@ -70,6 +70,6 @@ describe('Kms_Reports', function () {
|
|
|
70
70
|
const data = await reports.kmsReport(convertFromLocal(new Date(2024, 2, 18, 0, 0, 0), userData.user.attributes.timezone), convertFromLocal(new Date(2024, 2, 18, 23, 59, 59), userData.user.attributes.timezone),
|
|
71
71
|
userData)
|
|
72
72
|
const device = data[0].devices.find(d => d.device.id === 93497)
|
|
73
|
-
assert.equal(device, 1)
|
|
73
|
+
assert.equal(device.days.length, 1)
|
|
74
74
|
}, 3000000)
|
|
75
75
|
})
|
package/src/util/traccar.js
CHANGED
|
@@ -58,12 +58,12 @@ async function getSummary (traccar, from, to, devices) {
|
|
|
58
58
|
const arrayOfArrays = automaticReports.sliceArray(devicesToSlice, 50)
|
|
59
59
|
let requests = []
|
|
60
60
|
for (const a of arrayOfArrays) {
|
|
61
|
-
const promise = traccar
|
|
61
|
+
const promise = getAllInOne(traccar, from, to, a, false, false, false, true, 0, a.length, a.length, a.length, undefined, true)
|
|
62
62
|
requests = requests.concat(promise)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const result = await Promise.all(requests)
|
|
66
|
-
return result.map(r => r.
|
|
66
|
+
return result.map(r => r.summary).flat()
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
async function getAllInOne (
|
|
@@ -148,9 +148,7 @@ async function getSummaryByDay (dates, userData, traccarInstance, allDevices, ig
|
|
|
148
148
|
const startDate = isClientSide() ? startDateLocal : convertFromLocal(startDateLocal, userData.user.attributes.timezone)
|
|
149
149
|
const endDate = isClientSide() ? endDateLocal : convertFromLocal(endDateLocal, userData.user.attributes.timezone)
|
|
150
150
|
|
|
151
|
-
const
|
|
152
|
-
summary
|
|
153
|
-
} = await getAllInOne(traccarInstance, startDate, endDate, allDevices, false, false, false, true, 0, allDevices.length, allDevices.length, allDevices.length, undefined, true)
|
|
151
|
+
const summary = await getSummary(traccarInstance, startDate, endDate, allDevices)
|
|
154
152
|
|
|
155
153
|
counter = counter + 1
|
|
156
154
|
if (!ignorePercentage) {
|