|
![]() |
| | LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
(#1)
|
(#2)
|
(#3)
|
(#4)
|
(#5)
|
(#6)
|
(#7)
|
(#8)
|
(#9)
|
(#10)
|
(#11)
|
| Kayako Tester Posts: 10 Join Date: Feb 2007 Location: Watford, UK |
10-03-2007, 01:54 AM
Quote:
![]() We would also love to see the ability to view web stats on our site based on all accesses, not just hits on a specific campaign. The latter is something Cerberus / WebGroupMedia did reasonably well (well the LiveHelp client although it was never properly developed) Jon FidoNet - http://www.fido.net/ - Official Kayako Reseller tel: +44 845 004 3050 / fax: +44 845 004 3051 Contact sales@fido.net for pricing and licensing info | |
| | |
(#12)
|
(#13)
|
| Senior Member Posts: 2,918 Join Date: Aug 2006 Location: Mumbai, India SupportSuite Owned License |
22-03-2007, 09:51 AM
Thank You for sharing it ![]() Professional and Affordable Kayako Skins - Specialists in Kayako Skinning & Customization - Professional Paid Support Our Skins and Services - http://www.supportskins.com/store/ SupportSkins.com - http://www.supportskins.com/ |
| | |
(#14)
|
| New Member Posts: 8 Join Date: Jan 2006 Location: SLO, CA | SQL Reports -
06-08-2007, 08:07 PM
Based on what SQL Code 'efullfillment' provided I have modified the code to provide some output more helpful to our clients and our Accounting Dept. We have a few problems when it comes to billing: 1) the swtickettimetrack table does not have a column to track IF time has been billed (a bool value). So we created a new ticket status - Billed. After a ticket has been billed for, our bookkeeper moves the ticket from Closed to Billed. 2) Grouping all the users. Doing this with User Groups is a PAIN. If new users are always added as they create tickets this becomes a maintenance nightmare. Since all the people we support are businesses who use the same mail system, I was able to GROUP everyone by assuming that each business SHARES the same domain name in the email address. Below are the SQL queries for these reports grouped by Client. A customer is filtered by the unique domain each company would have. Bi-Weekly Ticket Billing Detailed Report: SELECT LEFT( RIGHT( t2.email, LENGTH( t2.email ) - LOCATE( '@', t2.email ) ) , 9 ) AS CLIENT, t2.ticketmaskid AS TicketID, FROM_UNIXTIME( t1.dateline, '%Y-%m-%d' ) AS Date, LEFT( t3.fullname, 18 ) AS Tech, REPLACE( REPLACE( t1.notes, '\n', ' ' ), CHAR(9), ' ') AS Notes, REPLACE( LEFT( t2.SUBJECT, 45 ) , '\n', ' ' ) AS Subject, LEFT( t2.fullname, 18 ) AS Requestor, t1.timespent AS Tspent, t1.timebillable AS Tbilled FROM swtickettimetrack AS t1 LEFT JOIN swtickets AS t2 ON ( t1.ticketid = t2.ticketid ) LEFT JOIN swstaff AS t3 ON ( t1.forstaffid = t3.staffid ) WHERE t1.ticketID IN ( SELECT ticketID FROM swtickettimetrack WHERE dateline BETWEEN UNIX_TIMESTAMP( DATE_SUB( CURDATE( ) , INTERVAL 14 DAY ) ) AND UNIX_TIMESTAMP( CURDATE( ) +2 ) ) AND t2.ticketstatusid =3 AND t1.timebillable >0 ORDER BY Tech, Date, TicketID; Bi-Weekly Ticket and Time Count: SELECT RIGHT(t1.email, LENGTH(t1.email) - LOCATE('@',t1.email)) AS Client, COUNT(t1.ticketmaskid) as Count, SUM(t2.timespent) AS Tspent, SUM(t2.timebillable) AS Tbilled FROM swtickets AS t1 LEFT JOIN swusers AS t3 ON (t1.userid = t3.userid) LEFT JOIN swtickettimetrack AS t2 ON (t1.ticketid = t2.ticketid) WHERE t1.dateline BETWEEN UNIX_TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 14 day)) AND UNIX_TIMESTAMP(CURDATE()) GROUP BY Client ORDER BY Count Desc; Bi-Weekly DF Employee Ticket Activity (Ticket Activity, Time Spent, Time Billed, & Bonus): SELECT t1.forstaffid AS ID, LEFT( t3.fullname, 18 ) AS Tech, COUNT(t1.forstaffid) as Activity, SUM(t1.timespent) AS Tspent, SUM(t1.timebillable) AS Tbilled, ROUND(SUM(t1.timebillable)/6,2) AS Bonus FROM swtickettimetrack AS t1 LEFT JOIN swtickets AS t2 ON ( t1.ticketid = t2.ticketid ) LEFT JOIN swstaff AS t3 ON ( t1.forstaffid = t3.staffid ) WHERE t1.ticketID IN ( SELECT ticketID FROM swtickettimetrack WHERE dateline BETWEEN UNIX_TIMESTAMP( DATE_SUB( CURDATE( ) , INTERVAL 14 DAY ) ) AND UNIX_TIMESTAMP( CURDATE( ) +2 ) ) AND t2.ticketstatusid > 2 GROUP BY t1.forstaffid ORDER BY t1.forstaffid Now that we have the correct SQL Queries, we can make CRON jobs that email the output of each report monthly to our billing department. This is the script I used to email the output: 1st line (Use mysql to generate an HTML report and direct output ot a file: mysql -H -D esupport3 -u root -pP@$$w0rdHere -e "SQL QUERY GOES HERE ALL IN ONE LINE" >> /var/spool/report/billing.html 2nd line (Use Mutt to email the HTML file as an attachment) mutt -a /var/spool/report/billing.html -i /var/spool/report/msgbody.txt -s "Monthly Ticket Billing Report" person@customer.com < /dev/null Save these lines to a file and call them by saving a file in /etc/crond.d: Contents: 0 6 0 * 1 root /root/reports/billing >> /dev/null Note: We run these report EVERY week. As the bookkeeper moves the closed tickets to Billed, they will not show up in next week's report. - Let this also be a PLUG for reports in eSupport! It would be killer to just be able to create a scheduled job that would generate these types of reports that would run monthly and atuo-send! Also Monthly Ticket Report Summaries to the Clients! That would be another scheduled report to add! Here is a script for that (it groups by domain in the email address)! SELECT FROM_UNIXTIME(t1.dateline, '%Y-%m-%d') as Date, t1.ticketmaskid as TicketID, LEFT(t1.SUBJECT, 40) as Subject, t1.fullname AS Name FROM swtickets AS t1 LEFT JOIN swtickettimetrack AS t2 ON (t1.ticketid = t2.ticketid) LEFT JOIN swusers AS t3 ON (t1.userid = t3.userid) LEFT JOIN swstaff AS t5 ON (t2.forstaffid = t5.staffid) WHERE t1.dateline BETWEEN UNIX_TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 1 month)) AND UNIX_TIMESTAMP(CURDATE()) AND t1.email LIKE '%cust%' GROUP BY TicketID ORDER BY Date; Final Note: Of course all this stuff was thrown together by me personally and will not be supported by Kayako staff. All code here is not guaranteed and you use at your own risk! I am not an SQL or Linux God so I will probably not be able to answer your questions, but I have put all the tool together for you. My server is currently CentOS 4.3 I did not have to install anything custom to get all this to work. Maybe I was just lucky. |
| | |
(#15)
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SupportSuite reporting. | byronsmith | Presales Questions | 5 | 04-08-2007 08:45 AM |
Kayako provides online help desk software and support solutions; enabling companies to improve their support and reduce costs.
Our three main products include: SupportSuite, eSupport and LiveResponse