Trouble Ticket Timecards: vtiger CRM TroubleTicket Time/Resource Control

Forge Link

NOTE: we have installation and customization services, for a small fee you can help us keep in business without any hassles.

Usage

Timecards are a relation of time, expenses (products) and work done on a given trouble ticket. The idea is to add timecards to a trouble ticket as work is done, specially over a laps of time (days, weeks or months) so we have a relation of all the work done to fix the problem or accomplish the project. With timecards we can add details of all the work done at different times with time and material used to solve a trouble ticket.

This extension also adds the possibility of converting certain timecards directly into a SalesOrder and from there to an Invoice.

Timecards are associated to a trouble ticket so you should see a new tab in between trouble ticket basic information and more information related block in the more information tab with all the timecards.

You can either create, edit, delete or move timecards as you would with any other vtiger CRM module.

A timecard can have either units, which will normally be combined with products or simply time. The units field is basically for the Invoice Lines. If you select a product it indicates the units of that product which must be invoiced.

Units indicates the number of products or descriptions in the timecard. It is a flexible concept, for example:

  • 3 units of product X, time doesn't matter
  • 2.5 units of programmer, time=4h: he spent 4h but we charge 2h30m
  • 0 units, 30m maintenance tasks

Internally we only use units on invoicelines and leave it at 0 for comment lines, but it could mean different things based on how you decide to use timecards.

Each timecard is of a given type. Only timecards with a product assigned AND of type InvoiceLine will be converted to SalesOrder. The Comment and BlockedComment type are for those timecards which normally describe the solution and all the work that has been done. The idea is to have a report where all InvoiceLine and Comment timecards appear, this report can be given to the client with his finished work. The BlockedComments do not appear on this report so the timecards of this type are for internal usage.

The InvoiceLine timecards MUST have a product as a SalesOrder MUST have a product. Timecards of type InvoiceLine with no product will not be converted to the SalesOrder as timecards with products that are not of type InvoiceLine.

There is a check box at the bottom of the form that says “New Timecard”. If this is selected we are redirected to another new timecard, if it is not checked you go back to detail view of timecards. The idea is that the tech staff goes out with trouble tickets to visit clients and fix things. When they get back into the office they register all there work as a batch load and they appreciate not having to hit the create button every time. I'll take into consideration having this option configurable.

The “change status” selectbox and the “assign ticket to” are shortcuts to change the trouble ticket. This makes it easy to introduce a timecard of the type:

  • “Sent request for information” and change the status of the ticket to “Wait for Response”
  • “Installed operating system and fixed problem. Pass ticket to Tech Staff to take computer to client” and change the responsible of the ticket.

5.1.0 Changes

TTTimecards was the first thing I programmed in vtiger CRM. I did not follow any of the non written rules that vtiger CRM code has, so it was mostly independent and out of line. With this new release I have refactored the application and adapted it to vtiger CRM philosophy (thanks Roarz for showing me the way).

Now timecards are shown as a related list on the more information tab of each trouble ticket. They have their own module which follows all of vtiger CRM rules wrt to custom fields, roles and permissions and all other features.

I have tried to maintain all the functionality we had before and we should be able to do everything we did in prior versions, albeit all won't be the same. For example the timecards tab view was very comfortable to see all the work done, we can't do this on the more information tab so I have added a button that will directly print a timecard report. In prior versions we didn't ask for the related trouble ticket as it was obvious, now you can directly create timecards and the trouble ticket must be selected. I have tried to auto fill in this field whenever I can to make it easier to create timecards.

5.1.0 Pending

  • Migration of data from previous versions
  • Integrate Showcard from Roarz

Reporting/Views

Version 1.3, which was for vtigerCRM 5.0.3, had a timecard reporting extension that made it possible to achieve reports of timecards from the vtigerCRM reporting module. In version 1.4, which is for vtigerCRM 5.0.4, this extension is included in the main package and timecard reporting can be done from within vtigerCRM.

From the vtigerCRM reporting module we can get reports of time spent on trouble tickets or time spent by users.

