SiT! Bugs - SiT!
View Issue Details
0000890SiT!reportspublic2009-08-19 15:412010-03-27 12:31
3.60 LTS3.60 LTS 
0000890: Reports not including statistics from Incidents logged for customers
Reports are not including data for all incidents. The reports are ignoring incidents logged by users at sites with 'all contacts at this site' enabled against their maintenance contract. Enabling this option fails to add all the required contact ids to the 'supportcontacts' table therefore many incidents are missing from the reports. Specifically 'recent incidents' and 'average incident duration', but probably all of them?
No tags attached.
Issue History
2009-08-19 15:41davidstewardNew Issue
2009-08-19 17:28ivanNote Added: 0001782
2009-08-19 17:28ivanStatusnew => confirmed
2010-01-20 17:21davidstewardNote Added: 0002294
2010-02-21 21:47ivanTarget Version => 3.60 LTS
2010-02-25 21:21paulhStatusconfirmed => assigned
2010-02-25 21:21paulhAssigned To => paulh
2010-03-13 14:13paulhNote Added: 0002664
2010-03-13 14:45paulhNote Added: 0002667
2010-03-13 15:56paulhNote Added: 0002669
2010-03-25 13:47ivanNote Added: 0002868
2010-03-25 13:47ivanStatusassigned => resolved
2010-03-25 13:47ivanFixed in Version => 3.60 LTS
2010-03-25 13:47ivanResolutionopen => fixed
2010-03-27 12:31ivanStatusresolved => closed

2009-08-19 17:28   
Confirmed for recent incidents report, I expect you're right and other reports are affected by this. (3.50rc1) Thanks.
2010-01-20 17:21   
I have modified the 'recent incidents' sql query within Report_incidents_recent.php to address what I belive the bug is. I removed lines 44 and 45:-

$sql .= "AND = sc.maintenanceid ";
$sql .= "AND sc.contactid = ";

and replaced with this which accounts for contracts with 'all users supported' enabled, rather than specifying each individual contact:-

sql .= "AND (( = sc.maintenanceid AND sc.contactid = OR (m.allcontactssupported = 'yes' AND in (select id from contacts where siteid =";

No guarantees this is either correct or efficient, but it seems to work great on my system! Hope it helps.
2010-03-13 14:13   
Effected reports are:

2010-03-13 14:45   
report_customer_contracts.php - Hard coded to 4 contacts, going to add additional field I think for 'all site'
2010-03-13 15:56   
r6231 and fb2eb4a resolve


report_marketing.php will be more difficult just to the use of LEFT JOINs which make this difficult
2010-03-25 13:47   
There's no point trying to do this on the marketing report, it only really make sense when using named contacts for that one. I'm calling this one resolved.

We have a doc day coming up, if the report gets documented then I'll try and remember to make a note.