fleetmap-reports 1.0.229 → 1.0.233

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.229",
3
+ "version": "1.0.233",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/kms-report.js CHANGED
@@ -237,14 +237,18 @@ function exportKmsReportToExcel(userData, reportData) {
237
237
 
238
238
  const headers = []
239
239
 
240
- if(userData.groupByDay){
240
+ if(userData.groupByDay) {
241
241
  headers.push(
242
242
  {label: translations.report.vehicle, value: 'name'},
243
- {label: translations.settings.vehicle_licenseplate, value: 'licenseplate'},
244
243
  {label: translations.report.group, value: 'group'},
245
244
  {label: translations.report.date, value: 'date'},
246
245
  {label: translations.report.distance, value: 'distance'})
247
246
  } else if(userData.byDriver) {
247
+ headers.push(
248
+ {label: translations.report.driver, value: 'name'},
249
+ {label: translations.report.group, value: 'group'},
250
+ {label: translations.report.distance, value: 'distance'})
251
+ } else {
248
252
  headers.push(
249
253
  {label: translations.report.driver, value: 'name'},
250
254
  {label: translations.settings.vehicle_licenseplate, value: 'licenseplate'},
@@ -258,7 +262,7 @@ function exportKmsReportToExcel(userData, reportData) {
258
262
  const group = userData.byDriver ? userData.groups.find(g => g.drivers.includes(d.driver.id)) :
259
263
  userData.groups.find(g => d.device.groupId === g.id)
260
264
 
261
- if(userData.groupByDay) {
265
+ if (userData.groupByDay) {
262
266
  data = data.concat([{}])
263
267
  data = data.concat(d.days.map(a => {
264
268
  return {
@@ -139,7 +139,7 @@ async function exportLocationReportToPDF(userData, reportData) {
139
139
  doc.text(new Date(d.from).toLocaleString() + ' - ' + new Date(d.to).toLocaleString(), 20, space + 25)
140
140
  d.positions.map(a => {
141
141
  const temp = [
142
- getLocationDate(a, userData.user),
142
+ a.fixTime,
143
143
  a.address,
144
144
  Math.round(a.speed * 1.85200),
145
145
  a.attributes.ignition ? translations.report.ignitionOn : translations.report.ignitionOff,