fleetmap-reports 1.0.615 → 1.0.617

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.615",
3
+ "version": "1.0.617",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -44,7 +44,8 @@ async function createKmsReportByDevice (from, to, userData, traccarInstance) {
44
44
  to
45
45
  }
46
46
 
47
- const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devices, true, true, false, false)
47
+ const needRoute = !userData.allWeek
48
+ const allInOne = await traccarHelper.getAllInOne(traccarInstance, from, to, devices, needRoute, true, false, false, 0, devices.length, 20)
48
49
  const tripsData = allInOne.trips
49
50
  const routeData = allInOne.route
50
51
 
package/src/util/odoo.js CHANGED
@@ -2,12 +2,17 @@
2
2
  async function getOdooFuelServices (traccar, from, to) {
3
3
  const url = `/odoo/reports/refuelingServices?startDate=${from.toDateString()}&endDate=${to.toDateString()}`
4
4
 
5
- const { data } = await traccar.axios.get(url, {
6
- jar: traccar.cookieJar,
7
- withCredentials: true
8
- })
5
+ try {
6
+ const { data } = await traccar.axios.get(url, {
7
+ jar: traccar.cookieJar,
8
+ withCredentials: true
9
+ })
9
10
 
10
- return data
11
+ return data
12
+ } catch (e) {
13
+ console.log(e)
14
+ return []
15
+ }
11
16
  }
12
17
 
13
18
  exports.getOdooFuelServices = getOdooFuelServices