Besides the reporting possibilities of vtigerCRM, I have implemented a few of the basic reports I needed directly into the system, albeit in Spanish.

There are 4 new reports:

  • SortTT. Accessible from a new icon that is on the Trouble Ticket tool bar. This is to sort the trouble tickets for each user so the boss can organize the work
  • TT with and without comments. This is an output of the Trouble ticket. The difference is that timecards of type “blocked comment” do not appear

in the “without” version

  • Worksheet. This is just the header and description of the trouble ticket which we use to stick on the computers that come into the office, work done is written in the blank space and then converted into timecards

These outputs are what we use in our office and can be adapted to whatever your particular needs may be.

Some of the other reports I need I will wait for. They will be accomplished with our B.I. project.

These are what I had on my list:

  • Total accumulated time. Obtained in the Ticket Report and later with B.I.
  • Total accumulated time for each worker. B.I.
  • Timecards of each worker. Custom View
  • Finished Trouble Tickets. Custom View
  • Pending Trouble Tickets by worker. Custom View
  • Order trouble tickets, list of work to take out. New SortTroubleTickets Report.
  • User workorder o service ticket (without blocked comments). Obtained in the TicketReport.

Reporting for 5.1.0

Reporting is included in the 5.1.0 release, although you have to patch the code to get it working. Besides that I would say that the functionality is less than what we had with prior versions but only time will tell if I am correct or I haven't investigated enough the new reporting code in 5.1.0. I will attend requests as they appear.

Installation

NOTE: we have installation and customization services, for a small fee you can help us keep in business without any hassels.

Installation 5.1.0

  1. Install module using module manager
  2. Copy files for HelpDesk changes:
    cp modules/Timecards/chat* modules/HelpDesk
  3. Copy additional database changes:
    cp modules/Timecards/addTimecards.php .
  4. Apply additional database changes:
    http://your_server/your_vtiger_install/addTimecards.php
  5. Apply patch to get necessary code changes:
    patch -p 0 < modules/Timecards/Timecards.diff
  6. Patch file only adds new text strings to modules/HelpDesk/language/en_us.lang.php file, if you are using a localized version, you must add new strings to your HelpDesk language file.
    +// Added for TSolucio:TTTimecards
    +'LBL_PDF_WITH_COMMENTS' => 'Ticket with Comments',
    +'LBL_PDF_WITHOUT_COMMENTS' => 'Ticket without Comments',
    +'LBL_HelpDesk_Receipt' => 'WorkSheet',
    +'sortWO'=>'Sort Workorders', // Ordenaci&oacute;n de Trabajos Pendientes

Installation 5.1.0 Convert TroubleTicket to SalesOrder and Invoice

  1. Copy patch file to root of vtiger CRM install
  2. Apply patch to get necessary code changes:
    patch -p 0 < TT2SOIV.diff
  3. Apply database changes:
    http://your_server/your_vtiger_install/addTT2SOIV.php
  4. Patch file only adds new text strings to modules/HelpDesk/language/en_us.lang.php file, if you are using a localized version, you must add new strings to your HelpDesk language file.
    +'CONVERT_SALESORDER' => 'Convert to Sales Order',
    +'CONVERT_INVOICE' => 'Convert to Invoice',

Installation <= 5.0.4

  1. unzip tttimecards files from top of source directory
  2. apply patch file: modules/HelpDesk/TTTimeCards.diff
     patch -p 0 < modules/HelpDesk/TTTimeCards.diff
  3. execute config_timecards.php script with
     http://yourserver/yourvtigercrm/index.php?module=HelpDesk&action=config_timecards
  4. It is very important that the entries in the $module_list array in modules/Reports/Reports.php maps to the correct values. In my installation the timecards blocks are “84,85,86” if these numbers change on your installation (they are dynamically generated during the configuration) you must change the values of the mapping. I have added a script to get all the blocks and their ID's to make the previous step easier:
     http://yourserver/yourvtigerinstall/getBlocks.php
  5. patch file only adds new text strings to en_us files, if you are using a localized version, you must add new strings to your language files. I personally recommend installing Language Pack Wizard (on vtiger forge). The list of modified language files can be obtained from the list at the end of this file or looking at the patch file. Consider sharing your language files changes with others, contact me.

