Solved

Calculate Vacation time

Posted on 2002-04-26
7
290 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

914 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

21 Experts available now in Live!

Get 1:1 Help Now