fleetmap-reports 1.0.599 → 1.0.601

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.599",
3
+ "version": "1.0.601",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -98,7 +98,7 @@ async function exportStopReportToPDF (userData, reportData) {
98
98
  translations.report.end,
99
99
  translations.report.address,
100
100
  translations.report.idleTime,
101
- translations.report.stopTime
101
+ translations.report.event_ignitionOff
102
102
  ]
103
103
 
104
104
  if (stopsData) {
@@ -128,16 +128,16 @@ async function exportStopReportToPDF (userData, reportData) {
128
128
  getStopStart(userData.user, a),
129
129
  getStopEnd(userData.user, a),
130
130
  a.endPOIName || a.address,
131
- convertMS(a.engineHours),
132
- convertMS(a.stopDuration)
131
+ convertMS(a.engineHours, true),
132
+ convertMS(a.stopDuration, true)
133
133
  ])
134
134
  })
135
135
 
136
136
  const footValues = [
137
137
  'Total:' + d.stops.length,
138
138
  '', '', '',
139
- convertMS(d.stops.reduce((a, b) => a + b.engineHours, 0)),
140
- convertMS(d.stops.reduce((a, b) => a + b.stopDuration, 0))]
139
+ convertMS(d.stops.reduce((a, b) => a + b.engineHours, 0), true),
140
+ convertMS(d.stops.reduce((a, b) => a + b.stopDuration, 0), true)]
141
141
 
142
142
  const style = getStyle(getUserPartner(userData.user))
143
143
  addTable(doc,
@@ -168,7 +168,7 @@ function exportStopReportToExcel (userData, reportData) {
168
168
  { label: translations.report.end, value: 'end' },
169
169
  { label: translations.report.address, value: 'address' },
170
170
  { label: translations.report.idleTime, value: 'idleTime' },
171
- { label: translations.report.stopTime, value: 'stopTime' }
171
+ { label: translations.report.event_ignitionOff, value: 'stopTime' }
172
172
  ]
173
173
 
174
174
  let data = []
@@ -182,15 +182,15 @@ function exportStopReportToExcel (userData, reportData) {
182
182
  start: getStopStart(userData.user, a),
183
183
  end: getStopEnd(userData.user, a),
184
184
  address: a.endPOIName || a.address,
185
- idleTime: convertMS(a.engineHours),
186
- stopTime: convertMS(a.stopDuration)
185
+ idleTime: convertMS(a.engineHours, true),
186
+ stopTime: convertMS(a.stopDuration, true)
187
187
  }
188
188
  }))
189
189
  // Totals
190
190
  data = data.concat([{
191
191
  name: d.stops.length,
192
- idleTime: convertMS(d.stops.reduce((a, b) => a + b.engineHours, 0)),
193
- stopTime: convertMS(d.stops.reduce((a, b) => a + b.stopDuration, 0))
192
+ idleTime: convertMS(d.stops.reduce((a, b) => a + b.engineHours, 0), true),
193
+ stopTime: convertMS(d.stops.reduce((a, b) => a + b.stopDuration, 0), true)
194
194
  }])
195
195
  data = data.concat([{}])
196
196
  })
package/src/util/utils.js CHANGED
@@ -18,7 +18,7 @@ exports.getLanguage = (userData) => {
18
18
 
19
19
  function convertMS (duration, withSeconds) {
20
20
  if (!duration || duration < 0) {
21
- return '00:00'
21
+ return withSeconds ? '00:00:00' : '00:00'
22
22
  }
23
23
 
24
24
  const ms = duration % 1000