• Count days with Sat $ Sun

    By Dmitry Malchikov 2 decades ago

    Hi,

    Where possible to change count rule for "Days left". Because in our Law we use 28 allowed in year, but Non-working days included?



    Dmitry

    • Count days with Sat $ Sun

      By Gary Cousins 2 decades ago

      Hello,



      You need to change the Duration field on the Leave Request form (version 2.2.1 and web version) and the Web Leve Request form (web version only).



      The current formula is:







      @If(@IsNewDoc; 1; @Success);



      tmpWeekEnd:= 1:7;



      REM {Get Public Holidays};

      tmpHolidays:= @DbLookup("":"NoCache";"";"Holidays";Country;2);



      REM {Create a textlist that contains all days in the period};

      tmpDatelist := @Text(@Explode(@TextToTime(@Text(StartDate)+" - "+@Text(Return))));



      REM {Remove the holidays};

      tmpNoHolidays := @TextToTime(@Trim(@Replace(tmpDatelist; @Text(tmpHolidays); "")));



      REM {Remove Weekends};

      tmpWeekdays := @If(@Text(tmpNoHolidays)="";"";@Text(@Weekday(tmpNoHolidays)));



      tmpWorkdays := @If(@Text(tmpWeekdays)="";"";@Trim(@Replace(tmpWeekdays; @Text(tmpWeekEnd); "")));



      @Elements(tmpWorkdays)







      1 is Sunday and 7 is Saturday.



      You should be able to work out the changes you need from the remarks (REM) in the above code.



      You will also need to edit the Lotusscript in the "Admin - Approve A/L" and "Admin - Revoke A/L" buttons.


      • Thanks! very nice :)

        By Dmitry Malchikov 2 decades ago