fleetmap-reports 1.0.969 → 1.0.970

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.969",
3
+ "version": "1.0.970",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -139,7 +139,7 @@ function getDeviceData (allInOne, d) {
139
139
  const deviceStops = allInOne.stops.filter(t => t.deviceId === d.id)
140
140
 
141
141
  const drivingTime = deviceTrips.reduce((a, b) => a + b.duration, 0)
142
- const drivingConsumption = calculateConsumption(d, { trips: [], stops: [], route: [], summary: deviceSummary }, undefined)
142
+ const drivingConsumption = calculateConsumption(d, { trips: deviceTrips, stops: [], route: deviceRoute, summary: deviceSummary }, undefined)
143
143
  const drivingDistance = deviceSummary ? deviceSummary.distance / 1000 : 0
144
144
  const idleTime = deviceTrips.reduce((a, b) => a + b.idleTime, 0) + deviceStops.reduce((a, b) => a + b.engineHours, 0)
145
145
  const idleConsumption = deviceSummary && deviceSummary.spentFuel > drivingConsumption ? deviceSummary.spentFuel - drivingConsumption : 0
@@ -27,10 +27,10 @@ describe('performance', function () {
27
27
  it('performance report inofleet', async () => {
28
28
  const report = await getReports()
29
29
  const userData = await report.getUserData()
30
- userData.devices = userData.devices.filter(d => d.id === 69114)
30
+ userData.devices = userData.devices.filter(d => d.id === 126442)
31
31
  const data = await createPerformanceReport(
32
- new Date(Date.UTC(2023, 5, 11, 0, 0, 0, 0)),
33
- new Date(Date.UTC(2023, 6, 11, 23, 59, 59, 0)),
32
+ new Date(Date.UTC(2023, 11, 9, 0, 0, 0, 0)),
33
+ new Date(Date.UTC(2023, 11, 18, 23, 59, 59, 0)),
34
34
  userData,
35
35
  report.traccar)
36
36
  console.log(data)