VEH-19: Fuel Stats Generation



Issue Information

Issue Type: Sub-task
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: VehMan (VEH)
Resolution: Done (2013-11-02 16:45:38)
Target version: 1.0.2,
Components: Fuel , Statistics ,

Created: 2013-11-02 12:19:59
Time Spent Working
Child of: VEH-17: Stats Submodule


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 Links

Toggle State Changes

Activity


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|

Module implemented, will test it on the dev server shortly
After a few tweaks and fixes, successfully tested on the dev server
btasker changed status from 'Open' to 'In Progress'
btasker changed status from 'In Progress' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'
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|

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)
btasker removed 'Done' from resolution
btasker changed status from 'Closed' to 'Reopened'
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
btasker changed status from 'Reopened' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'