fleetmap-reports 2.0.103 → 2.0.105

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": "2.0.103",
3
+ "version": "2.0.105",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -106,11 +106,11 @@ async function exportDelayedStartReportToPDF (userData, reportData) {
106
106
  const timezone = userData.user.attributes.timezone
107
107
  const translations = getTranslations(userData)
108
108
  const lang = userData.user.attributes.lang || (isClientSide() && navigator.language)
109
- const reportDataRows = userData.byDriver ? reportData.drivers : reportData.devices
109
+ const reportDataRows = reportData.devices
110
110
 
111
111
  const headers = [
112
112
  translations.report.group,
113
- translations.report.name,
113
+ translations.report.vehicle,
114
114
  translations.report.driver,
115
115
  translations.report.day,
116
116
  translations.report.startDate,
@@ -132,7 +132,7 @@ async function exportDelayedStartReportToPDF (userData, reportData) {
132
132
  const group = userData.groups.find(g => row.groupId === g.id)
133
133
 
134
134
  const temp = [
135
- group,
135
+ group ? group.name : '',
136
136
  row.device,
137
137
  row.driver,
138
138
  row.weekDay,
@@ -169,7 +169,7 @@ async function exportDelayedStartReportToExcel (userData, reportData) {
169
169
 
170
170
  const headers = [
171
171
  { label: translations.report.group, value: 'group' },
172
- { label: translations.report.name, value: 'name' },
172
+ { label: translations.report.vehicle, value: 'name' },
173
173
  { label: translations.report.driver, value: 'driver' },
174
174
  { label: translations.report.day, value: 'day' },
175
175
  { label: translations.report.startDate, value: 'startDate' },
@@ -182,10 +182,8 @@ async function exportDelayedStartReportToExcel (userData, reportData) {
182
182
  if (reportDataRows) {
183
183
  reportDataRows.forEach(row => {
184
184
  const group = userData.groups.find(g => row.groupId === g.id)
185
-
186
- data = data.concat([{}])
187
185
  data = data.concat({
188
- group,
186
+ group: group ? group.name : '',
189
187
  name: row.device,
190
188
  driver: row.driver,
191
189
  day: row.weekDay,