fleetmap-reports 1.0.720 → 1.0.721
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 +1 -1
- package/src/activity-report.js +10 -3
package/package.json
CHANGED
package/src/activity-report.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const automaticReports = require('./automaticReports')
|
|
2
|
-
const { convertMS, getDates, getTranslations, weekDaySelected } = require('./util/utils')
|
|
2
|
+
const { convertMS, getDates, getTranslations, weekDaySelected, convertToLocaleString } = require('./util/utils')
|
|
3
3
|
const jsPDF = require('jspdf')
|
|
4
4
|
require('jspdf-autotable')
|
|
5
5
|
const {
|
|
@@ -338,6 +338,9 @@ async function exportActivityReportToPDF (userData, reportData) {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
function exportActivityReportToPDFDriver (doc, translations, reportData, userData) {
|
|
341
|
+
const timezone = userData.user.attributes.timezone
|
|
342
|
+
const lang = userData.user.attributes.lang || (navigator && navigator.language)
|
|
343
|
+
|
|
341
344
|
const headers = [translations.report.driver,
|
|
342
345
|
translations.report.start,
|
|
343
346
|
translations.report.end,
|
|
@@ -347,7 +350,8 @@ function exportActivityReportToPDFDriver (doc, translations, reportData, userDat
|
|
|
347
350
|
translations.report.driverHours]
|
|
348
351
|
|
|
349
352
|
doc.setFontSize(10)
|
|
350
|
-
doc.text(
|
|
353
|
+
doc.text(convertToLocaleString(reportData.from, lang, timezone) + ' - ' + convertToLocaleString(reportData.to, lang, timezone), 20, 30)
|
|
354
|
+
doc.text()
|
|
351
355
|
|
|
352
356
|
const data = []
|
|
353
357
|
reportData.drivers.forEach(d => {
|
|
@@ -375,6 +379,9 @@ function exportActivityReportToPDFDriver (doc, translations, reportData, userDat
|
|
|
375
379
|
}
|
|
376
380
|
|
|
377
381
|
function exportActivityReportToPDFVehicle (doc, translations, reportData, userData) {
|
|
382
|
+
const timezone = userData.user.attributes.timezone
|
|
383
|
+
const lang = userData.user.attributes.lang || (navigator && navigator.language)
|
|
384
|
+
|
|
378
385
|
const headers = [translations.report.vehicle,
|
|
379
386
|
translations.report.group,
|
|
380
387
|
translations.report.start,
|
|
@@ -388,7 +395,7 @@ function exportActivityReportToPDFVehicle (doc, translations, reportData, userDa
|
|
|
388
395
|
translations.report.spentFuel]
|
|
389
396
|
|
|
390
397
|
doc.setFontSize(10)
|
|
391
|
-
doc.text(
|
|
398
|
+
doc.text(convertToLocaleString(reportData.from, lang, timezone) + ' - ' + convertToLocaleString(reportData.to, lang, timezone), 20, 30)
|
|
392
399
|
|
|
393
400
|
const data = []
|
|
394
401
|
reportData.devices.forEach(d => {
|