fleetmap-reports 2.0.54 → 2.0.55

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.54",
3
+ "version": "2.0.55",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -44,8 +44,8 @@ async function createKmsReportByDevice (from, to, userData, traccarInstance) {
44
44
  }
45
45
 
46
46
  if (isClientSide() && (allDevices.length > 50 || ((new Date(to).getTime() - new Date(from).getTime()) > (1000 * 60 * 60 * 24 * 15))) && userData.groupByDay) {
47
- const sliced = automaticReports.sliceArray(allDevices, 2)
48
- await executeServerSide('kms-report', sliced, from, to, userData, allDevices.length, traccarInstance, 1).then(devices => {
47
+ const sliced = automaticReports.sliceArray(allDevices, 1)
48
+ await executeServerSide('kms-report', sliced, from, to, userData, allDevices.length, traccarInstance).then(devices => {
49
49
  allData.devices = devices
50
50
  })
51
51
  } else {
package/src/util/utils.js CHANGED
@@ -265,6 +265,12 @@ async function executeServerSide (type, sliced, from, to, userData, totalItems,
265
265
  }))
266
266
  }
267
267
 
268
+ if (userData.byDriver) {
269
+ reportData.sort((a, b) => (a.driver.name > b.driver.name) ? 1 : -1)
270
+ } else {
271
+ reportData.sort((a, b) => (a.device.name > b.device.name) ? 1 : -1)
272
+ }
273
+
268
274
  return reportData
269
275
  }
270
276