Solved

Calculate Vacation time

Posted on 2002-04-26
7
293 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to connect Lotus Notes to iPhone/Droid without Traveler 14 237
Lotus Notes Mail Database issues 2 975
Lotus Notes - Broken Links report 5 223
Migration Lotus to Exchange 2016 4 211
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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