########################################################################################## VEH-53: Recording of Mileage/Economy against Fuellog entries ########################################################################################## Issue Type: Informational ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Fixed (2014-01-12 13:24:57) Project: VehMan (VEH) Reported By: btasker Assigned To: btasker Affected Versions: - 1.0.1 - 1.0.15 Targeted for fix in version: - 1.0.2 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue 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 Relations ================ - relates to VEH-52: Fuellog numbers don't add up ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2014-01-12 11:45:58 btasker ----------------------------------------------------------------------------------------- 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. ----------------------------------------------------------------------------------------- 2014-01-12 11:57:48 btasker ----------------------------------------------------------------------------------------- Looking at the stats run, it isn't attributing the fill back -- BEGIN QUOTE -- $sql = "UPDATE Fuellog SET `Economy` = '$econ',`Stats`=0 WHERE `EntryID` = '\{$fill->EntryID\}'"; -- END QUOTE -- 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. ----------------------------------------------------------------------------------------- 2014-01-12 11:57:55 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'Resolved' ----------------------------------------------------------------------------------------- 2014-01-12 11:57:55 ----------------------------------------------------------------------------------------- btasker added 'Cannot Reproduce' to resolution ----------------------------------------------------------------------------------------- 2014-01-12 13:23:38 btasker ----------------------------------------------------------------------------------------- Found the issue in the code ----------------------------------------------------------------------------------------- 2014-01-12 13:23:38 ----------------------------------------------------------------------------------------- btasker removed 'Cannot Reproduce' from resolution ----------------------------------------------------------------------------------------- 2014-01-12 13:23:38 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Reopened' ----------------------------------------------------------------------------------------- 2014-01-12 13:24:51 btasker ----------------------------------------------------------------------------------------- VehMan_API_Charts_Maths::monthlyMileage was performing the creditback -- BEGIN QUOTE -- $finalmileages[$lastmonth]['value'] = $finalmileages[$lastmonth]['value'] + ($min - $last[1]); -- END QUOTE -- Now replaced with -- BEGIN QUOTE -- $finalmileages[$d]['value'] = $finalmileages[$d]['value'] + ($min - $last[1]); -- END QUOTE -- ----------------------------------------------------------------------------------------- 2014-01-12 13:24:57 ----------------------------------------------------------------------------------------- btasker changed status from 'Reopened' to 'Resolved' ----------------------------------------------------------------------------------------- 2014-01-12 13:24:57 ----------------------------------------------------------------------------------------- btasker added 'Fixed' to resolution ----------------------------------------------------------------------------------------- 2015-04-23 01:31:12 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Closed'