Issue on TimeUtil.getBusinessDaysBetween with country based on language
Description
Environment
Activity
Nicolas Micoud October 19, 2022 at 2:48 PM
I’ve reopened https://idempiere.atlassian.net/browse/IDEMPIERE-1708 as it was ~ its subject. I’m on holidays at the end of the week, I won’t have time to look into until November
Heng Sin Low October 19, 2022 at 1:33 PM
Yes, that should be addressed in a separate ticket. For this ticket, I think your existing PR is fine.
Nicolas Micoud October 19, 2022 at 1:26 PM
I agree with the change you suggest. But that should be done in another ticket (I mean, is a big change)?
Anyway, I think my new method still makes sense as is still possible for an Italian admin to login using * or a ‘simple’ Italian user working on a UK organization (but the person is using Italian non business days). And in this case, is better to be able to ‘force’ the desired country.
wdyt?
Heng Sin Low October 19, 2022 at 12:19 PM
I think it is still better to use ad_orginfo’s c_country_id when user login with org and fallback to the current approach when user login with * org (or when ad_orginfo’s c_country_id is not set). Also, in practise, user usually doesn’t login with '*' org, only administrator do.
Nicolas Micoud October 19, 2022 at 9:11 AM
I think we already had this conversation years ago (see https://idempiere.atlassian.net/browse/IDEMPIERE-1707 and https://idempiere.atlassian.net/browse/IDEMPIERE-1708) ; but if you log with * you’ll be in the same situation (as there is no location for Org 0).
That probably need to be discussed again?
Hi,
I'm facing an issue when counting the number of business days between 2 dates.
The country is guessed by the system using the tenant language.
Which must be correct most of the times... but not always.
In my case, the tenant is based in UK and language is "English (US)".
I never change that, that may be a mistake and if I do this, that will probably work.
But... if that customer opens an organization in another country and register non business days there, they won't be considered.
I’ve added a method with the country as parameter, so anyone can use any country based on organization, user, ...