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

Cost per day calculation wrong #824

Closed
spcqike opened this issue Jan 24, 2025 · 4 comments
Closed

Cost per day calculation wrong #824

spcqike opened this issue Jan 24, 2025 · 4 comments
Assignees
Labels
bug Something isn't working pending release fix in place, pending release

Comments

@spcqike
Copy link

spcqike commented Jan 24, 2025

i don't know if its a bug or by design, but cost per day doesn't care about filtered data

in my case for ~6.5years
total
Image

if i filter for a single year, it still calculates based on 6.5 years

Image

i would have expected a cost per day of 3.30€, as 1208.95/365.25 is.

@hargata hargata self-assigned this Jan 24, 2025
@hargata hargata added the bug Something isn't working label Jan 24, 2025
@hargata hargata added the pending release fix in place, pending release label Jan 24, 2025
@hargata
Copy link
Owner

hargata commented Jan 24, 2025

This will be fixed next release, we also added some additional logic to the number of days.

  • If "All Time" is selected, then it will retrieve the total number of days of ownership and run the calculations based on that.

  • If any year is selected, then it will first check if the vehicle has a sold date.

    • If there is a sold date and its in the same year selected, it will calculate the day of year of sold date, so if the vehicle is sold on 01/14/2024 and the year selected in 2024, then the number of days used for calculation is 14 days.
    • If there is no sold date or the sold date year is not the same as the year selected, then it will divide by 365 for non-leap years and 366 days for leap years.

@spcqike
Copy link
Author

spcqike commented Jan 24, 2025

Great. Thank you very much

If any year is selected, then it will first check if the vehicle has a sold date.

Any chance to also use the purchase date (or first date of odometer reading or fuel up) for the very first year? (:

@hargata
Copy link
Owner

hargata commented Jan 24, 2025

@spcqike yeap, just tested this.

I have a vehicle that is purchased on 05/28/2023 and sold on 01/07/2024

When "All Time" is selected, it gives me 590 days of ownership.

Image

When 2023(Purchase Year) is selected, it gives me 218 days of ownership.

Image

When 2025(Sold Year) is selected, it gives me 6 days of ownership.

Image

When 2024 is selected, since it's a leap year, it gives me 366 days of ownership.

Image

@hargata
Copy link
Owner

hargata commented Feb 3, 2025

Released

@hargata hargata closed this as completed Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending release fix in place, pending release
Projects
None yet
Development

No branches or pull requests

2 participants