fleetmap-reports 2.0.29 → 2.0.30

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.29",
3
+ "version": "2.0.30",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -104,14 +104,14 @@ async function createKmsReportByDevice (from, to, userData, traccarInstance) {
104
104
  async function createKmsReportByDriver (from, to, userData, traccarInstance) {
105
105
  const report = { drivers: [] }
106
106
 
107
- if (isClientSide() && (userData.drivers.length > 50 || ((new Date(to).getTime() - new Date(from).getTime()) > (1000 * 60 * 60 * 24 * 15))) && userData.groupByDay) {
108
- const { devices, drivers } = await driversUtil.devicesByDriver(traccarInstance, from, to, userData.drivers, userData.devices)
107
+ const { devices, drivers } = await driversUtil.devicesByDriver(traccarInstance, from, to, userData.drivers, userData.devices)
109
108
 
110
- console.log(drivers.length, devices.length)
109
+ console.log(drivers.length, devices.length)
111
110
 
112
- userData.devices = devices
113
- userData.drivers = drivers
111
+ userData.devices = devices
112
+ userData.drivers = drivers
114
113
 
114
+ if (isClientSide() && (userData.drivers.length > 50 || ((new Date(to).getTime() - new Date(from).getTime()) > (1000 * 60 * 60 * 24 * 15))) && userData.groupByDay) {
115
115
  const sliced = automaticReports.sliceArray(userData.drivers, 10)
116
116
  await executeServerSide('kms-report', sliced, from, to, userData, userData.drivers.length, traccarInstance, 5).then(drivers => {
117
117
  report.drivers = drivers