Upgrade from vtigerCRM 5.0.3

These operations are very complicated in the current state of vtigerCRM, and your mileage will vary depending on the state of your code. I will only describe ONE way of doing this which is the way I have tried. There are others and we are more than willing to help anybody get this working on their installation for a fee.

  1. upgrade your vtigerCRM 5.0.3 following vtiger's instructions: overwrite code and apply database changes to your current database through migration wizard in settings
  2. unzip tttimecards files from top of source directory overwriting all existing files
  3. apply patch file: modules/HelpDesk/TTTimeCards.diff
     patch -p 0 < modules/HelpDesk/TTTimeCards.diff
  4. execute upgrade_timecards.php script with
      http://yourserver/yourvtigercrm/index.php?module=HelpDesk&action=upgrade_timecards
  5. It is very important that the entries in the $module_list array in modules/Reports/Reports.php maps to the correct values. In my installation the timecards blocks are “84,85,86” if these numbers change on your installation (they are dynamically generated during the configuration) you must change the values of the mapping. I have added a script to get all the blocks and their ID's to make the previous step easier:
     http://yourserver/yourvtigerinstall/getBlocks.php
  6. patch file only adds new text strings to en_us files, if you are using a localized version, you must add new strings to your language files. I personally recommend installing Language Pack Wizard (on vtiger forge). The list of modified language files can be obtained from the list at the end of this file or looking at the patch file. Consider sharing your language files changes with others, contact me. We haven't added any new text strings so you can copy the ones you had from 5.0.3 to the new 5.0.4 translation.

Custom Fields support on Timecards for version 1.4 (5.0.4)

Custom fields are fully supported from version 5.1.0 forward

svn -r 699:700
Thanks to Centritech Communications Systems who have paid half the development cost timecards now support custom fields.

At the moment (vtigerCRM 5.0.4) this is a patch on the existing timecard release, but as of the next release it will be integrated into the normal release cycle.

NOTE: The update release overwrites the timecard extension original files so if you have modified these files in any way your changes will be lost. Contact me if you need a patch.

Add before Timecards installation

This is the case of wanting to install timecards for the first time on a fresh copy of vtigerCRM and wanting the custom field patch also installed.

  • Unzip the timecard release
  • Unzip the timecardcf release on top
  • Apply the timecard patch (TTTimeCards.diff)
  • Apply the timecardcf patch (TimecardCFReport.diff)
  • Fix the block numbers in the report module
  • Execute config_timecards script

Add after Timecards installation

This is the case of wanting to install timecards custom field patch on top of an existing and working installation of the timecards extension.

  • Unzip the timecardcf release
  • Apply the timecardcf patch (TimecardCFReport.diff)
  • Fix the block numbers in the report module
  • Execute config_tccf script

Add after Timecards installation

The custom field patch modifies two files in the reporting module. One indicates the internal number of the block within which the new custom fields are. This number is dynamically assigned in each installation so you will have to change it to the block number in your system.

In my install, my Reports.php line 121 looks like this:

  "TimeCard"=>Array("Information"=>'84,85,86',"Custom Information"=>88),

You may have different numbers and may have to change the 88 which is the new internal block number.

I created a script which lists all the blocks:

http://yourserver/yourvitger/getBlocks.php

Scroll down to timecards and see what number is assigned to the Custom Information block

As usual, make copies before starting.

Default values for fields on new Timecards

Around line 33 of the script modules/HelpDesk/TimeCardNew.php the definition of the array $default_values can be found:

$default_values=array(
  'tcunits'=>'1',
  'worktime'=>'0:05',
  'timecardtypes'=>'Comment',
  'newtc'=>1,
  'ticketstatus'=>'Maintain'
);

Any of the timecard fields can be added or modified in this array to establish default values for the fields.

