Timesheet 'force exact' fails where comma is used as a decimal separator
Who is this article for?
Users encountering the error "You cannot set this Time Sheet to Completed because not every day contains [some integer] as required".
IT Administrator permissions are required to resolve the issue.
If your TimeRecording.DayLength setting is set to a decimal value, and you use a comma as your decimal separator, then you might get the message "You cannot set this Time Sheet to Completed because not every day contains [some integer] as required" when completing a timesheet.
This article explains what causes the issue and how to resolve it.
Issue
If you use a comma as your decimal separator and have a working day length that is a decimal number, then your setting in App Manager might look like this:
In this example, the day length is seven and a half hours, "7,5".
In Windows, if the user profile for the user account that runs the Pentana application pool uses a dot ('.') as its decimal separator, then the application will ignore the comma.
This leads to a situation like this:
Here:
- Each day is the correct length, displayed as 7.5 hours.
- The service ignores the comma in your DayLength setting.
- It performs the wrong calculation: it compares 7.5 with 75.
- It prints the wrong error message: You cannot set this Time Sheet to Completed because not every day contains 75 hours as required.
You might try to resolve this by setting the regional setting on the server to some culture that uses a comma (e.g. German), but normally this will not work. This is because the PentanaService user normally does not have a user profile, and inherits its settings from LocalSystem. This will often be en-US.
Solution
There are three possible resolutions.
Change DayLength to include a dot
This forces the application to compare the decimal with LocalSystem's US format decimal correctly.
- In App Manager, change your decimal separator in the DayLength setting to be a dot:
- After making this change, click Save and restart the Pentana application pool (note that this will disconnect any connected users).
Add a culture setting to your service Web.config
Alternatively, you can keep the comma in the DayLength setting but specify that the app pool runs with a specific locale.
- Open App Manager and connect to the correct instance.
- Open the Config tab and ensure that the Service tab is selected.
Locate the <system.web> section, and add a setting relevant to your culture. In this example, German is set:
<globalization culture="de" uiCulture="de" />
- After making this change, click Save (note that this will disconnect any connected users).
Change the LocalSystem decimal separator to be a comma
Note that this might affect the behaviour of Windows and other applications on this server. We provide this option for your consideration and you should make your own judgement as to whether this is a viable solution for you.
- On the application server, open RegEdit.
- Locate HKEY_USERS\S-1-5-18\Control Panel\International.
- In the list, find sDecimal.
- Change the dot ('.') to a comma (',').
- After making this change, restart the Pentana application pool (note that this will disconnect any connected users).