Incorrect work code field lengths

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
SteveH
Posts: 6
Joined: Thu Jul 31, 2008 1:44 pm

Incorrect work code field lengths

Post by SteveH »

While trying to add a new time clock, I receive the following error...

Incorrect Input!

1. Incorrect work code field lengths, they must all add up to 9.

The Work Code Field Lengths: Branch and Department have the value of 1. I tried various values with no success.

Also occurs when trying to edit an existing time clock.

System: Ubuntu 8.04 LTS
Version: 2.2.12
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Did you try values of 4 for the branch field, and 5 for the department field?
SteveH
Posts: 6
Joined: Thu Jul 31, 2008 1:44 pm

Post by SteveH »

Yes, I did. I tried several combinations. 0 and 9, 1 and 8, 2 and 7, etc.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

This is a bug that will be fixed in the next version of TimeTrex.

In the mean time, give this a try:


Edit: classes/modules/core/StationFactory.class.php then around line 1050 add the following line just below: "function setWorkCodeDefinition"

Code: Select all

$arr = Misc::preSetArrayValues( $arr, array('branch', 'department','job', 'job_item'), 0);
So it should look like this:

Code: Select all

        function setWorkCodeDefinition($arr) {
                $arr = Misc::preSetArrayValues( $arr, array('branch', 'department', 'job', 'job_item'), 0);

                if ( is_array( $arr )
                                AND ($arr['branch']+$arr['department']+$arr['job']+$arr['job_item']) == 9 ) {
                        $this->data['work_code_definition'] = serialize( $arr );

                        return TRUE;
                } else {
                        $this->Validator->isTRUE(       'work_code_definition',
                                                                                FALSE,
                                                                                TTi18n::gettext('Incorrect work code field lengths, they must all add up to 9') );
                }

                return FALSE;
        }
SteveH
Posts: 6
Joined: Thu Jul 31, 2008 1:44 pm

Post by SteveH »

Thank you. That solved the issue.
Locked