Annual Hourly Rate is Too High

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
Yajasi
Posts: 108
Joined: Wed Oct 17, 2012 4:48 pm

Annual Hourly Rate is Too High

Post by Yajasi »

We are trying to update an employee's salary. The currency for the salary is IDR. TimeTrex is not letting us do the update. It says the Annual Hourly Rate is too high. The Hourly Rate is NOT too high - it is being calculated correctly. How do we enter the employee's salary?
TTAnnualHourlyRateTooHigh.png
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Annual Hourly Rate is Too High

Post by shaunw »

You will need to modify the classes/modules/users/UserWageFactory.class.php file, search for this block of code:

Code: Select all

			if ( $this->getHourlyRate() > 1000 ) {
				$this->Validator->isTRUE(	'hourly_rate',
											FALSE,
											TTi18n::gettext('Annual Hourly Rate is too high') );
			}
Then change the "> 1000" part to "> 100000" instead.

Such a change will disable automatic upgrades and may show a warning when a new version is released. However the above validation check will be changed to just a warning (instead of a hard validation error) in the next major version of TimeTrex.
Yajasi
Posts: 108
Joined: Wed Oct 17, 2012 4:48 pm

Re: Annual Hourly Rate is Too High

Post by Yajasi »

Thanks - that worked! We are very grateful to be able to use your with the currency in our country.
Yajasi
Posts: 108
Joined: Wed Oct 17, 2012 4:48 pm

Re: Annual Hourly Rate is Too High

Post by Yajasi »

Will the planned feature change be implemented for the API as well?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Annual Hourly Rate is Too High

Post by shaunw »

Warnings by default will only be shown to the consumers of the web interface, not to the API.
Yajasi
Posts: 108
Joined: Wed Oct 17, 2012 4:48 pm

Re: Annual Hourly Rate is Too High

Post by Yajasi »

Warnings by default will only be shown to the consumers of the web interface, not to the API.
Because of this configuration, we continue to struggle with this problem using the API. Therefore, for others who use TimeTrex internationally, this may be helpful. Each time we upgrade to the latest version of TimeTrex, we run the following command.

Code: Select all

sudo sed -i "s/$this->getHourlyRate() > 1000/$this->getHourlyRate() > 100000/g" /path/to/timetrex/classes/modules/users/UserWageFactory.class.php
Since we are using Ubuntu Linux as our host, we can use this command. Users hosting TimeTrex on a Windows environment would need to use a different command.
Post Reply