fleetmap-reports 1.0.225 → 1.0.229
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/lang/index.js +4 -1
- package/package.json +1 -1
- package/src/kms-report.js +5 -2
package/lang/index.js
CHANGED
package/package.json
CHANGED
package/src/kms-report.js
CHANGED
|
@@ -68,7 +68,7 @@ function processDevices(from, to, devices, data) {
|
|
|
68
68
|
keys.forEach(key => {
|
|
69
69
|
const dayLocations = groupedLocations.get(key)
|
|
70
70
|
const day = {
|
|
71
|
-
date: key,
|
|
71
|
+
date: new Date(key).toLocaleDateString(),
|
|
72
72
|
kms: dayLocations.reduce((a, b) => a + b.attributes.distance, 0) || 0
|
|
73
73
|
}
|
|
74
74
|
days.push(day)
|
|
@@ -228,7 +228,6 @@ function exportKmsReportToExcel(userData, reportData) {
|
|
|
228
228
|
console.log('Export to Excel')
|
|
229
229
|
|
|
230
230
|
const lang = userData.user.attributes.lang || (navigator && navigator.language)
|
|
231
|
-
console.log(lang)
|
|
232
231
|
const translations = messages[lang] ? messages[lang] : messages['en-GB']
|
|
233
232
|
|
|
234
233
|
const settings = {
|
|
@@ -241,12 +240,14 @@ function exportKmsReportToExcel(userData, reportData) {
|
|
|
241
240
|
if(userData.groupByDay){
|
|
242
241
|
headers.push(
|
|
243
242
|
{label: translations.report.vehicle, value: 'name'},
|
|
243
|
+
{label: translations.settings.vehicle_licenseplate, value: 'licenseplate'},
|
|
244
244
|
{label: translations.report.group, value: 'group'},
|
|
245
245
|
{label: translations.report.date, value: 'date'},
|
|
246
246
|
{label: translations.report.distance, value: 'distance'})
|
|
247
247
|
} else if(userData.byDriver) {
|
|
248
248
|
headers.push(
|
|
249
249
|
{label: translations.report.driver, value: 'name'},
|
|
250
|
+
{label: translations.settings.vehicle_licenseplate, value: 'licenseplate'},
|
|
250
251
|
{label: translations.report.group, value: 'group'},
|
|
251
252
|
{label: translations.report.distance, value: 'distance'})
|
|
252
253
|
}
|
|
@@ -263,6 +264,7 @@ function exportKmsReportToExcel(userData, reportData) {
|
|
|
263
264
|
return {
|
|
264
265
|
name: userData.byDriver ? d.driver.name : d.device.name,
|
|
265
266
|
group: group ? group.name : '',
|
|
267
|
+
licenseplate: d.device.attributes.license_plate,
|
|
266
268
|
date: a.date,
|
|
267
269
|
distance: Number((a.kms / 1000).toFixed(0))
|
|
268
270
|
}
|
|
@@ -271,6 +273,7 @@ function exportKmsReportToExcel(userData, reportData) {
|
|
|
271
273
|
data = data.concat([{
|
|
272
274
|
name: userData.byDriver ? d.driver.name : d.summary.deviceName,
|
|
273
275
|
group: group ? group.name : '',
|
|
276
|
+
licenseplate: d.device.attributes.license_plate,
|
|
274
277
|
distance: Number((d.summary.distance / 1000).toFixed(0))
|
|
275
278
|
}])
|
|
276
279
|
}
|