SiT! Bugs - SiT!
View Issue Details
0000890SiT!reportspublic2009-08-19 15:412010-03-27 12:31
davidsteward 
paulh 
normalmajoralways
closedfixed 
3.45 
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

Notes
(0001782)
ivan   
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.
(0002294)
davidsteward   
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 m.id = sc.maintenanceid ";
$sql .= "AND sc.contactid = i.contact ";

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

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

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

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

report_incidents_recent.php
report_customer_contracts.php

report_marketing.php will be more difficult just to the use of LEFT JOINs which make this difficult
(0002868)
ivan   
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.