When logged in as admin and viewing the overview report (reports & expenses), my aircraft usage was showing weird hours and miles totals.
A quick delve into the StatsData.class.php showed that the sql query for AircraftUsage was using COUNT() rather than SUM(), i.e.
public static function AircraftUsage()
{
$sql = 'SELECT a.name AS aircraft, a.registration,
SUM(p.flighttime) AS hours, SUM(p.distance) AS distance
FROM '.TABLE_PREFIX.'pireps p
INNER JOIN '.TABLE_PREFIX.'aircraft a ON p.aircraft = a.id
GROUP BY p.aircraft';
I changed the query accordingly and the totals now show correct values.
Nabeel, was this the right thing to do, or was I missing something elsewhere ?