fleetmap-reports 1.0.577 → 1.0.580

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.577",
3
+ "version": "1.0.580",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/fuel.test.js CHANGED
@@ -7,7 +7,6 @@ const deviceId = 122575
7
7
  describe('Test_Reports', function () {
8
8
  it('Trip by device', async () => {
9
9
  console.log('trip by device')
10
- this.timeout(2000000)
11
10
  const report = await getReports()
12
11
  const userData = await report.getUserData()
13
12
 
package/src/kms-report.js CHANGED
@@ -303,7 +303,7 @@ async function exportKmsReportToPDF (userData, reportData) {
303
303
  const data = []
304
304
  if (userData.byDriver) {
305
305
  reportData.drivers.forEach(d => {
306
- const group = userData.groups.find(g => g.drivers.includes(d.driver.id))
306
+ const group = userData.groups.find(g => g.drivers && g.drivers.includes(d.driver.id))
307
307
 
308
308
  const temp = [
309
309
  d.driver.name,
@@ -306,7 +306,7 @@ function getTempValue (row) {
306
306
  }
307
307
 
308
308
  function getDigitalPort1Label (row, translations, dAttributes) {
309
- return dAttributes.sensor1 || translations.report.digital_ports1
309
+ return (dAttributes && dAttributes.sensor1) || translations.report.digital_ports1
310
310
  }
311
311
 
312
312
  function getDigitalPort2Label (row, translations) {
@@ -363,17 +363,15 @@ function exportLocationReportToExcel (userData, reportData) {
363
363
  { label: translations.report.address, value: 'address' },
364
364
  { label: translations.report.speed, value: 'speed' },
365
365
  { label: translations.report.ignition, value: 'ignition' },
366
- { label: translations.report.driver, value: 'driver' },
367
- { label: 'Latitude', value: 'latitude' },
368
- { label: 'Longitude', value: 'longitude' }
366
+ { label: translations.report.driver, value: 'driver' }
369
367
  ]
370
368
 
371
369
  if (userData.includeTemperature) {
372
370
  headers.push({ label: translations.report.temperature, value: 'temperature' })
373
371
  }
374
372
 
375
- headers.push({ label: 'latitude', value: 'latitude' })
376
- headers.push({ label: 'longitude', value: 'longitude' })
373
+ headers.push({ label: 'Latitude', value: 'latitude' })
374
+ headers.push({ label: 'Longitude', value: 'longitude' })
377
375
 
378
376
  let data = []
379
377
  if (positionsData) {