fleetmap-reports 1.0.941 → 1.0.942
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 +1 -1
- package/src/kms-report.js +0 -1
- package/src/util/trips.js +5 -6
package/package.json
CHANGED
package/src/kms-report.js
CHANGED
|
@@ -173,7 +173,6 @@ async function processDevices (from, to, devices, data, userData, traccarInstanc
|
|
|
173
173
|
const trips = deviceTrips.filter(t => userData.allWeek || !userData.weekDays || isInsideTimetable(t, userData) || isPartialInsideTimetable(t, userData, deviceRoute))
|
|
174
174
|
|
|
175
175
|
if (userData.groupByDay) {
|
|
176
|
-
console.log('process device groupByDay')
|
|
177
176
|
if (trips.length > 0) {
|
|
178
177
|
const trips = deviceTrips.filter(t => userData.allWeek || !userData.weekDays || isInsideTimetable(t, userData) || isPartialInsideTimetable(t, userData, deviceRoute))
|
|
179
178
|
const dates = getDates(from, to, userData.user.attributes.timezone || getUserPartner(userData.user).timezone)
|
package/src/util/trips.js
CHANGED
|
@@ -36,12 +36,11 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
|
|
|
36
36
|
const tripStart = new Date(t.startTime)
|
|
37
37
|
const tripEnd = new Date(t.endTime)
|
|
38
38
|
|
|
39
|
-
console.log('calculatePartialTrip', tripStart, tripEnd)
|
|
40
|
-
|
|
39
|
+
console.log('calculatePartialTrip', tripStart, tripEnd, endDate, startDate)
|
|
41
40
|
if (startDate.getTime() > endDate.getTime()) {
|
|
42
41
|
if (tripStart.getTime() < endDate.getTime() &&
|
|
43
42
|
tripEnd.getTime() > endDate.getTime()) {
|
|
44
|
-
|
|
43
|
+
console.log('Trip starts inside time period and ends outside time period', route, device)
|
|
45
44
|
if (!route && device) {
|
|
46
45
|
const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
|
|
47
46
|
route = allInOneData.route
|
|
@@ -55,7 +54,7 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
|
|
|
55
54
|
|
|
56
55
|
if (tripStart.getTime() < startDate.getTime() &&
|
|
57
56
|
new Date(t.endTime).getTime() > startDate.getTime()) {
|
|
58
|
-
|
|
57
|
+
console.log('Trip starts outside time period and ends inside time period', route, device)
|
|
59
58
|
if (!route && device) {
|
|
60
59
|
const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
|
|
61
60
|
route = allInOneData.route
|
|
@@ -69,7 +68,7 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
|
|
|
69
68
|
} else {
|
|
70
69
|
if (tripStart.getTime() < startDate.getTime() &&
|
|
71
70
|
tripEnd.getTime() > startDate.getTime()) {
|
|
72
|
-
|
|
71
|
+
console.log('Trip starts outside time period and ends inside time period', route, device)
|
|
73
72
|
if (!route && device) {
|
|
74
73
|
const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
|
|
75
74
|
route = allInOneData.route
|
|
@@ -83,7 +82,7 @@ async function calculatePartialTrip (device, startDate, endDate, route, t, tracc
|
|
|
83
82
|
|
|
84
83
|
if (tripStart.getTime() < endDate.getTime() &&
|
|
85
84
|
tripEnd.getTime() > endDate.getTime()) {
|
|
86
|
-
|
|
85
|
+
console.log('Trip starts inside time period and ends outside time period', route, device)
|
|
87
86
|
if (!route && device) {
|
|
88
87
|
const allInOneData = await traccarHelper.getAllInOne(traccarInstance, startDate, endDate, [device], true, false, false, false, undefined, undefined, 5, 1, undefined, true)
|
|
89
88
|
route = allInOneData.route
|