fleetmap-reports 1.0.656 → 1.0.658
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/stop-report.js +4 -11
package/package.json
CHANGED
package/src/stop-report.js
CHANGED
|
@@ -2,7 +2,7 @@ const { devicesToProcess, deviceName } = require('./util/device')
|
|
|
2
2
|
const automaticReports = require('./automaticReports')
|
|
3
3
|
const traccarHelper = require('./util/traccar')
|
|
4
4
|
const { getNearestPOIs, insideGeofence, loadGroupsData } = require('./util/geofence')
|
|
5
|
-
const { getTranslations, convertToLocaleString, convertMS
|
|
5
|
+
const { getTranslations, convertToLocaleString, convertMS } = require('./util/utils')
|
|
6
6
|
const jsPDF = require('jspdf')
|
|
7
7
|
const { headerFromUser, addTable } = require('./util/pdfDocument')
|
|
8
8
|
const { getStyle } = require('./reportStyle')
|
|
@@ -98,7 +98,6 @@ async function exportStopReportToPDF (userData, reportData) {
|
|
|
98
98
|
const stopsData = userData.byDriver ? reportData.drivers : reportData.devices
|
|
99
99
|
|
|
100
100
|
const headers = [
|
|
101
|
-
translations.report.date,
|
|
102
101
|
translations.report.start,
|
|
103
102
|
translations.report.end,
|
|
104
103
|
translations.report.address,
|
|
@@ -131,7 +130,6 @@ async function exportStopReportToPDF (userData, reportData) {
|
|
|
131
130
|
|
|
132
131
|
d.stops.forEach(a => {
|
|
133
132
|
data.push([
|
|
134
|
-
getStopDate(userData.user, a),
|
|
135
133
|
getStopStart(userData.user, a),
|
|
136
134
|
getStopEnd(userData.user, a),
|
|
137
135
|
a.endPOIName || a.address,
|
|
@@ -171,7 +169,7 @@ function exportStopReportToExcel (userData, reportData) {
|
|
|
171
169
|
}
|
|
172
170
|
|
|
173
171
|
const headers = [
|
|
174
|
-
{ label: translations.report.
|
|
172
|
+
{ label: translations.report.vehicle, value: 'name' },
|
|
175
173
|
{ label: translations.report.start, value: 'start' },
|
|
176
174
|
{ label: translations.report.end, value: 'end' },
|
|
177
175
|
{ label: translations.report.address, value: 'address' },
|
|
@@ -187,7 +185,6 @@ function exportStopReportToExcel (userData, reportData) {
|
|
|
187
185
|
data = data.concat(d.stops.map(a => {
|
|
188
186
|
return {
|
|
189
187
|
name: a.deviceName,
|
|
190
|
-
date: getStopDate(userData.user, a),
|
|
191
188
|
start: getStopStart(userData.user, a),
|
|
192
189
|
end: getStopEnd(userData.user, a),
|
|
193
190
|
address: a.endPOIName || a.address,
|
|
@@ -213,16 +210,12 @@ function exportStopReportToExcel (userData, reportData) {
|
|
|
213
210
|
}
|
|
214
211
|
}
|
|
215
212
|
|
|
216
|
-
function getStopDate (user, stop) {
|
|
217
|
-
return convertToLocaleDateString(stop.startTime, user.attributes.lang, user.attributes.timezone)
|
|
218
|
-
}
|
|
219
|
-
|
|
220
213
|
function getStopStart (user, stop) {
|
|
221
|
-
return
|
|
214
|
+
return convertToLocaleString(stop.startTime, user.attributes.lang, user.attributes.timezone)
|
|
222
215
|
}
|
|
223
216
|
|
|
224
217
|
function getStopEnd (user, stop) {
|
|
225
|
-
return
|
|
218
|
+
return convertToLocaleString(stop.endTime, user.attributes.lang, user.attributes.timezone)
|
|
226
219
|
}
|
|
227
220
|
|
|
228
221
|
exports.createStopReport = createStopReport
|