fleetmap-reports 2.0.107 → 2.0.108

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.107",
3
+ "version": "2.0.108",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -285,7 +285,7 @@ async function exportKmsReportToPDF (userData, reportData) {
285
285
  translations.report.group,
286
286
  translations.report.distance)
287
287
  } else {
288
- headers.push(translations.report.name,
288
+ headers.push(translations.report.vehicle,
289
289
  translations.settings.vehicle_model,
290
290
  translations.report.group,
291
291
  translations.report.distance)
@@ -369,7 +369,11 @@ async function exportKmsReportToPDF (userData, reportData) {
369
369
 
370
370
  const style = getStyle(getUserPartner(userData.user))
371
371
 
372
- addTable(doc, headers, data, footValues, style, 35)
372
+ const columnStyles = {}
373
+ headers.forEach((h, i) => {
374
+ columnStyles[i] = h === translations.report.distance ? { halign: 'right' } : {}
375
+ })
376
+ addTable(doc, headers, data, footValues, style, 35, columnStyles)
373
377
  }
374
378
  return doc
375
379
  }
@@ -52,13 +52,13 @@ function addTable (doc, headers, data, footValues, style, startY, columnStyles =
52
52
  data.table.head.forEach((footRow) => {
53
53
  const keys = Object.keys(columnStyles)
54
54
  keys.forEach(a => {
55
- footRow.cells[a].styles.halign = 'right'
55
+ footRow.cells[a].styles.halign = columnStyles[a].halign
56
56
  })
57
57
  })
58
58
  data.table.foot.forEach((footRow) => {
59
59
  const keys = Object.keys(columnStyles)
60
60
  keys.forEach(a => {
61
- footRow.cells[a].styles.halign = 'right'
61
+ footRow.cells[a].styles.halign = columnStyles[a].halign
62
62
  })
63
63
  })
64
64
  },