fleetmap-reports 1.0.908 → 1.0.909
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 +11 -3
package/package.json
CHANGED
package/src/kms-report.js
CHANGED
|
@@ -175,6 +175,8 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
175
175
|
|
|
176
176
|
devicesResult.push({
|
|
177
177
|
device: d,
|
|
178
|
+
startOdometer: trips.length ? trips[0].startOdometer : 0,
|
|
179
|
+
endOdometer: trips.length ? trips[trips.length - 1].endOdometer : 0,
|
|
178
180
|
days
|
|
179
181
|
})
|
|
180
182
|
}
|
|
@@ -182,6 +184,8 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
182
184
|
devicesResult.push({
|
|
183
185
|
device: d,
|
|
184
186
|
summary: {
|
|
187
|
+
startOdometer: trips.length ? trips[0].startOdometer : 0,
|
|
188
|
+
endOdometer: trips.length ? trips[trips.length - 1].endOdometer : 0,
|
|
185
189
|
distance: trips.filter(t => t.distance > 0).reduce((a, b) => a + b.distance, 0)
|
|
186
190
|
}
|
|
187
191
|
})
|
|
@@ -321,14 +325,16 @@ function exportKmsReportToExcel (userData, reportData) {
|
|
|
321
325
|
headers.push(
|
|
322
326
|
{ label: translations.report.vehicle, value: 'name' },
|
|
323
327
|
{ label: translations.settings.vehicle_licenseplate, value: 'licenseplate' },
|
|
324
|
-
{ label: translations.report.group, value: 'group' }
|
|
328
|
+
{ label: translations.report.group, value: 'group' },
|
|
329
|
+
{ label: translations.report.startOdometer, value: 'startOdometer' })
|
|
325
330
|
|
|
326
331
|
const days = info[0].days
|
|
327
332
|
days.forEach((day, index) => {
|
|
328
333
|
headers.push({ label: new Date(day.date).toLocaleDateString(), value: 'day' + index })
|
|
329
334
|
})
|
|
330
335
|
|
|
331
|
-
headers.push({ label: translations.report.total, value: 'total' }
|
|
336
|
+
headers.push({ label: translations.report.total, value: 'total' },
|
|
337
|
+
{ label: translations.report.endOdometer, value: 'endOdometer' })
|
|
332
338
|
} else if (userData.byDriver) {
|
|
333
339
|
headers.push(
|
|
334
340
|
{ label: translations.report.driver, value: 'name' },
|
|
@@ -354,7 +360,9 @@ function exportKmsReportToExcel (userData, reportData) {
|
|
|
354
360
|
const vehicle = {
|
|
355
361
|
name: d.device.name,
|
|
356
362
|
group: group ? group.name : '',
|
|
357
|
-
licenseplate: d.device.attributes.license_plate
|
|
363
|
+
licenseplate: d.device.attributes.license_plate,
|
|
364
|
+
startOdometer: Number((d.startOdometer / 1000).toFixed(1)),
|
|
365
|
+
endOdometer: Number((d.endOdometer / 1000).toFixed(1))
|
|
358
366
|
}
|
|
359
367
|
|
|
360
368
|
d.days.forEach((day, index) => {
|