Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get millage report between 7:00am - 7:00pm during a month, possible? #1223

Open
quantumapps0 opened this issue May 13, 2019 · 4 comments
Open

Comments

@quantumapps0
Copy link

Dear Sir,

Thank you for your services.
I would like to get a report for vehicles for a period of the month but only between 7:00 am - 7:00 pm (19:00). Unfortunately, with the current version, I'm not able to do that.
Is there any solution for that, is there any query I can run on MySQL that calculates for me this? Please, anything would be helpful as I urgently need this.

Kind regards,

@vitalidze
Copy link
Owner

Not sure why you need it and why the report for a month does not work. I don't know an SQL query to run it because it needs to calculate distance between positions loaded from DB. In theory you can run 30/31 reports and then combine them somehow. You can do it via the /traccar/report endpoint by supplying there a JSON with report parameters. I cannot quickly give you an exact structure, but you can definitely reverse engineer it in your web browser console if you run a report for the desired period of time just once.

@quantumapps0
Copy link
Author

Dear Vitalidze,

The reason our working time is 7:00 - 19:00, after that drivers brig their vehicles to home. Since I'm providing them fuel based on millage detail. I want to filter out only working hours between this period only because of the vehicles used after working time for personal uses which is not my responsibility.
So, now I have to run 30/31 reports and Sum them per each vehicle which takes a lot of time because the number of vehicles exceeds 100.

If in any way this is possible, I'm ready.
Thanks for your help.

@vitalidze
Copy link
Owner

As I said you can run these 30/31 reports programmatically for all your vehicles and then process them with some application. This is the only doable way without changing the Traccar code.

@quantumapps0
Copy link
Author

quantumapps0 commented May 13, 2019

Let's leave the traccar code, I only need a query to calculate the millage between a period. I'm familiar to MySQL and PHP and HTML, I can create a view and get my report also I can implement it in an interface.
But all I need an algorithm or a QUERY to calculate the millage inside MySQL.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants