Solved

Calculate Vacation time

Posted on 2002-04-26
7
289 Views
Last Modified: 2013-12-18
Hello,

 I need to be able to calculate vaction time in hours and quarter hours - holidays - weekends  and taking in to account a maxium total of 8 hours per day with my result rounded to the nearest quarter hour

So an entry of StartDate 04/26/2002 Starttime 08:00
               EndDate   04/29/2002 Endtime 12:30

Would result in 12.5 hours.

I am currently calling holidays like this
 'Get the list of Holidays
          Set hookview = db.GetView("Holidays")
          Set hookdoc = hookview.GetDocumentByKey("Holidays",True)

   

0
Comment
Question by:kplew
7 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971506
Zvonko !!!
This is yours buddy!  I hate time calculations...
:-)
Arun.
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 100 total points
ID: 6972295
Here is a prototype for you,

sTime := [8:00 AM];
eTime := [5:00 PM];
StartDate := [04/26/2002 08:00:00];
EndDate := [04/30/2002 12:30:00];
@if( StartDate > EndDate; @Return(0); "" );

diffDays := @integer((EndDate - StartDate) / 86400) + 1;
strtDay := @Modulo(@Weekday(StartDate); 7);
endDay := @Modulo(@Weekday(EndDate); 7);
days := (diffDays - endDay + strtDay - 8) * 5 / 7 - @Max(-2; -strtDay) - @Min(1; endDay) + 5 - strtDay + endDay;
sTimeD := @Time(eTime) - @time(StartDate);
eTimeD := @Time(EndDate) - @time(sTime);
sTimeDiff := @if( sTimeD < 0; 0; sTimeD)/3600;
eTimeDiff := @if( eTimeD < 0; 0; eTimeD/3600);

total :=  (days-1) * 8 + eTimeDiff ;

@Prompt([OK]; "Total vacation hours" ;  @Text(total) )

~Hemanth
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6976489
Nice Hemanth,
but what about holidays ?

I would do this using LotusScript.

kplew,
Are the holidays registered in the Domino Directory ? (I'm supposing you're using R5).

If so, I can write a script to do the calculations for you. If not, you need to keep the holidays somewhere else and get them from there. Let me know how and where you keep the holidays for your company and I will write the script for you.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6986131
Any progress ?
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6988020
None, I suppose :-)
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10859820
kplew,
No comment has been added to this question in more than 717 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

RECOMMENDATION: Award points to HemanthaKumar http:#6972295

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Zvonko
EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now