fleetmap-reports 1.0.607 → 1.0.609
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.
|
|
3
|
+
"version": "1.0.609",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@turf/distance": "^6.5.0",
|
|
15
15
|
"@turf/helpers": "^6.5.0",
|
|
16
16
|
"@turf/point-to-line-distance": "^6.5.0",
|
|
17
|
-
"axios": "^0.
|
|
17
|
+
"axios": "^0.22.0",
|
|
18
18
|
"axios-cookiejar-support": "^1.0.1",
|
|
19
19
|
"docx": "^7.3.0",
|
|
20
20
|
"file-saver": "^2.0.5",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"json-as-xlsx": "^1.2.1",
|
|
23
23
|
"jspdf": "^2.3.1",
|
|
24
24
|
"jspdf-autotable": "^3.5.14",
|
|
25
|
-
"moment": "^2.29.
|
|
25
|
+
"moment": "^2.29.4",
|
|
26
26
|
"tough-cookie": "^4.0.0",
|
|
27
27
|
"traccar-api": "^1.0.5",
|
|
28
28
|
"wkt": "^0.1.1"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"eslint-plugin-import": "^2.26.0",
|
|
35
35
|
"eslint-plugin-node": "^11.1.0",
|
|
36
36
|
"eslint-plugin-promise": "^6.0.0",
|
|
37
|
-
"jest": "^
|
|
38
|
-
"mocha": "^
|
|
37
|
+
"jest": "^29.4.3",
|
|
38
|
+
"mocha": "^10.2.0",
|
|
39
39
|
"webpack": "^5.24.3",
|
|
40
40
|
"webpack-cli": "^4.5.0"
|
|
41
41
|
}
|
package/src/speeding-report.js
CHANGED
|
@@ -135,7 +135,7 @@ async function getEvents (traccarInstance, from, to, devices, userData, deviceCo
|
|
|
135
135
|
|
|
136
136
|
const events = []
|
|
137
137
|
if (userData.roadSpeedLimits) {
|
|
138
|
-
const hereResults = await getHereEvents(devices, routes, userData.maxSpeedThreshold, userData.
|
|
138
|
+
const hereResults = await getHereEvents(devices, routes, userData.maxSpeedThreshold, userData.minimumIdleTime)
|
|
139
139
|
console.log('got', hereResults.length, 'from here')
|
|
140
140
|
events.push(...hereResults)
|
|
141
141
|
} else if (!userData.useVehicleSpeedLimit && userData.customSpeed) {
|
|
@@ -23,7 +23,7 @@ describe('speeding tests', function () {
|
|
|
23
23
|
assert.equal(device.alerts.length, 104) // Total Alerts
|
|
24
24
|
console.log(device.alerts)
|
|
25
25
|
|
|
26
|
-
userData.
|
|
26
|
+
userData.minimumIdleTime = 1
|
|
27
27
|
const r = await getSpeedingReport(report, userData)
|
|
28
28
|
r.device.alerts.forEach(a => assert.equal(true, a.eventTime >= 60000))
|
|
29
29
|
assert.equal(r.device.alerts.length, 6) // Total Alerts
|
package/src/trip-report.js
CHANGED
|
@@ -292,7 +292,9 @@ async function exportTripReportToPDF (userData, reportData) {
|
|
|
292
292
|
|
|
293
293
|
tripsData.forEach(function (d, index) {
|
|
294
294
|
const data = []
|
|
295
|
-
const name = userData.byDriver
|
|
295
|
+
const name = userData.byDriver
|
|
296
|
+
? d.driver.name + ' ' + ((d.driver.attributes && d.driver.attributes.notes) || '')
|
|
297
|
+
: deviceName(d.device)
|
|
296
298
|
const group = userData.byDriver ? userData.groups.find(g => g.drivers && g.drivers.includes(d.id)) : userData.groups.find(g => d.device.groupId === g.id)
|
|
297
299
|
|
|
298
300
|
const space = index === 0 ? 8 : 0
|