fleetmap-reports 1.0.221 → 1.0.225
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/kms-report.js +5 -3
package/package.json
CHANGED
package/src/kms-report.js
CHANGED
|
@@ -69,7 +69,7 @@ function processDevices(from, to, devices, data) {
|
|
|
69
69
|
const dayLocations = groupedLocations.get(key)
|
|
70
70
|
const day = {
|
|
71
71
|
date: key,
|
|
72
|
-
kms: dayLocations.reduce((a, b) => a + b.attributes.distance, 0)
|
|
72
|
+
kms: dayLocations.reduce((a, b) => a + b.attributes.distance, 0) || 0
|
|
73
73
|
}
|
|
74
74
|
days.push(day)
|
|
75
75
|
})
|
|
@@ -157,8 +157,9 @@ async function exportKmsReportToPDF(userData, reportData) {
|
|
|
157
157
|
d.days.forEach(day => {
|
|
158
158
|
const temp = [
|
|
159
159
|
new Date(day.date).toLocaleDateString(),
|
|
160
|
-
|
|
160
|
+
(day.kms/1000).toFixed(0)
|
|
161
161
|
]
|
|
162
|
+
|
|
162
163
|
data.push(temp)
|
|
163
164
|
})
|
|
164
165
|
|
|
@@ -226,7 +227,8 @@ async function exportKmsReportToPDF(userData, reportData) {
|
|
|
226
227
|
function exportKmsReportToExcel(userData, reportData) {
|
|
227
228
|
console.log('Export to Excel')
|
|
228
229
|
|
|
229
|
-
const lang = userData.user.attributes.lang
|
|
230
|
+
const lang = userData.user.attributes.lang || (navigator && navigator.language)
|
|
231
|
+
console.log(lang)
|
|
230
232
|
const translations = messages[lang] ? messages[lang] : messages['en-GB']
|
|
231
233
|
|
|
232
234
|
const settings = {
|