fleetmap-reports 1.0.889 → 1.0.892
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 +6 -3
- package/src/events-report.js +5 -2
- package/src/location-report.js +5 -2
- package/src/stop-report.js +5 -2
- package/src/zone-report.js +9 -8
package/package.json
CHANGED
package/src/activity-report.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const automaticReports = require('./automaticReports')
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
convertMS, getDates, getTranslations, weekDaySelected, convertToLocaleString, isClientSide,
|
|
4
|
+
getLanguage
|
|
5
|
+
} = require('./util/utils')
|
|
3
6
|
const jsPDF = require('jspdf')
|
|
4
7
|
require('jspdf-autotable')
|
|
5
8
|
const {
|
|
@@ -341,7 +344,7 @@ async function exportActivityReportToPDF (userData, reportData) {
|
|
|
341
344
|
|
|
342
345
|
function exportActivityReportToPDFDriver (doc, translations, reportData, userData) {
|
|
343
346
|
const timezone = userData.user.attributes.timezone
|
|
344
|
-
const lang = userData
|
|
347
|
+
const lang = getLanguage(userData)
|
|
345
348
|
|
|
346
349
|
const headers = [translations.report.driver,
|
|
347
350
|
translations.report.start,
|
|
@@ -381,7 +384,7 @@ function exportActivityReportToPDFDriver (doc, translations, reportData, userDat
|
|
|
381
384
|
|
|
382
385
|
function exportActivityReportToPDFVehicle (doc, translations, reportData, userData) {
|
|
383
386
|
const timezone = userData.user.attributes.timezone
|
|
384
|
-
const lang = userData
|
|
387
|
+
const lang = getLanguage(userData)
|
|
385
388
|
|
|
386
389
|
const headers = [translations.report.vehicle,
|
|
387
390
|
translations.report.group,
|
package/src/events-report.js
CHANGED
|
@@ -4,7 +4,10 @@ require('jspdf-autotable')
|
|
|
4
4
|
const { getStyle } = require('./reportStyle')
|
|
5
5
|
const { headerFromUser } = require('./util/pdfDocument')
|
|
6
6
|
const { getUserPartner } = require('fleetmap-partners')
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
convertToLocaleString, getTranslations, convertMS,
|
|
9
|
+
getLanguage
|
|
10
|
+
} = require('./util/utils')
|
|
8
11
|
const { devicesToProcess } = require('./util/device')
|
|
9
12
|
const { isInside } = require('./util/timetable')
|
|
10
13
|
const { getDigitalPortValue } = require('./location-report')
|
|
@@ -133,7 +136,7 @@ async function processDevices (from, to, devices, data, traccar, userData) {
|
|
|
133
136
|
|
|
134
137
|
async function exportSpeedingReportToPDF (userData, reportData) {
|
|
135
138
|
console.log('Export to PDF')
|
|
136
|
-
const lang = userData
|
|
139
|
+
const lang = getLanguage(userData)
|
|
137
140
|
const translations = getTranslations(userData)
|
|
138
141
|
const timezone = userData.user.attributes.timezone
|
|
139
142
|
|
package/src/location-report.js
CHANGED
|
@@ -3,7 +3,10 @@ require('jspdf-autotable')
|
|
|
3
3
|
const { headerFromUser } = require('./util/pdfDocument')
|
|
4
4
|
const { getStyle } = require('./reportStyle')
|
|
5
5
|
const { getUserPartner } = require('fleetmap-partners')
|
|
6
|
-
const {
|
|
6
|
+
const {
|
|
7
|
+
convertToLocaleString, getTranslations,
|
|
8
|
+
getLanguage
|
|
9
|
+
} = require('./util/utils')
|
|
7
10
|
const traccarHelper = require('./util/traccar')
|
|
8
11
|
const { devicesToProcess } = require('./util/device')
|
|
9
12
|
const automaticReports = require('./automaticReports')
|
|
@@ -180,7 +183,7 @@ async function exportLocationReportToPDF (userData, reportData) {
|
|
|
180
183
|
console.log('Export to PDF')
|
|
181
184
|
|
|
182
185
|
const translations = getTranslations(userData)
|
|
183
|
-
const lang = userData
|
|
186
|
+
const lang = getLanguage(userData)
|
|
184
187
|
const timezone = userData.user.attributes.timezone
|
|
185
188
|
|
|
186
189
|
const positionsData = userData.byDriver ? reportData.drivers : reportData.devices
|
package/src/stop-report.js
CHANGED
|
@@ -2,7 +2,10 @@ const { devicesToProcess, deviceName } = require('./util/device')
|
|
|
2
2
|
const automaticReports = require('./automaticReports')
|
|
3
3
|
const traccarHelper = require('./util/traccar')
|
|
4
4
|
const { getNearestPOIs, insideGeofence, loadGroupsData } = require('./util/geofence')
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
getTranslations, convertToLocaleString, convertMS,
|
|
7
|
+
getLanguage
|
|
8
|
+
} = require('./util/utils')
|
|
6
9
|
const jsPDF = require('jspdf')
|
|
7
10
|
const { headerFromUser, addTable } = require('./util/pdfDocument')
|
|
8
11
|
const { getStyle } = require('./reportStyle')
|
|
@@ -95,7 +98,7 @@ async function exportStopReportToPDF (userData, reportData) {
|
|
|
95
98
|
|
|
96
99
|
const timezone = userData.user.attributes.timezone
|
|
97
100
|
const translations = getTranslations(userData)
|
|
98
|
-
const lang = userData
|
|
101
|
+
const lang = getLanguage(userData)
|
|
99
102
|
const stopsData = userData.byDriver ? reportData.drivers : reportData.devices
|
|
100
103
|
|
|
101
104
|
const headers = [
|
package/src/zone-report.js
CHANGED
|
@@ -3,7 +3,8 @@ const {
|
|
|
3
3
|
convertMS, convertToLocaleString, getTranslations, convertToFeature, convertPositionToFeature,
|
|
4
4
|
calculateDistance,
|
|
5
5
|
sortPositions, getDates, convertToLocaleDateString, convertToLocaleTimeString,
|
|
6
|
-
isClientSide
|
|
6
|
+
isClientSide,
|
|
7
|
+
getLanguage
|
|
7
8
|
} = require('./util/utils')
|
|
8
9
|
const jsPDF = require('jspdf')
|
|
9
10
|
require('jspdf-autotable')
|
|
@@ -468,7 +469,7 @@ async function exportZoneReportToPDF (userData, reportData) {
|
|
|
468
469
|
|
|
469
470
|
const timezone = userData.user.attributes.timezone
|
|
470
471
|
const translations = getTranslations(userData)
|
|
471
|
-
const lang = userData
|
|
472
|
+
const lang = getLanguage(userData)
|
|
472
473
|
|
|
473
474
|
const headers = []
|
|
474
475
|
|
|
@@ -638,9 +639,9 @@ function exportZoneReportToExcel (userData, reportData) {
|
|
|
638
639
|
{ label: translations.report.date, value: 'date' },
|
|
639
640
|
{ label: translations.report.firstIn, value: 'firstIn' },
|
|
640
641
|
{ label: translations.report.lastOut, value: 'lastOut' },
|
|
641
|
-
{ label: translations.report.distanceIn || 'Kms Adentro', value: 'distanceIn' },
|
|
642
|
+
{ label: translations.report.distanceIn || 'Kms Adentro', value: 'distanceIn', format: '0' },
|
|
642
643
|
{ label: translations.report.timeIn, value: 'totalInTime' },
|
|
643
|
-
{ label: translations.report.distanceOut || 'Kms Afuera', value: 'distanceOut' },
|
|
644
|
+
{ label: translations.report.distanceOut || 'Kms Afuera', value: 'distanceOut', format: '0' },
|
|
644
645
|
{ label: translations.report.timeOut, value: 'totalOutTime' }
|
|
645
646
|
])
|
|
646
647
|
} else if (userData.zonesByColumn) {
|
|
@@ -651,7 +652,7 @@ function exportZoneReportToExcel (userData, reportData) {
|
|
|
651
652
|
reportData.devices[0].days[0].geofences.forEach(g =>
|
|
652
653
|
headers.push({ label: g.geofenceName, value: g.geofenceId })
|
|
653
654
|
)
|
|
654
|
-
headers.push({ label: translations.report.distanceOut || 'Kms Afuera', value: 'distanceOut' })
|
|
655
|
+
headers.push({ label: translations.report.distanceOut || 'Kms Afuera', value: 'distanceOut', format: '0' })
|
|
655
656
|
} else if (userData.tripsBetweenZones) {
|
|
656
657
|
headers.push(...[
|
|
657
658
|
{ label: translations.report.vehicle, value: 'name' },
|
|
@@ -660,7 +661,7 @@ function exportZoneReportToExcel (userData, reportData) {
|
|
|
660
661
|
{ label: translations.report.date_end, value: 'enter' },
|
|
661
662
|
{ label: translations.report.geofenceIn || 'Zone IN', value: 'zoneIn' },
|
|
662
663
|
{ label: translations.report.duration, value: 'totalOutTime' },
|
|
663
|
-
{ label: translations.report.distance, value: 'distanceOut' }
|
|
664
|
+
{ label: translations.report.distance, value: 'distanceOut', format: '0' }
|
|
664
665
|
])
|
|
665
666
|
} else {
|
|
666
667
|
headers.push(...[
|
|
@@ -669,8 +670,8 @@ function exportZoneReportToExcel (userData, reportData) {
|
|
|
669
670
|
{ label: translations.report.exit, value: 'exit' },
|
|
670
671
|
{ label: translations.report.stopped, value: 'stopped' },
|
|
671
672
|
{ label: translations.report.duration, value: 'totalInTime' },
|
|
672
|
-
{ label: translations.report.distanceIn || 'Kms Adentro', value: 'distanceIn' },
|
|
673
|
-
{ label: translations.report.distanceOut || 'Kms Afuera', value: 'distanceOut' },
|
|
673
|
+
{ label: translations.report.distanceIn || 'Kms Adentro', value: 'distanceIn', format: '0' },
|
|
674
|
+
{ label: translations.report.distanceOut || 'Kms Afuera', value: 'distanceOut', format: '0' },
|
|
674
675
|
{ label: translations.report.geofence, value: 'zone' },
|
|
675
676
|
{ label: translations.report.driver, value: 'driver' }
|
|
676
677
|
])
|