fleetmap-reports 1.0.666 → 1.0.668
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/src/zone-report.js +2 -0
package/package.json
CHANGED
package/src/kms-report.js
CHANGED
|
@@ -169,7 +169,9 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
169
169
|
|
|
170
170
|
if (trips.length > 0 && userData.groupByDay) {
|
|
171
171
|
trips.forEach(t => {
|
|
172
|
-
|
|
172
|
+
const tripDay = convertFromUTC(t.startTime, userData.user.attributes.timezone)
|
|
173
|
+
tripDay.setHours(12, 0, 0)
|
|
174
|
+
t.tripDay = tripDay.toISOString()
|
|
173
175
|
})
|
|
174
176
|
const groupedTrips = trips.reduce(
|
|
175
177
|
(entryMap, e) => entryMap.set(e.tripDay, [...entryMap.get(e.tripDay) || [], e]),
|
|
@@ -181,7 +183,8 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
181
183
|
const days = []
|
|
182
184
|
let keys = Array.from(groupedTrips.keys())
|
|
183
185
|
allDates.forEach(d => {
|
|
184
|
-
|
|
186
|
+
d.setHours(12, 0, 0)
|
|
187
|
+
const day = d.toISOString()
|
|
185
188
|
if (!keys.includes(day)) {
|
|
186
189
|
groupedTrips.set(day, [])
|
|
187
190
|
}
|
|
@@ -196,7 +199,6 @@ function processDevices (from, to, devices, data, userData) {
|
|
|
196
199
|
date: currentDate,
|
|
197
200
|
kms: 0
|
|
198
201
|
}
|
|
199
|
-
|
|
200
202
|
day.kms = dayTrips.reduce((a, b) => a + b.distance, 0)
|
|
201
203
|
|
|
202
204
|
days.push(day)
|
package/src/zone-report.js
CHANGED
|
@@ -520,6 +520,7 @@ function exportZoneReportToExcel (userData, reportData) {
|
|
|
520
520
|
}
|
|
521
521
|
const headers = userData.groupByDay
|
|
522
522
|
? [
|
|
523
|
+
{ label: translations.report.vehicle, value: 'name' },
|
|
523
524
|
{ label: translations.report.date, value: 'date' },
|
|
524
525
|
{ label: translations.report.firstIn, value: 'firstIn' },
|
|
525
526
|
{ label: translations.report.lastOut, value: 'lastOut' },
|
|
@@ -545,6 +546,7 @@ function exportZoneReportToExcel (userData, reportData) {
|
|
|
545
546
|
data = userData.groupByDay
|
|
546
547
|
? data.concat(d.days.map(a => {
|
|
547
548
|
return {
|
|
549
|
+
name: d.device.name,
|
|
548
550
|
date: convertToLocaleDateString(a.date, userData.user.attributes.lang, userData.user.attributes.timezone),
|
|
549
551
|
firstIn: a.firstIn ? convertToLocaleTimeString(a.firstIn, userData.user.attributes.lang, userData.user.attributes.timezone) : '-',
|
|
550
552
|
lastOut: a.lastOut ? convertToLocaleTimeString(a.lastOut, userData.user.attributes.lang, userData.user.attributes.timezone) : '-',
|