fleetmap-reports 1.0.552 → 1.0.554
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/esCL.js +2 -2
- package/package.json +1 -1
- package/src/index.test.js +4 -33
- package/src/util/utils.js +1 -1
package/lang/esCL.js
CHANGED
|
@@ -171,7 +171,7 @@ module.exports = {
|
|
|
171
171
|
titleLocationReport: 'Informe de Posiciones',
|
|
172
172
|
titleSpeedingReport: 'Informe de Excesos de Velocidad',
|
|
173
173
|
titleZoneReport: 'Informe de Zonas',
|
|
174
|
-
titleRefuelingReport: 'Informe de
|
|
174
|
+
titleRefuelingReport: 'Informe de Repostajes',
|
|
175
175
|
titleFuelConsumptionReport: 'Informe de Consumos',
|
|
176
176
|
titleFuelDropReport: 'Fuel Drop Report',
|
|
177
177
|
titleEventsReport: 'Informe de Eventos',
|
|
@@ -220,7 +220,7 @@ module.exports = {
|
|
|
220
220
|
engineHours: 'Utilización (HH:mm)',
|
|
221
221
|
totalEngineHours: 'Utilización Total (H:m)',
|
|
222
222
|
driverHours: 'Tiempo de Conducción (H:m)',
|
|
223
|
-
refueling: '
|
|
223
|
+
refueling: 'Repostajes',
|
|
224
224
|
fueldrop: 'Combustível Perdido (L)',
|
|
225
225
|
totalRefueled: 'Total Cargado',
|
|
226
226
|
totalFuelDrops: 'Total Fuel Drops',
|
package/package.json
CHANGED
package/src/index.test.js
CHANGED
|
@@ -41,7 +41,7 @@ describe('Test_Reports', function () {
|
|
|
41
41
|
const userData = await report.getUserData()
|
|
42
42
|
userData.roadSpeedLimits = true
|
|
43
43
|
const { device } = await getSpeedingReport(report, userData)
|
|
44
|
-
assert.equal(device.alerts.length,
|
|
44
|
+
assert.equal(device.alerts.length, 104) // Total Alerts
|
|
45
45
|
// assert.equal(totalDistance, 36.63687856826021) // Total Kms
|
|
46
46
|
// assert.equal(totalEventTime, 1524000) // Total Duration
|
|
47
47
|
}, 200000)
|
|
@@ -114,28 +114,12 @@ describe('Test_Reports', function () {
|
|
|
114
114
|
|
|
115
115
|
assert.equal(data.length, 1)
|
|
116
116
|
const device = data[0].devices.find(d => d.device.id === 25808)
|
|
117
|
-
assert.equal(device.trips.length,
|
|
117
|
+
assert.equal(device.trips.length, 12) // Total Trips
|
|
118
118
|
console.log(device.trips[0])
|
|
119
119
|
// assert.equal(device.trips[0].endAddress, 'RS-409, 184-314 - Centro, Vera Cruz - RS, 96880-000, Brazil')
|
|
120
120
|
assert.equal(device.trips[1].endPOIName, undefined)
|
|
121
121
|
}, 20000)
|
|
122
122
|
// eslint-disable-next-line no-undef
|
|
123
|
-
it('Trip 2 by device', async () => {
|
|
124
|
-
const report = await getReports()
|
|
125
|
-
const userData = await report.getUserData()
|
|
126
|
-
userData.devices = userData.devices.filter(d => d.id === 11437)
|
|
127
|
-
|
|
128
|
-
const data = await report.tripReport(
|
|
129
|
-
new Date(Date.UTC(2022, 2, 4, 0, 0, 0, 0)),
|
|
130
|
-
new Date(Date.UTC(2022, 2, 4, 23, 59, 59, 0)),
|
|
131
|
-
userData)
|
|
132
|
-
|
|
133
|
-
assert.equal(data.length, 1)
|
|
134
|
-
const device = data[0].devices.find(d => d.device.id === 11437)
|
|
135
|
-
assert.equal(device.trips.length, 5) // Total Trips
|
|
136
|
-
assert.equal(device.totalDistance, 207353.2299999997) // Total Kms
|
|
137
|
-
}, 20000)
|
|
138
|
-
// eslint-disable-next-line no-undef
|
|
139
123
|
it('Trip by device with time period ', async () => {
|
|
140
124
|
const report = await getReports()
|
|
141
125
|
const userData = await report.getUserData()
|
|
@@ -233,7 +217,7 @@ describe('Test_Reports', function () {
|
|
|
233
217
|
assert.equal(data.length, 1)
|
|
234
218
|
assert.equal(data.length, 1)
|
|
235
219
|
const device = data[0].devices.find(d => d.device.id === 22326)
|
|
236
|
-
assert.equal(device.summary.distance,
|
|
220
|
+
assert.equal(device.summary.distance, 1183950.9299999475) // Total Kms
|
|
237
221
|
}, 30000)
|
|
238
222
|
// eslint-disable-next-line no-undef
|
|
239
223
|
it('KmsReport byDevice groupByDay', async () => {
|
|
@@ -292,24 +276,11 @@ describe('Test_Reports', function () {
|
|
|
292
276
|
assert.equal(data.length, 1)
|
|
293
277
|
const device = data[0].devices.find(d => d.device.id === 22326)
|
|
294
278
|
assert.equal(device.summary[0].startOdometer, 122502742.59)
|
|
295
|
-
assert.equal(device.summary[0].distance,
|
|
279
|
+
assert.equal(device.summary[0].distance, 1427562.359999925)
|
|
296
280
|
assert.equal(device.summary[0].startTime, '2022-01-01T13:35:47.000+0000')
|
|
297
281
|
assert.equal(device.summary[0].endTime, '2022-01-31T17:36:27.000+0000')
|
|
298
282
|
}, 80000)
|
|
299
283
|
// eslint-disable-next-line no-undef
|
|
300
|
-
it('Activity 2 by device', async () => {
|
|
301
|
-
const report = await getReports()
|
|
302
|
-
const userData = await report.getUserData()
|
|
303
|
-
userData.devices = userData.devices.filter(d => d.id === 11437)
|
|
304
|
-
const data = await report.activityReport(new Date(Date.UTC(2022, 2, 5, 0, 0, 0, 0)),
|
|
305
|
-
new Date(Date.UTC(2022, 2, 5, 23, 59, 59, 0)),
|
|
306
|
-
userData)
|
|
307
|
-
assert.equal(data.length, 1)
|
|
308
|
-
const device = data[0].devices.find(d => d.device.id === 11437)
|
|
309
|
-
assert.equal(device.summary[0].endTime, '2022-03-05T23:59:55.000+0000')
|
|
310
|
-
assert.equal(device.summary[0].distance, 232925.12000000034)
|
|
311
|
-
}, 40000)
|
|
312
|
-
// eslint-disable-next-line no-undef
|
|
313
284
|
it('Activity byDevice groupByDay', async () => {
|
|
314
285
|
const report = await getReports()
|
|
315
286
|
const userData = await report.getUserData()
|
package/src/util/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ const distance = require('@turf/distance')
|
|
|
7
7
|
exports.getTranslations = (userData) => {
|
|
8
8
|
const lang = this.getLanguage(userData)
|
|
9
9
|
if (!messages[lang]) {
|
|
10
|
-
console.warn('no lang found for', userData.user, userData.user.attributes.lang
|
|
10
|
+
console.warn('no lang found for', userData.user, userData.user.attributes.lang)
|
|
11
11
|
}
|
|
12
12
|
return messages[lang] ? messages[lang] : messages['en-GB']
|
|
13
13
|
}
|