The fields can be obtained looking in the database (vtiger_field table).

For example, if we wanted to have a default date of '0000-00-00' to obligated the user to introduce a valid date, the array would look like this:

$default_values=array(
  'tcunits'=>'1',
  'workdate'=>'0000-00-00',
  'worktime'=>'0:05',
  'timecardtypes'=>'Comment',
  'newtc'=>1,
  'ticketstatus'=>'Maintain'
);

Changes

5.1.0: 2009-09-26
=======================================
- Adapt to vtigerCRM 5.1.0 using vtlib as much as I can
- Philosophy change, try to keep in line with vtiger CRM.

1.4: 2008-03-21
From 1.3svn@536 to 1.4svn@539
=======================================
- Adapt to vtigerCRM 5.0.4
- Now includes reporting
- Small bug fixes caught along the way

1.3:
From 1.2svn@349 to 1.3svn@350 (never released, internal use only)
=======================================
Files
------------
Smarty/templates/DetailView.tpl
modules/HelpDesk/language/en_us.lang.php
modules/HelpDesk/HDTicketProd.php
modules/HelpDesk/HDTicket.php

1.2: 2007-07-13
From 1.1svn@348 to 1.2svn@349
=======================================
Database
------------
You have to change the values of "visible" and "readonly" in the tables vtiger_field, vtiger_def_org_field and vtiger_profile2field (for each profile).

The following SQL may help:
update vtiger_field set readonly=1 where tabid=30;
update vtiger_def_org_field set visible=0, readonly=1 where tabid=30;
update vtiger_profile2field set visible=0, readonly=1 where tabid=30;

These are the updates I made on my database. Obviously you must change the 30 for whatever tabid TimECards got in your installation.

Files
------------
config_timecards.php
HDReceipt.php
HDTicket.php
SortTT.php

1.1: 2007-05-20
=======================================
- Adapt to vtigerCRM 5.0.3 SVN 10856
- Eliminate CreatePDF and related files which weren't being used

1.1: 2007-04-15
=======================================
- Appy patches and bug fixes from project forum
  - contact/account empty
  - date format
- Adapt to vtigerCRM 5.0.3 SVN 10685 (basically changes in unified search)
- Update config_timecards.php script
- Eliminate Tax calculation code which was useless (ConvertHelpDesktoSO_Taxtype_Error.txt)

ToDo

  • Move timecards to another troubleticket Accomplished in 5.1.0 by selecting from acquiring trouble ticket
  • Duplicate timecards Accomplished in 5.1.0
  • Notification on convert to SO of TT with product timecard not invoiced
  • Fill timecard description with product description on product select. I looked at this and it is rather complicated for the small benefit.
  • Add “total time” to ticket. This has been implemented as a closed profit or cost-effectiveness extension for our clients (ask me if you are interested).
  • Out of specification:
    • Show pending work of a client when a new ticket for that client is introduced into the system
    • The product quantity in Quote, PO, SO and Invoice is Integer, so we can't have things like: 0.5h of programming or 0.5 dinner!!
    • Relate sales order and trouble ticket through “more information”

Timecard Custom Fields

Por: Scott Brown
Custom Time Card Fields
2008-08-18 21:30
When I add any custom fields through the Custom Field Settings menu it doesn't seem to be saving them. It doesn't give any error. It just comes back to the listing of custom fields for that module. Which in my case is zero.

RE: Custom Time Card Fields [ responder ]
2008-08-19 00:46
This feature is not supported. There is no code in place for it.
The timecard extension appears in the custom field section because vtigerCRM dynamically extracts all modules but I did not create any code for custom fields.

We can add this feature for a fee if anybody is interested in contributing that to the community. I don't think this could be expensive.

Comments

What I needed to start working with vtigerCRM is what I have done. Once I have made the reports I will have covered my company's needs, so the rest is on “left over time”, and you now that we usually don't have much of that :-)

Thanks for trying this project.
Joe. JPL TSolucio, S.L.
http://tsolucio.com