fleetmap-reports 2.0.143 → 2.0.144

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.143",
3
+ "version": "2.0.144",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -2,7 +2,7 @@ const traccarHelper = require('../util/traccar')
2
2
  const { getDriverData } = require('../util/driver')
3
3
  const { getCanDriverStyleMessages, parseCanDriverStyleMessage } = require('../util/xpert')
4
4
  const { calculateRPMSections } = require('./performance-report')
5
- const { getTranslations, isClientSide, convertToLocaleString } = require('../util/utils')
5
+ const { getTranslations, isClientSide, convertToLocaleString, convertMS } = require('../util/utils')
6
6
  const jsPDF = require('jspdf')
7
7
  const { headerFromUser, addTable } = require('../util/pdfDocument')
8
8
  const { getStyle } = require('../reportStyle')
@@ -200,7 +200,7 @@ async function exportToExcel (userData, reportData) {
200
200
  name: row.name,
201
201
  distance: Number(row.distance.toFixed(1)),
202
202
  avgFuelConsumption: Number(row.avgFuelConsumption.toFixed(2)),
203
- highEngineRPM: row.highEngineRPM,
203
+ highEngineRPM: convertMS(row.highEngineRPM, false),
204
204
  hardBraking: row.hardBraking,
205
205
  hardAcceleration: row.hardAcceleration,
206
206
  hardCornering: row.hardCornering,
@@ -257,9 +257,9 @@ async function exportToPDF (userData, reportData) {
257
257
  reportDataRows.forEach(function (row) {
258
258
  const temp = [
259
259
  row.name,
260
- row.distance,
261
- row.avgFuelConsumption,
262
- row.highEngineRPM,
260
+ row.distance.toFixed(1),
261
+ row.avgFuelConsumption.toFixed(2),
262
+ convertMS(row.highEngineRPM, false),
263
263
  row.hardBraking,
264
264
  row.hardAcceleration,
265
265
  row.hardCornering,
@@ -268,7 +268,7 @@ async function exportToPDF (userData, reportData) {
268
268
  row.continuesDrivingAlarm,
269
269
  row.reverseAlarm,
270
270
  row.otherAlarm,
271
- row.score
271
+ row.score.toFixed(2)
272
272
  ]
273
273
  data.push(temp)
274
274
  })
@@ -276,7 +276,20 @@ async function exportToPDF (userData, reportData) {
276
276
 
277
277
  const style = getStyle(getUserPartner(userData.user))
278
278
 
279
- addTable(doc, headers, data, footValues, style, 40)
279
+ addTable(doc, headers, data, footValues, style, 40, {
280
+ 1: { halign: 'right' },
281
+ 2: { halign: 'right' },
282
+ 3: { halign: 'right' },
283
+ 4: { halign: 'right' },
284
+ 5: { halign: 'right' },
285
+ 6: { halign: 'right' },
286
+ 7: { halign: 'right' },
287
+ 8: { halign: 'right' },
288
+ 9: { halign: 'right' },
289
+ 10: { halign: 'right' },
290
+ 11: { halign: 'right' },
291
+ 12: { halign: 'right' }
292
+ })
280
293
  return doc
281
294
  }
282
295
  }