fleetmap-reports 2.0.7 → 2.0.11
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/generated.pdf +2 -2
- package/package.json +4 -4
- package/src/activity-report.js +2 -3
package/generated.pdf
CHANGED
|
@@ -463866,7 +463866,7 @@ endobj
|
|
|
463866
463866
|
457 0 obj
|
|
463867
463867
|
<<
|
|
463868
463868
|
/Producer (jsPDF 2.5.1)
|
|
463869
|
-
/CreationDate (D:
|
|
463869
|
+
/CreationDate (D:20240211165159-00'00')
|
|
463870
463870
|
>>
|
|
463871
463871
|
endobj
|
|
463872
463872
|
458 0 obj
|
|
@@ -464343,7 +464343,7 @@ trailer
|
|
|
464343
464343
|
/Size 459
|
|
464344
464344
|
/Root 458 0 R
|
|
464345
464345
|
/Info 457 0 R
|
|
464346
|
-
/ID [ <
|
|
464346
|
+
/ID [ <466CD9D84B2021B5BB04FD88695C0965> <466CD9D84B2021B5BB04FD88695C0965> ]
|
|
464347
464347
|
>>
|
|
464348
464348
|
startxref
|
|
464349
464349
|
12515006
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleetmap-reports",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,15 +14,15 @@
|
|
|
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": "
|
|
17
|
+
"axios": "1.6.6",
|
|
18
18
|
"country-reverse-geocoding": "^0.2.2",
|
|
19
19
|
"docx": "^7.3.0",
|
|
20
20
|
"file-saver": "^2.0.5",
|
|
21
21
|
"fleetmap-partners": "^1.0.160",
|
|
22
22
|
"json-as-xlsx": "2.5.6",
|
|
23
23
|
"jspdf": "^2.5.1",
|
|
24
|
-
"jspdf-autotable": "3.
|
|
25
|
-
"moment": "
|
|
24
|
+
"jspdf-autotable": "3.8.1",
|
|
25
|
+
"moment": "2.30.1",
|
|
26
26
|
"traccar-api": "^1.0.5",
|
|
27
27
|
"wkt": "^0.1.1"
|
|
28
28
|
},
|
package/src/activity-report.js
CHANGED
|
@@ -16,7 +16,6 @@ const { isInsideTimetable, isPartialInsideTimetable, calculateTrip, getDataByDay
|
|
|
16
16
|
const { devicesToProcess } = require('./util/device')
|
|
17
17
|
const { getDriverData } = require('./util/driver')
|
|
18
18
|
const { calculateConsumption } = require('./util/fuel')
|
|
19
|
-
const axios = require('axios')
|
|
20
19
|
const { getSummaryByDay } = require('./util/traccar')
|
|
21
20
|
|
|
22
21
|
const fileName = 'ActivityReport'
|
|
@@ -76,7 +75,7 @@ async function createActivityReportByGroup (from, to, userData, traccarInstance)
|
|
|
76
75
|
return reportData
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
async function executeServerSide (allData, sliced, from, to, userData, totalDevices) {
|
|
78
|
+
async function executeServerSide (allData, sliced, from, to, userData, totalDevices, axios) {
|
|
80
79
|
let deviceCount = 0
|
|
81
80
|
for (const devices of sliced) {
|
|
82
81
|
const url = `https://${process.env.SERVER_HOST}/reports/activity-report`
|
|
@@ -100,7 +99,7 @@ async function createActivityReportByDevice (from, to, userData, traccarInstance
|
|
|
100
99
|
|
|
101
100
|
if (isClientSide() && allDevices.length > 20) {
|
|
102
101
|
const sliced = automaticReports.sliceArray(allDevices, 10)
|
|
103
|
-
await executeServerSide(allData, sliced, from, to, userData, allDevices.length)
|
|
102
|
+
await executeServerSide(allData, sliced, from, to, userData, allDevices.length, traccarInstance)
|
|
104
103
|
} else {
|
|
105
104
|
let summaryByDay = []
|
|
106
105
|
if (userData.allWeek && userData.groupByDay) {
|