Page 1 of 1

Annual Hourly Rate is Too High

Posted: Sun Apr 19, 2015 7:37 pm
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

Re: Annual Hourly Rate is Too High

Posted: Mon Apr 20, 2015 7:41 am
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.

Re: Annual Hourly Rate is Too High

Posted: Tue Apr 21, 2015 10:54 pm
by Yajasi
Thanks - that worked! We are very grateful to be able to use your with the currency in our country.

Re: Annual Hourly Rate is Too High

Posted: Wed May 27, 2015 10:13 pm
by Yajasi
Will the planned feature change be implemented for the API as well?

Re: Annual Hourly Rate is Too High

Posted: Thu May 28, 2015 9:57 am
by shaunw
Warnings by default will only be shown to the consumers of the web interface, not to the API.

Re: Annual Hourly Rate is Too High

Posted: Sun Sep 27, 2015 5:05 pm
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.