fleetmap-reports 1.0.458 → 1.0.462
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 +2 -0
- package/src/location-report.js +13 -3
package/package.json
CHANGED
package/src/activity-report.js
CHANGED
|
@@ -196,6 +196,7 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
196
196
|
})
|
|
197
197
|
|
|
198
198
|
if (summaryCurrentDay) {
|
|
199
|
+
summaryCurrentDay.engineHours = tripsByDay.reduce((a, b) => a + b.duration, 0)
|
|
199
200
|
summaryCurrentDay.distance = distance
|
|
200
201
|
summaryCurrentDay.convertedSpentFuel = automaticReports.calculateSpentFuel(summaryCurrentDay.spentFuel, d)
|
|
201
202
|
summaryCurrentDay.startTime = tripsByDay.length && tripsByDay[0].startTime
|
|
@@ -227,6 +228,7 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
227
228
|
|
|
228
229
|
if (summary.length) {
|
|
229
230
|
summary.forEach(s => {
|
|
231
|
+
s.engineHours = deviceTrips.reduce((a, b) => a + b.duration, 0)
|
|
230
232
|
s.distance = deviceTrips.reduce((a, b) => a + b.distance, 0)
|
|
231
233
|
s.convertedSpentFuel = automaticReports.calculateSpentFuel(s.spentFuel, d)
|
|
232
234
|
s.startTime = deviceTrips.length && deviceTrips[0].startTime
|
package/src/location-report.js
CHANGED
|
@@ -188,6 +188,8 @@ async function exportLocationReportToPDF (userData, reportData) {
|
|
|
188
188
|
headers.push(getDigitalPort1Label(userData.byDriver ? positionsData[0].driver : positionsData[0].device, translations))
|
|
189
189
|
headers.push(getDigitalPort2Label(userData.byDriver ? positionsData[0].driver : positionsData[0].device, translations))
|
|
190
190
|
}
|
|
191
|
+
headers.push('Latitude')
|
|
192
|
+
headers.push('Longitude')
|
|
191
193
|
|
|
192
194
|
let first = true
|
|
193
195
|
// eslint-disable-next-line new-cap
|
|
@@ -228,7 +230,8 @@ async function exportLocationReportToPDF (userData, reportData) {
|
|
|
228
230
|
temp.push(getDigitalPortValue(a, 1, translations))
|
|
229
231
|
temp.push(getDigitalPortValue(a, 2, translations))
|
|
230
232
|
}
|
|
231
|
-
|
|
233
|
+
temp.push(a.latitude)
|
|
234
|
+
temp.push(a.longitude)
|
|
232
235
|
data.push(temp)
|
|
233
236
|
})
|
|
234
237
|
|
|
@@ -323,13 +326,18 @@ function exportLocationReportToExcel (userData, reportData) {
|
|
|
323
326
|
{ label: translations.report.address, value: 'address' },
|
|
324
327
|
{ label: translations.report.speed, value: 'speed' },
|
|
325
328
|
{ label: translations.report.ignition, value: 'ignition' },
|
|
326
|
-
{ label: translations.report.driver, value: 'driver' }
|
|
329
|
+
{ label: translations.report.driver, value: 'driver' },
|
|
330
|
+
{ label: 'Latitude', value: 'latitude' },
|
|
331
|
+
{ label: 'Longitude', value: 'longitude' }
|
|
327
332
|
]
|
|
328
333
|
|
|
329
334
|
if (userData.includeTemperature) {
|
|
330
335
|
headers.push({ label: translations.report.temperature, value: 'temperature' })
|
|
331
336
|
}
|
|
332
337
|
|
|
338
|
+
headers.push({ label: 'latitude', value: 'latitude' })
|
|
339
|
+
headers.push({ label: 'longitude', value: 'longitude' })
|
|
340
|
+
|
|
333
341
|
let data = []
|
|
334
342
|
if (positionsData) {
|
|
335
343
|
if (userData.includeDigitalPorts) {
|
|
@@ -349,7 +357,9 @@ function exportLocationReportToExcel (userData, reportData) {
|
|
|
349
357
|
driver: userData.byDriver ? d.driver.name : getDriverName(a, userData.drivers),
|
|
350
358
|
temperature: getTempValue(a),
|
|
351
359
|
digitalport1: getDigitalPortValue(a, 1, translations),
|
|
352
|
-
digitalport2: getDigitalPortValue(a, 2, translations)
|
|
360
|
+
digitalport2: getDigitalPortValue(a, 2, translations),
|
|
361
|
+
latitude: a.latitude,
|
|
362
|
+
longitude: a.longitude
|
|
353
363
|
}
|
|
354
364
|
}))
|
|
355
365
|
})
|