VEH-53: Recording of Mileage/Economy against Fuellog entries



Issue Information

Issue Type: Informational
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: VehMan (VEH)
Resolution: Fixed (2014-01-12 13:24:57)
Affects Version: 1.0.1, 1.0.15,
Target version: 1.0.2,

Created: 2013-12-01 19:46:19
Time Spent Working


Description
Need to decide how Economy/Mileage should be attributed as there's a deviation between charts at the moment (see VEH-52).

Logically, it should be as follows

|Litres|Odometer|Miles gained|MPG|
|10|10|10|1|
|10|20|-|-|

As we haven't had a fill since the Odometer reading of 20, we don't know what the mileage/MPG from that fill is.

The way we're displaying in the fuellog is

|Litres|Odometer|Miles gained|MPG|
|10|10|-|-|
|10|20|10|1|

The Stats run, however, correctly attributes the miles (in this case 10) back to the previous fill.

It probably makes more sense to do it this way, though it will require some adjustments to the Fuellog generation module, the stats module etc.

Better to do it sooner than later, especially as will need to clear the stored Eco data from the Live API if the changes are made


Issue Links

Toggle State Changes

Activity


Having given it some thought, I think it's better to adjust the stats run as the calculation is made (and correct) as of the date of the next fill.
Looking at the stats run, it isn't attributing the fill back


$sql = "UPDATE Fuellog SET `Economy` = '$econ',`Stats`=0 WHERE `EntryID` = '\{$fill->EntryID\}'";


Need to check whether this issue is still present, or whether it's been fixed as part of another issue.

Setting to can't replicate for now.

btasker changed status from 'Open' to 'Resolved'
btasker added 'Cannot Reproduce' to resolution
Found the issue in the code
btasker removed 'Cannot Reproduce' from resolution
btasker changed status from 'Resolved' to 'Reopened'
VehMan_API_Charts_Maths::monthlyMileage was performing the creditback


$finalmileages[$lastmonth]['value'] = $finalmileages[$lastmonth]['value'] + ($min - $last[1]);


Now replaced with


$finalmileages[$d]['value'] = $finalmileages[$d]['value'] + ($min - $last[1]);
btasker changed status from 'Reopened' to 'Resolved'
btasker added 'Fixed' to resolution
btasker changed status from 'Resolved' to 'Closed'