Seems like "ancienneté" (in french) see in document
round((year(now() ) - year(${EmploymentContract.startDate} ))/5)
is a bit wrong as it tells to round only "year" and "year on employement start" to calculate the specific additionnal acquired vacation day . A employee that has started AFTER the start of the period calculation should not have a full 5 / 10 / 15... years mandatory to obtain an additional day off.
I try to only remove year specification but seems not to work... What should be the exact formula to use to properly calculate this at the start of period ?
Where did you find this formula ?
Hi,
This is just an exemple.
You can define the way you want.
For instance following formula may give correct result :
- Rule = floor( ( now()-${EmploymentContract.startDate} ) / (365 * 5) )
Other option, possibly more easy to understand :
- Rule = 1
- Where = now()-employmentcontract.startDate > 365 * 5
that will add 1 day after 5 years
- Rule = 1
- Where = now()-employmentcontract.startDate > 365 * 10
that will add a second day after 10 yers... that is more accurate as second extra day may be aquired after 8 years.
Two possibilities
floor (DATEDIFF(CURDATE(),${Employee.startDate}) / ( 365 * 5 ) ) > tbh it doesn't take into account leap year.
floor((YEAR(NOW()) - YEAR(${Employee.startDate}) - IF( DAYOFYEAR(NOW()) < DAYOFYEAR(${Employee.startDate}) , 1, 0)) / 5)
This should work with leap year
I've got another pb.
I've change the special right configuration, but It's working well only for me...
My additional days are well calculated but those for other employees stay to 0, even with a correct entrance day and said to be employee...
Any clue ?
small *bump* 😉 regards
Did Projeqtor team see my pb or tell me if you prefer that I put it specifically on another thread with this specific problem for tracability ?
Specific rights are defined at contract type level.
Do other employees have same contract type ?
Did you connect as the "other" employee.
I think leave rights are calculated on connection.
Yes, My collegues connected into projeqtor and have 0 specific right day
Ticket #4784 recorded.
I'll have a look.
floor (DATEDIFF(CURDATE(),${Employee.startDate}) / ( 365 * 5 ) )
floor((YEAR(NOW()) - YEAR(${Employee.startDate}) - IF( DAYOFYEAR(NOW()) < DAYOFYEAR(${Employee.startDate}) , 1, 0)) / 5)
In fact both formulas are wrong, as extra day off for seniority is generally calculated only at the end of the vesting period


