Kayako logo
Modifications & Addon Releases Modification guides and addons are posted here to share with the community. Do not post requests in here!

Notices

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  (#1) Old
bear Offline
Community Moderator
 
Posts: 701
Join Date: Jan 2005
Billing time query - 11-08-2007, 02:14 PM

As previously discussed, I needed a way to grab all billable time from a specific department that I use for clients that pay by the hour, and it seems Kayako devs haven't yet done this. Just run this in phpMyAdmin to sum up all the billable time for one specific department (in this case, ID 4).

Need this by client ID? Change the last part "departmentid=4" to "userid=xxx" where "xxx" is the actual client id.

Code:
select sum(swtickettimetrack.timebillable) from swtickettimetrack,swtickets where swtickettimetrack.ticketid=swtickets.ticketid and swtickets.departmentid=4
Should be quite simple to port this to a php page for easy retrieval via browser, but I'd suggest making it a login type deal to access it.
Enjoy.
   
Reply With Quote
  (#2) Old
bear Offline
Community Moderator
 
Posts: 701
Join Date: Jan 2005
13-08-2007, 02:35 AM

To follow up, here's how to include this on a PHP page:
Quote:
// tally billable time for dept 4
$result = "select sum(swtickettimetrack.timebillable) from swtickettimetrack,swtickets where swtickettimetrack.ticketid=swtickets.ticketid and swtickets.departmentid=4";
$totaltime = mysql_query($result);
echo "Department 4 time worked: " .(mysql_result($totaltime,0));
// end tally
Connection to the DB is handled via Kayako's call, as this was written to be included in the staff dashboard. I stuck it in the "today" block (see attached)
Attached Images
File Type: png sqlresult_billable.png (3.9 KB, 70 views)
   
Reply With Quote
  (#3) Old
craigbrass Offline
Senior Member
 
Posts: 5,762
Join Date: Jun 2005
Location: Cumbria, UK
13-08-2007, 08:53 AM

Thanks for sharing Bear! I know from reading other topics that many will find this useful.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#4) Old
jnet Offline
Member
 
Posts: 568
Join Date: Mar 2008
25-06-2008, 06:04 PM

thanks but the time calculation has to be solved too
I can put a watch in front of me and when I finish look at my watch
and record the time
there must be a timer there to start and then finish and the time is inserted automatically
   
Reply With Quote
Reply

Tags
billing, query

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Billing Entries and Time zones jameswyld SupportSuite, eSupport and LiveResponse 3 06-05-2008 10:36 PM
A report of total Billing Time? NC Software SupportSuite, eSupport and LiveResponse 8 11-10-2007 12:08 PM
Billing tab time display off by timezone offset oneobserver SupportSuite, eSupport and LiveResponse 0 23-10-2006 10:21 AM
SQL query to show response time in minutes jamesM Developers & Code 0 23-09-2006 12:04 AM



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47