fleetmap-reports 2.0.260 → 2.0.261

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": "2.0.260",
3
+ "version": "2.0.261",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -52,9 +52,13 @@ async function createLocationReportByDriver (from, to, userData, traccar) {
52
52
  return { drivers: [] }
53
53
  }
54
54
 
55
- const allInOne = await traccarHelper.getAllInOne(traccar, from, to, devices, true, false, false, false)
55
+ const sliced = automaticReports.sliceArray(devices, 5)
56
56
 
57
- return { drivers: await processDrivers(from, to, userData, allInOne) }
57
+ for (const slice of sliced) {
58
+ const allInOne = await traccarHelper.getAllInOne(traccar, from, to, slice, true, false, false, false)
59
+ await processDrivers(from, to, userData, allInOne)
60
+ }
61
+ return { drivers: driversResult }
58
62
  }
59
63
 
60
64
  async function createLocationReportByGroup (from, to, userData, traccar) {
@@ -160,9 +164,9 @@ function processDevices (from, to, devices, data) {
160
164
 
161
165
  return devicesResult
162
166
  }
167
+ const driversResult = []
163
168
 
164
169
  async function processDrivers (from, to, userData, data) {
165
- const driversResult = []
166
170
  for (const d of userData.drivers) {
167
171
  const { route } = await getDriverData(d, data, userData)
168
172
  if (route.length > 0) {
@@ -185,8 +189,6 @@ async function processDrivers (from, to, userData, data) {
185
189
  }
186
190
  }
187
191
  console.log(driversResult)
188
-
189
- return driversResult
190
192
  }
191
193
 
192
194
  async function exportLocationReportToPDF (userData, reportData) {