########################################################################################## VEH-19: Fuel Stats Generation ########################################################################################## Issue Type: Sub-task ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2013-11-02 16:45:38) Project: VehMan (VEH) Reported By: btasker Assigned To: btasker Child of: VEH-17 - Stats Submodule Components: - Fuel - Statistics Targeted for fix in version: - 1.0.2 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Need to build support for generating fuel stats. To begin with want to capture - Monthly Mileage - Monthly Fuel (Litres) purchase - Monthly Garage Use (So, 1 fill at Tesco, 3 at Shell) - Monthly Fuel Cost - Monthly fill count - Monthly average Economy - Monthly Avg price per litre - Monthly average purchase (Litres) - Monthly average fill cost (£) Will need to adjust the table schema devised in commit b296fc8 for VEH-17 as need to be able to create some entries that would otherwise lead to duplicate keys (for the Garage fills). ----------------------------------------------------------------------------------------- Issue Relations ================ - is blocked by VEH-20: Create Stat run Indicator - blocks VEH-17: Stats Submodule - blocks VEH-18: Driver mileage chart - relates to VEH-31: Convert CPM Charts to use stats table ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2013-11-02 12:21:40 btasker ----------------------------------------------------------------------------------------- Think the best bet is to adjust the table to contain a varchar column called 'Modifier' and make it part of the PK. Most entries will be null, but it means could create something like the following for the Garage use stats |Year|Month|Modifier|Value| |2013|11|Tesco|1| |2013|11|Shell|3| ----------------------------------------------------------------------------------------- 2013-11-02 13:42:48 btasker ----------------------------------------------------------------------------------------- Module implemented, will test it on the dev server shortly ----------------------------------------------------------------------------------------- 2013-11-02 14:23:28 btasker ----------------------------------------------------------------------------------------- After a few tweaks and fixes, successfully tested on the dev server ----------------------------------------------------------------------------------------- 2013-11-02 14:23:48 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'In Progress' ----------------------------------------------------------------------------------------- 2013-11-02 14:23:56 ----------------------------------------------------------------------------------------- btasker changed status from 'In Progress' to 'Resolved' ----------------------------------------------------------------------------------------- 2013-11-02 14:23:56 ----------------------------------------------------------------------------------------- btasker added 'Done' to resolution ----------------------------------------------------------------------------------------- 2013-11-02 14:24:01 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Closed' ----------------------------------------------------------------------------------------- 2013-11-02 14:27:30 btasker ----------------------------------------------------------------------------------------- OBSOLETE - See Later comment for correct list For reference |StatType|Statistic|Modifier| |MonMiles|Mileage for that month|| |MonFuel|Total litres purchased|| |MonFuelCos|Total spend|| |MonFuelCn|Fill count|| |MonEco|Average economy for month|| |MonPPL|Average price per litre|| |MonAvgFill|Average fill (litres)|| |MonAvgCost|Average fill cost|| |MonAvgFCPM|Average cost per mile (based on fuel)|| |MonGarages|Number of fills at the garage in modifier|Garage Name| ----------------------------------------------------------------------------------------- 2013-11-02 16:25:19 btasker ----------------------------------------------------------------------------------------- Re-opening as want to standardise some of the stat names to allow for easier combination of stats common between servicing and fuel (i.e. allowing a single query to grab the relevant stats for both at the same time by querying Stat type) ----------------------------------------------------------------------------------------- 2013-11-02 16:25:19 ----------------------------------------------------------------------------------------- btasker removed 'Done' from resolution ----------------------------------------------------------------------------------------- 2013-11-02 16:25:19 ----------------------------------------------------------------------------------------- btasker changed status from 'Closed' to 'Reopened' ----------------------------------------------------------------------------------------- 2013-11-02 16:44:59 btasker ----------------------------------------------------------------------------------------- Changes Made |Original|New| |MonFuelCos|MonCost| |MonFuelCn|MonCn| |MonAvgFCPM|MonAvgCPM| Results in |StatType|Statistic|Modifier| |MonMiles|Mileage for that month|| |MonFuel|Total litres purchased|| |MonCost|Total spend|| |MonCn|Fill count|| |MonEco|Average economy for month|| |MonPPL|Average price per litre|| |MonAvgFill|Average fill (litres)|| |MonAvgCost|Average fill cost|| |MonAvgCPM|Average cost per mile (based on fuel)|| |MonGarages|Number of fills at the garage in modifier|Garage Name| Commit ea079bd refers ----------------------------------------------------------------------------------------- 2013-11-02 16:45:38 ----------------------------------------------------------------------------------------- btasker changed status from 'Reopened' to 'Resolved' ----------------------------------------------------------------------------------------- 2013-11-02 16:45:38 ----------------------------------------------------------------------------------------- btasker added 'Done' to resolution ----------------------------------------------------------------------------------------- 2013-11-02 16:45:45 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Closed'