fleetmap-reports 1.0.265 → 1.0.266
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/.idea/workspace.xml +12 -11
- package/package.json +1 -1
- package/src/activity-report.js +3 -3
- package/src/kms-report.js +2 -2
- package/src/speeding-report.js +1 -1
- package/src/trip-report.js +1 -1
package/.idea/workspace.xml
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
|
-
<list default="true" id="eb665c86-c893-4333-bd2a-721dc27980b9" name="Changes" comment="
|
|
4
|
+
<list default="true" id="eb665c86-c893-4333-bd2a-721dc27980b9" name="Changes" comment="Refactor trip and speeding reports">
|
|
5
5
|
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
|
|
6
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
7
|
-
<change beforePath="$PROJECT_DIR$/src/activity-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/activity-report.js" afterDir="false" />
|
|
8
6
|
<change beforePath="$PROJECT_DIR$/src/index.test.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.test.js" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/src/kms-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/kms-report.js" afterDir="false" />
|
|
10
|
-
<change beforePath="$PROJECT_DIR$/src/speeding-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/speeding-report.js" afterDir="false" />
|
|
11
|
-
<change beforePath="$PROJECT_DIR$/src/trip-report.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/trip-report.js" afterDir="false" />
|
|
12
|
-
<change beforePath="$PROJECT_DIR$/src/util/driver.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/util/driver.js" afterDir="false" />
|
|
13
|
-
<change beforePath="$PROJECT_DIR$/src/util/traccar.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/util/traccar.js" afterDir="false" />
|
|
14
|
-
<change beforePath="$PROJECT_DIR$/src/util/trips.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/util/trips.js" afterDir="false" />
|
|
15
7
|
</list>
|
|
16
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
17
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -229,6 +221,7 @@
|
|
|
229
221
|
<workItem from="1641321068227" duration="14805000" />
|
|
230
222
|
<workItem from="1641387675790" duration="32947000" />
|
|
231
223
|
<workItem from="1641509412324" duration="41000" />
|
|
224
|
+
<workItem from="1641510744190" duration="1404000" />
|
|
232
225
|
</task>
|
|
233
226
|
<task id="LOCAL-00001" summary="Fix getStyle">
|
|
234
227
|
<created>1636983717385</created>
|
|
@@ -384,7 +377,14 @@
|
|
|
384
377
|
<option name="project" value="LOCAL" />
|
|
385
378
|
<updated>1641348028566</updated>
|
|
386
379
|
</task>
|
|
387
|
-
<
|
|
380
|
+
<task id="LOCAL-00023" summary="Refactor trip and speeding reports">
|
|
381
|
+
<created>1641511586537</created>
|
|
382
|
+
<option name="number" value="00023" />
|
|
383
|
+
<option name="presentableId" value="LOCAL-00023" />
|
|
384
|
+
<option name="project" value="LOCAL" />
|
|
385
|
+
<updated>1641511586537</updated>
|
|
386
|
+
</task>
|
|
387
|
+
<option name="localTasksCounter" value="24" />
|
|
388
388
|
<servers />
|
|
389
389
|
</component>
|
|
390
390
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -424,6 +424,7 @@
|
|
|
424
424
|
<MESSAGE value="fix activity report by driver" />
|
|
425
425
|
<MESSAGE value="activity report by driver grouped by day" />
|
|
426
426
|
<MESSAGE value="fix kms-report by driver and fix activity report with time period" />
|
|
427
|
-
<
|
|
427
|
+
<MESSAGE value="Refactor trip and speeding reports" />
|
|
428
|
+
<option name="LAST_COMMIT_MESSAGE" value="Refactor trip and speeding reports" />
|
|
428
429
|
</component>
|
|
429
430
|
</project>
|
package/package.json
CHANGED
package/src/activity-report.js
CHANGED
|
@@ -214,7 +214,7 @@ function processDrivers(from, to, drivers, data) {
|
|
|
214
214
|
if(userData.groupByDay) {
|
|
215
215
|
const dates = getDates(from, to)
|
|
216
216
|
for(const date of dates){
|
|
217
|
-
if(userData.allWeek){
|
|
217
|
+
if(userData.allWeek || !userData.weekDays){
|
|
218
218
|
const fromByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0)
|
|
219
219
|
const toByDay = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59)
|
|
220
220
|
|
|
@@ -409,7 +409,7 @@ function exportActivityReportToPDF_Vehicle_GroupByDay(doc, translations, reportD
|
|
|
409
409
|
doc.text(group ? translations.report.group + ': ' + group.name : '', 150, space + 20)
|
|
410
410
|
doc.text(new Date(reportData.from).toLocaleString() + ' - ' + new Date(reportData.to).toLocaleString(), 20, space + 25)
|
|
411
411
|
|
|
412
|
-
if (!userData.allWeek) {
|
|
412
|
+
if (!userData.allWeek && userData.weekDays) {
|
|
413
413
|
doc.text((userData.weekDays.monday ? ' ' + translations.report.monday + ',' : '')
|
|
414
414
|
+ (userData.weekDays.tuesday ? ' ' + translations.report.tuesday + ',' : '')
|
|
415
415
|
+ (userData.weekDays.wednesday ? ' ' + translations.report.wednesday + ',' : '')
|
|
@@ -536,7 +536,7 @@ function exportActivityReportToPDF_Driver_GroupByDay(doc, translations, reportDa
|
|
|
536
536
|
doc.text(group ? translations.report.group + ': ' + group.name : '', 150, space + 20)
|
|
537
537
|
doc.text(new Date(reportData.from).toLocaleString() + ' - ' + new Date(reportData.to).toLocaleString(), 20, space + 25)
|
|
538
538
|
|
|
539
|
-
if (!userData.allWeek) {
|
|
539
|
+
if (!userData.allWeek && userData.weekDays) {
|
|
540
540
|
doc.text((userData.weekDays.monday ? ' ' + translations.report.monday + ',' : '')
|
|
541
541
|
+ (userData.weekDays.tuesday ? ' ' + translations.report.tuesday + ',' : '')
|
|
542
542
|
+ (userData.weekDays.wednesday ? ' ' + translations.report.wednesday + ',' : '')
|
package/src/kms-report.js
CHANGED
|
@@ -153,7 +153,7 @@ function processDevices(from, to, devices, route, trips) {
|
|
|
153
153
|
kms: 0
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
if(userData.allWeek){
|
|
156
|
+
if(userData.allWeek || !userData.weekDays){
|
|
157
157
|
day.kms = dayTrips.reduce((a, b) => a + b.distance, 0) || 0
|
|
158
158
|
} else {
|
|
159
159
|
if((currentDate.getDay() === 0 && userData.weekDays.sunday) ||
|
|
@@ -302,7 +302,7 @@ async function exportKmsReportToPDF(userData, reportData) {
|
|
|
302
302
|
doc.text(group ? translations.report.group + ': ' + group.name : '', 150, space + 20)
|
|
303
303
|
doc.text(new Date(reportData.from).toLocaleString() + ' - ' + new Date(reportData.to).toLocaleString(), 20, space + 25)
|
|
304
304
|
|
|
305
|
-
if(!userData.allWeek) {
|
|
305
|
+
if(!userData.allWeek && userData.weekDays) {
|
|
306
306
|
doc.text((userData.weekDays.monday ? ' ' + translations.report.monday + ',' : '')
|
|
307
307
|
+ (userData.weekDays.tuesday ? ' ' + translations.report.tuesday + ',' : '')
|
|
308
308
|
+ (userData.weekDays.wednesday ? ' ' + translations.report.wednesday + ',' : '')
|
package/src/speeding-report.js
CHANGED
|
@@ -365,7 +365,7 @@ async function exportSpeedingReportToPDF(userData, reportData) {
|
|
|
365
365
|
doc.text(group ? translations.report.group + ': ' + group.name : '', 150, space+20 )
|
|
366
366
|
doc.text(convertToLocaleString(d.from, lang, timezone) + ' - ' + convertToLocaleString(d.to, lang, timezone), 20, space+25 )
|
|
367
367
|
if (d.alerts[0] && !userData.byDriver) {
|
|
368
|
-
doc.text(translations.report.speedLimit + ": " + (userData.useVehicleSpeedLimit ? Math.round(d.alerts[0].attributes.speedLimit * 1.85200) : userData.customSpeed) + ' Km/h', 20, space + 30)
|
|
368
|
+
doc.text(translations.report.speedLimit + ": " + ((userData.useVehicleSpeedLimit || !userData.customSpeed) ? Math.round(d.alerts[0].attributes.speedLimit * 1.85200) : userData.customSpeed) + ' Km/h', 20, space + 30)
|
|
369
369
|
}
|
|
370
370
|
d.alerts.map(a => {
|
|
371
371
|
const temp = [
|
package/src/trip-report.js
CHANGED
|
@@ -247,7 +247,7 @@ async function exportTripReportToPDF(userData, reportData) {
|
|
|
247
247
|
doc.setFontSize(11)
|
|
248
248
|
doc.text(group ? translations.report.group + ': ' + group.name : '', 200, space+20 )
|
|
249
249
|
doc.text(convertToLocaleString(d.from, lang, timezone) + ' - ' + convertToLocaleString(d.to, lang, timezone), 20, space+25 )
|
|
250
|
-
if(!userData.allWeek) {
|
|
250
|
+
if(!userData.allWeek && userData.weekDays) {
|
|
251
251
|
doc.text((userData.weekDays.monday ? ' ' + translations.report.monday + ',' : '')
|
|
252
252
|
+ (userData.weekDays.tuesday ? ' ' + translations.report.tuesday + ',' : '')
|
|
253
253
|
+ (userData.weekDays.wednesday ? ' ' + translations.report.wednesday + ',' : '')
|