fleetmap-reports 1.0.572 → 1.0.574

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/enGB.js CHANGED
@@ -198,6 +198,9 @@ module.exports = {
198
198
  date: 'Date',
199
199
  start: 'Start',
200
200
  end: 'End',
201
+ stopped: 'Stopped',
202
+ yes: 'Yes',
203
+ no: 'No',
201
204
  endAddress: 'Destination',
202
205
  tripTime: 'Duration',
203
206
  idleTime: 'Idle',
package/lang/esCL.js CHANGED
@@ -188,6 +188,9 @@ module.exports = {
188
188
  date: 'Fecha',
189
189
  start: 'Início',
190
190
  end: 'Fin',
191
+ stopped: 'Ha Parado',
192
+ yes: 'Sí',
193
+ no: 'No',
191
194
  endAddress: 'Destino',
192
195
  tripTime: 'Duración',
193
196
  idleTime: 'Ralenti',
package/lang/frFR.js ADDED
@@ -0,0 +1,292 @@
1
+ module.exports = {
2
+ route: {
3
+ map: 'Map',
4
+ dashboard: 'Dashboard',
5
+ reports: 'Reports',
6
+ report: 'Report',
7
+ report_trip_title: 'Trip Report',
8
+ report_location_title: 'Location Report',
9
+ report_zone_crossing: 'Zone Report',
10
+ report_speeding: 'Relatório de Excessos de Velocidade',
11
+ report_speeding_beta: 'Relatório de Excessos de Velocidade BETA',
12
+ report_tolls: 'Relatório de Portagens',
13
+ settings: 'Settings',
14
+ duration: 'Duration'
15
+ },
16
+ map: {
17
+ geofence_create_title: 'New geofence',
18
+ geofence_create_name: 'Please enter the name of this geofence...',
19
+ geofence_created: 'Geofence created sucessfully!',
20
+ geofence_create_canceled: 'Input canceled',
21
+ poi_create_title: 'New POI',
22
+ poi_create_name: 'Please enter the name of this POI...',
23
+ poi_created: 'POI created sucessfully!',
24
+ poi_create_canceled: 'Input canceled',
25
+ create_confirm: 'OK',
26
+ create_cancel: 'Cancel',
27
+ loading: 'Loading',
28
+ totalDistance: 'Distância total'
29
+ },
30
+ vehicleList: {
31
+ title: 'Vehicle',
32
+ search: 'Search...',
33
+ column_name: 'Name',
34
+ column_speed: 'Km/h',
35
+ column_lastUpdate: 'Last update'
36
+ },
37
+ vehicleTable: {
38
+ immobilize: 'Immobilize',
39
+ de_immobilize: 'De-Immobilize',
40
+ send_immobilization: 'Send immobilization command?',
41
+ send_de_immobilization: 'Send de-immobilization command?',
42
+ all_vehicles: 'All',
43
+ moving_vehicles: 'Moving',
44
+ idle_vehicles: 'Idle',
45
+ stopped_vehicles: 'Stopped',
46
+ disconnected_vehicles: 'Disconnected'
47
+ },
48
+ vehicleDetail: {
49
+ show_route: 'Show route'
50
+ },
51
+ poiTable: {
52
+ showPOIs: 'Show POIs',
53
+ edit_poi: 'Edit',
54
+ delete_poi: 'Delete'
55
+ },
56
+ dashboard: {
57
+ startdate: 'Start date',
58
+ enddate: 'End Date',
59
+ period_lastweek: 'Last week',
60
+ period_lastmonth: 'Last month',
61
+ period_last3month: 'Last 3 months'
62
+ },
63
+ navbar: {
64
+ profile: 'Profile',
65
+ notifications: 'Notifications',
66
+ settings: 'Settings',
67
+ logout: 'Log Out'
68
+ },
69
+ login: {
70
+ login_user: 'Email',
71
+ login_password: 'Password',
72
+ login_button: 'Login',
73
+ login_password_warn: 'The password can not be less than 6 digits'
74
+ },
75
+ profile: {
76
+ user_account: 'Account',
77
+ user_name: 'Name',
78
+ user_email: 'E-mail',
79
+ user_password: 'Password',
80
+ user_phone: 'Phone',
81
+ user_language: 'Language',
82
+ user_timezone: 'Timezone',
83
+ user_update_button: 'Update',
84
+ user_updated: 'User information has been updated successfully.',
85
+ user_name_required: 'Name field is required',
86
+ user_email_required: 'Please input a valid email',
87
+ user_password_lengh: 'The password can not be less than 6 digits'
88
+ },
89
+ settings: {
90
+ map: 'Map',
91
+ vehicles: 'Vehicles',
92
+ title: 'Settings',
93
+ route_match: 'Route match',
94
+ alerts: 'Alerts',
95
+ alerts_type: 'Type',
96
+ alerts_notificators: 'Notificators',
97
+ alert_ignitionOff: 'Ignition Off',
98
+ alert_ignitionOn: 'Ignition On',
99
+ alert_geofenceEnter: 'Geofence Enter',
100
+ alert_geofenceExit: 'Geofence Exit',
101
+ alert_deviceOverspeed: 'Device Overspeed',
102
+ alert_deleted: 'Alert has been deleted',
103
+ alert_delete_info: 'Do you want to delete the alert ',
104
+ alert_delete_title: 'Delete Alert',
105
+ alert_edit_confirm: 'Confirm',
106
+ alert_edit_cancel: 'Cancel',
107
+ alert_created: 'Alert created sucessfully!',
108
+ alert_updated: 'Alert updated sucessfully!',
109
+ alert_add: 'Add Alert',
110
+ alert_edit: 'Edit Alert',
111
+ alert_delete: 'Delete Alert',
112
+ alert_overspeed_warning: 'Vehicle without defined top speed',
113
+ alert_geofences_warning: 'Vehicle without associated geofences',
114
+ alert_associate_geofences: 'Associate Geofences',
115
+ alert_form_type: 'Type:',
116
+ alert_form_type_placeholder: 'Select alert type',
117
+ alert_form_vehicles: 'Vehicles:',
118
+ alert_form_geofences: 'Geofences:',
119
+ alert_form_all_vehicles: 'All vehicles',
120
+ alert_form_vehicles_placeholder: 'Select vehicles',
121
+ alert_form_notificator_web: 'Web',
122
+ alert_form_notificator_email: 'E-mail',
123
+ alert_form_notificator_sms: 'SMS',
124
+ alert_form_confirm: 'Save',
125
+ alert_form_cancel: 'Cancel',
126
+ alert_form_geofences_placeholder: 'Select geofences',
127
+ vehicle_edit: 'Edit Vehicle',
128
+ vehicle_name: 'Name',
129
+ vehicle_licenseplate: 'License Plate',
130
+ vehicle_model: 'Model',
131
+ vehicle_speed_limit: 'Speed Limit',
132
+ vehicle_form_cancel: 'Cancel',
133
+ vehicle_form_confirm: 'Save',
134
+ vehicle_form_name: 'Name',
135
+ vehicle_form_model: 'Model',
136
+ vehicle_form_speed_limit: 'Speed Limit (Km/h)',
137
+ vehicle_updated: 'Vehicle updated sucessfully!'
138
+ },
139
+ geofence: {
140
+ showGeofences: 'Show Geofences',
141
+ geofence_name: 'Name',
142
+ geofence_edit: 'Edit',
143
+ geofence_delete: 'Delete',
144
+ geofence_deleted: 'Geofence has been deleted',
145
+ geofence_delete_info: 'Do you want to delete geofence ',
146
+ geofence_delete_title: 'Delete Geofence',
147
+ geofence_edit_title: 'Edit Geofence',
148
+ geofence_edit_name: 'Please enter the name of this geofence...',
149
+ geofence_edit_confirm: 'Confirm',
150
+ geofence_edit_cancel: 'Cancel',
151
+ geofence_edit_canceled: 'Edit canceled',
152
+ geofence_edited: 'Geofence edited sucessfully!',
153
+ poi_delete_info: 'Do you want to delete POI ',
154
+ poi_delete_title: 'Delete POI',
155
+ poi_edited: 'POI edited sucessfully!',
156
+ poi_deleted: 'POI has been deleted',
157
+ poi_edit_title: 'Edit POI',
158
+ poi_edit_name: 'Please enter the name of this POI...',
159
+ searchGeofence: 'Search geofence',
160
+ edit_geofence: 'Edit',
161
+ delete_geofence: 'Delete'
162
+ },
163
+ report: {
164
+ closed: 'Door Closed',
165
+ opened: 'Door Opened',
166
+ sun: 'Sun',
167
+ rain: 'Rain',
168
+ temperature: 'Temperatura',
169
+ select_vehicles: 'Select vehicles',
170
+ select_vehicles_placeholder: 'Vehicles',
171
+ select_geofences: 'Select geofences',
172
+ select_geofences_placeholder: 'Geofences',
173
+ select_period: 'Select period',
174
+ period: 'Period',
175
+ date_start: 'Start date',
176
+ date_end: 'End date',
177
+ generate_report: 'Generate report',
178
+ validate_period: 'Por favor seleccione o período',
179
+ user: 'User',
180
+ titleTripReport: 'Trip Report',
181
+ titleLocationReport: 'Locations Report',
182
+ titleSpeedingReport: 'Overspeed Report',
183
+ titleZoneReport: 'Zone Report',
184
+ titleRefuelReport: 'Refueling Report',
185
+ titleFuelConsumptionReport: 'Fuel Consumption Report',
186
+ titleFuelDropReport: 'Fuel Drop Report',
187
+ titleEventsReport: 'Events Report',
188
+ titleActivityReport: 'Activity Report',
189
+ titleKmsReport: 'Kms Report',
190
+ titleIdleReport: 'Idle Report',
191
+ titleMachinesReport: 'Machines Report',
192
+ from: 'From',
193
+ to: 'to',
194
+ headerStartAddress: 'Start address',
195
+ headerDistance: 'Distance',
196
+ headerDrivingTime: 'Driving Time',
197
+ headerMaxSpeed: 'Max Speed',
198
+ date: 'Date',
199
+ start: 'Start',
200
+ end: 'End',
201
+ stopped: 'Stopped',
202
+ yes: 'Yes',
203
+ no: 'No',
204
+ endAddress: 'Destination',
205
+ tripTime: 'Duration',
206
+ idleTime: 'Idle',
207
+ stopTime: 'Stop',
208
+ distance: 'Distance',
209
+ speed: 'Speed',
210
+ roadSpeedLimit: 'Road Speed Limit',
211
+ overspeed: 'Alert On',
212
+ avgSpeed: 'Avg Speed',
213
+ maxSpeed: 'Max Speed',
214
+ driver: 'Driver',
215
+ group: 'Group',
216
+ address: 'Address',
217
+ ignition: 'Ignition',
218
+ ignitionOn: 'On',
219
+ ignitionOff: 'Off',
220
+ enter: 'Enter',
221
+ exit: 'Exit',
222
+ geofence: 'Geofence',
223
+ duration: 'Duration',
224
+ vehicles: 'Vehicles',
225
+ vehicle: 'Vehicle',
226
+ licensePlate: 'License Plate',
227
+ consumption: 'Consumption (L)',
228
+ avg_consumption: 'Avg. Consumption (L/100)',
229
+ avg_consumption_by_liters: 'Avg. Consumption (Kms/L)',
230
+ odometer: 'Odometer',
231
+ startOdometer: 'Start (Km)',
232
+ endOdometer: 'End (Km)',
233
+ spentFuel: 'Spent Fuel',
234
+ engineHours: 'Use (H:m)',
235
+ totalEngineHours: 'Total Use (H:m)',
236
+ driverHours: 'Driving Time (H:m)',
237
+ refueling: 'Refueling',
238
+ fueldrop: 'Fuel Drop (L)',
239
+ totalRefueled: 'Total Refueled',
240
+ totalFuelDrops: 'Total Fuel Drops',
241
+ totalFuelDropLiters: 'Total Fuel Lost',
242
+ speedLimit: 'Speed Limit',
243
+ eventType: 'Event',
244
+ info: 'Information',
245
+ event_ignitionOff: 'Ignition Off',
246
+ event_ignitionOn: 'Ignition On',
247
+ event_deviceOverspeed: 'Device Overspeed',
248
+ event_geofenceEnter: 'Geofence Enter',
249
+ event_geofenceExit: 'Geofence Exit',
250
+ event_deviceFuelDrop: 'Fuel Drop',
251
+ event_driverChanged: 'Driver Changed',
252
+ event_sos: 'SOS',
253
+ event_powerOn: 'Power TakeOff',
254
+ event_powerCute: 'Power Cut',
255
+ monday: 'Monday',
256
+ tuesday: 'Tuesday',
257
+ wednesday: 'Wednesday',
258
+ thursday: 'Thursday',
259
+ friday: 'Friday',
260
+ saturday: 'Saturday',
261
+ sunday: 'Sunday',
262
+ weekDay: 'Week Day',
263
+ unsubscribeTripReport: 'If you no longer wish to receive these emails, please go to %url% and remove the option "Trip report" in the settings in the "Reports" section.',
264
+ unsubscribeLocationsReport: 'If you no longer wish to receive these emails, please go to %url% and remove the option "Locations report" in the settings in the "Reports" section.',
265
+ unsubscribeSpeedingReport: 'If you no longer wish to receive these emails, please go to %url% and remove the option "Overspeed report" in the settings in the "Reports" section.',
266
+ unsubscribeZoneReport: 'If you no longer wish to receive these emails, please go to %url% and remove the option "Zone report" in the settings in the "Reports" section.',
267
+ unsubscribeRefuelingReport: 'If you no longer wish to receive these emails, please go to %url% and remove the option "Refueling report" in the settings in the "Reports" section.',
268
+ unsubscribeFuelDropReport: 'If you no longer wish to receive these emails, please go to %url% and remove the option "Fuel drop report" in the settings in the "Reports" section.'
269
+ },
270
+ layout: {
271
+ deviceOnline: 'Device Online',
272
+ deviceMoving: 'Device Moving',
273
+ deviceStopped: 'Device Stopped',
274
+ ignitionOff: 'Ignition Off',
275
+ ignitionOn: 'Ignition On',
276
+ deviceOverspeed: 'Device Overspeed',
277
+ geofenceEnter: 'Geofence Enter',
278
+ geofenceExit: 'Geofence Exit',
279
+ deviceFuelDrop: 'Fuel Drop',
280
+ driverChanged: 'Driver Changed',
281
+ test: 'Test Notification',
282
+ sos: 'Panic',
283
+ powerOn: 'Power Take-Off',
284
+ device: 'Device',
285
+ time: 'Time',
286
+ address: 'Address',
287
+ driver: 'Driver',
288
+ group: 'Group',
289
+ in: 'in',
290
+ fuelDropInfo: 'Fuel drop greater than '
291
+ }
292
+ }
package/lang/ptBR.js CHANGED
@@ -190,6 +190,9 @@ module.exports = {
190
190
  date: 'Data',
191
191
  start: 'Início',
192
192
  end: 'Fim',
193
+ stopped: 'Parou',
194
+ yes: 'Sim',
195
+ no: 'Não',
193
196
  endAddress: 'Destino',
194
197
  tripTime: 'Duração',
195
198
  idleTime: 'Ralenti',
package/lang/ptPT.js CHANGED
@@ -196,6 +196,9 @@ module.exports = {
196
196
  date: 'Data',
197
197
  start: 'Início',
198
198
  end: 'Fim',
199
+ stopped: 'Parou',
200
+ yes: 'Sim',
201
+ no: 'Não',
199
202
  endAddress: 'Destino',
200
203
  tripTime: 'Duração',
201
204
  idleTime: 'Ralenti',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.572",
3
+ "version": "1.0.574",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -46,7 +46,7 @@ async function createZoneReport (from, to, userData, traccar) {
46
46
  devices.sort((a, b) => (a.name > b.name) ? 1 : -1)
47
47
 
48
48
  if (data.length > 0) {
49
- groupData.devices = await processDevices(from, to, devices, userData.drivers, userData.geofences, data)
49
+ groupData.devices = await processDevices(from, to, devices, userData, { alerts: data })
50
50
  reportData.push(groupData)
51
51
  }
52
52
  }
@@ -72,7 +72,7 @@ async function createZoneReport (from, to, userData, traccar) {
72
72
  console.log('Geofence Enter/Exit Alerts:' + alerts.length)
73
73
 
74
74
  if (alerts.length) {
75
- allData.devices.push(...await processDevices(from, to, devices, userData.drivers, userData.geofences, { alerts, route: data.route }, traccar))
75
+ allData.devices.push(...await processDevices(from, to, devices, userData, { alerts, route: data.route }))
76
76
  }
77
77
  deviceCount = deviceCount + slice.length
78
78
  }
@@ -82,31 +82,28 @@ async function createZoneReport (from, to, userData, traccar) {
82
82
  return reportData
83
83
  }
84
84
 
85
- async function processDevices (from, to, devices, drivers, geofences, data) {
85
+ async function processDevices (from, to, devices, userData, data) {
86
86
  const devicesResult = []
87
87
 
88
88
  for (const d of devices) {
89
89
  const alerts = data.alerts.filter(t => t.deviceId === d.id)
90
90
  if (alerts.length > 0) {
91
- // const response = await traccar.reports.reportsRouteGet(from, to, [d.id])
92
-
93
91
  const zoneInOutData = []
94
92
  const zoneInData = {}
95
- // const positions = response.data
96
93
 
97
94
  alerts.forEach(a => {
98
- // a.position = positions.find(p => p.id === a.positionId)
99
95
  if (a.position) {
100
96
  if (a.type === 'geofenceEnter') {
101
- const driver = drivers.find(d => a.position.attributes && d.uniqueId === a.position.attributes.driverUniqueId)
97
+ const driver = userData.drivers.find(d => a.position.attributes && d.uniqueId === a.position.attributes.driverUniqueId)
102
98
  a.position.driverName = driver ? driver.name : ''
103
99
  zoneInData[a.geofenceId] = a
104
100
  } else if (a.type === 'geofenceExit') {
105
- const geofence = geofences.find(g => g.id === a.geofenceId)
101
+ const geofence = userData.geofences.find(g => g.id === a.geofenceId)
106
102
  if (zoneInData[a.geofenceId]) {
107
103
  const totalInTime = moment(a.position.fixTime).diff(moment(zoneInData[a.geofenceId].position.fixTime), 'seconds')
108
- const route = data.route.filter(p => p.fixTime >= zoneInData[a.geofenceId].position.fixTime &&
109
- p.fixTime <= a.position.fixTime)
104
+ const route = data.route.filter(p => new Date(p.fixTime).getTime() >= new Date(zoneInData[a.geofenceId].position.fixTime).getTime() &&
105
+ new Date(p.fixTime).getTime() <= new Date(a.position.fixTime).getTime())
106
+ console.log(route)
110
107
  if (geofence) {
111
108
  zoneInOutData.push({
112
109
  inTime: zoneInData[a.geofenceId].position,
@@ -133,7 +130,7 @@ async function processDevices (from, to, devices, drivers, geofences, data) {
133
130
 
134
131
  for (const i in zoneInData) {
135
132
  if (zoneInData[i]) {
136
- const geofence = geofences.find(g => g.id === zoneInData[i].geofenceId)
133
+ const geofence = userData.geofences.find(g => g.id === zoneInData[i].geofenceId)
137
134
  if (geofence) {
138
135
  zoneInOutData.push({
139
136
  inTime: zoneInData[i].position,
@@ -144,12 +141,14 @@ async function processDevices (from, to, devices, drivers, geofences, data) {
144
141
  }
145
142
  }
146
143
 
147
- if (zoneInOutData.length > 0) {
144
+ const result = userData.onlyWithStop ? zoneInOutData.filter(d => d.stopped) : zoneInOutData
145
+
146
+ if (result.length > 0) {
148
147
  devicesResult.push({
149
148
  device: d,
150
149
  from,
151
150
  to,
152
- geofences: zoneInOutData
151
+ geofences: result
153
152
  })
154
153
  }
155
154
  }
@@ -237,6 +236,7 @@ async function exportZoneReportToPDF (userData, reportData) {
237
236
  const headers = [
238
237
  translations.report.enter,
239
238
  translations.report.exit,
239
+ translations.report.stopped,
240
240
  translations.report.duration,
241
241
  translations.report.geofence,
242
242
  translations.report.driver
@@ -268,6 +268,7 @@ async function exportZoneReportToPDF (userData, reportData) {
268
268
  const temp = [
269
269
  geofenceEnter(userData.user, a),
270
270
  geofenceExit(userData.user, a),
271
+ a.stopped ? translations.report.yes : translations.report.no,
271
272
  a.totalTime ? convertMS(a.totalTime * 1000, true) : '',
272
273
  a.geofenceName,
273
274
  a.driverName
@@ -321,6 +322,7 @@ function exportZoneReportToExcel (userData, reportData) {
321
322
  { label: translations.report.vehicle, value: 'name' },
322
323
  { label: translations.report.enter, value: 'enter' },
323
324
  { label: translations.report.exit, value: 'exit' },
325
+ { label: translations.report.stopped, value: 'stopped' },
324
326
  { label: translations.report.duration, value: 'duration' },
325
327
  { label: translations.report.geofence, value: 'zone' },
326
328
  { label: translations.report.driver, value: 'driver' }
@@ -334,6 +336,7 @@ function exportZoneReportToExcel (userData, reportData) {
334
336
  name: d.device.name,
335
337
  enter: geofenceEnter(userData.user, a),
336
338
  exit: geofenceExit(userData.user, a),
339
+ stopped: a.stopped ? translations.report.yes : translations.report.no,
337
340
  duration: a.totalTime ? convertMS(a.totalTime * 1000, true) : '',
338
341
  zone: a.geofenceName,
339
342
  driver: a.driverName