OTL- Timecard: How can associate Project with Time

Hello gurus,
I have an OTL requirement where users are required to enter no more than 8 hours of sick time a week.
I have an idea on how to accomplish this but I am not sure how to count the hours when Project = Sick.
Can somebody give me an idea how to accomplish this? This is what I have so far:
FUNCTION XXJIBE_SICK_HRS(p_resource_id NUMBER)
RETURN VARCHAR2
IS
l_timecard_info hxc_self_service_time_deposit.timecard_info;
l_tbb_array HXC_BLOCK_TABLE_TYPE;
l_attributes_info hxc_self_service_time_deposit.building_block_attribute_info;
l_attr_array HXC_ATTRIBUTE_TABLE_TYPE;
BEGIN
l_timecard_info := hxc_self_service_time_deposit.get_building_blocks;
l_tbb_array := hxc_deposit_wrapper_utilities.blocks_to_array(p_blocks => l_timecard_info);
l_attributes_info := hxc_self_service_time_deposit.get_block_attributes;
l_attr_array := hxc_deposit_wrapper_utilities.attributes_to_array (p_attributes => l_attributes_info);
IF l_tbb_array.FIRST IS NOT NULL THEN
FOR i IN l_tbb_array.FIRST .. l_tbb_array.LAST
LOOP
IF (l_tbb_array(i).MEASURE > 0 and l_tbb_array(i).SCOPE = 'DETAIL') THEN
IF l_attr_array.FIRST IS NOT NULL THEN
FOR i IN l_attr_array.FIRST .. l_attr_array.LAST
LOOP
IF (l_attr_array(i).attribute_category = 'PROJECTS'
and l_attr_array(i).attribute1 = 4015 ---project_id for "Non-Work Time US"
and l_attr_array(i).attribute2 = 5121 ---task_id for "Sick"
) THEN
v_sick_hours := nvl(l_tbb_array(i).MEASURE,0) + v_sick_hours;
END IF;
END LOOP;
END IF;
END IF;
END LOOP;
END IF;
IF (v_sick_hours > 8) THEN
v_out := Per our policy you are limited to 8 hours of sick time in a week.
Please adjust your sick time hours on this timecard.';
else
v_out := 'Pass';
END IF;
end;
The code above is not correct because it is failing when I submit 5 hours for the week.

I got the solution. Here is the code I modified:
IF l_tbb_array.FIRST IS NOT NULL THEN
FOR i IN l_tbb_array.FIRST .. l_tbb_array.LAST
LOOP
IF (l_tbb_array(i).MEASURE > 0 and l_tbb_array(i).SCOPE = 'DETAIL') THEN
v_tbbid := l_tbb_array(i).time_building_block_id;
v_measure := nvl(l_tbb_array(i).MEASURE,0);
IF l_attr_array.FIRST IS NOT NULL THEN
FOR i IN l_attr_array.FIRST .. l_attr_array.LAST
LOOP
IF (l_attr_array(i).attribute_category = 'PROJECTS'
and l_attr_array(i).attribute1 = 4015 --project_id for "Non-Work Time US"
and l_attr_array(i).attribute2 = 5121 --task_id for "Sick"
and l_attr_array(i).building_block_id = v_tbbid) THEN
v_sick_hours := v_measure + v_sick_hours;
END IF;
END LOOP;
END IF;
END IF;
END LOOP;
END IF;

Similar Messages

  • TS3423 Mac book pro stops responding after Maverick OS restart. Currently have a circle with a line through it after 20+ hours. Tried to shut it down and use the Time Machine to restore but no response. How can I restore with Time Machine if it will not s

    Mac book pro stops responding after Maverick OS restart. Currently have a circle with a line through it after 20+ hours. Tried to shut it down and use the Time Machine to restore but no response. How can I restore with Time Machine if it will not start?

    sonjadg,
    you can purchase a replacement pair of grey installation DVDs for your MacBook Pro from either Apple or iFixit. If Startup Manager is only showing an OS X Installer volume, then it sounds like the Mavericks installer had a problem midway through its installation process. To fix this, you’re going to need to erase your internal disk and reïnstall your original version of OS X from the grey Mac OS X Install DVD, use Software Update  to get it back to 10.6.8 (presuming that your MacBook Pro originally came with Snow Leopard), and then restore from Time Machine.

  • How can I use my time capsule with windows7

    How can I use my time capsule with windows7?

    This is asked regularly.
    https://discussions.apple.com/message/10978060#10978060
    Look at the more like this. On the right column next to the post.
    Load airport utility for windows.. which will also load bonjour for windows.
    In windows explorer type \\TCname or \\TCipaddress (replacing with the actual values.. names with spaces will give you trouble so change all names in the TC to SMB compatible or actual ip address).

  • Using a Macbook 2008 with Lion 10.7.5, how can I project photos/keynote on smart tv screen? Macbook will not upgrade beyond Lion.

    Using a Macbook 2008 with Lion, 10.7.5, how can I project photos/keynote presentation on my smart tv? It is connected to tv with mini-dvi/hdmi cable, but I don't know how to display the images. Thanks!

    Did you switch the TV's input to the HDMI port you are using with the computer? Did you open Displays preferences to see if a second screen is displayed and then check the box to mirror to the TV screen? Did you search Google for any help links on how to do what you are trying to do?

  • For iPhone4 with iOS7, how can i see the time of day for a voice memo instead of the length of time for the recording?

    For iPhone 4S with iOS7 version 7.0.2, how can I see the time of day for a voice memo, as opposed to its length (of time)?

    For iPhone 4S with iOS7 version 7.0.2, how can I see the time of day for a voice memo, as opposed to its length (of time)?

  • How can I talk with more then one person at a time?

    How can I talk with more then one person at a time? With Faxe time? Is thier software needed to do this or can it be done with the basic package?

    You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
    If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker

  • How do I connect a 1 T time capsule to a new airport extreme so I can use it with time machine?

    How do I connect a 1 T time capsule to a new airport extreme so I can use it with time machine?

    Bridge the TC.. plug it into the AEBS with ethernet.

  • How can I get the time in Microsecond with JNI ?

    How can I get the time in Microsecond with JNI ?

    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceFrequency (JNIEnv *env, jobject obj) {
         LARGE_INTEGER lFrequency;
         ::QueryPerformanceFrequency(&lFrequency);
         return (jdouble)lFrequency.QuadPart;
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceCounter (JNIEnv *env, jobject obj) {
         LARGE_INTEGER lpCounter;
         ::QueryPerformanceCounter(&lpCounter);
         return (jdouble)lpCounter.QuadPart;

  • HT204380 how can i use face time with my ipad 2 and my wifes ipad mini if we both got the same apple id

    how can i use face time on my ipad 2 with my wife on her ipad mini if we both got the same apple id info

    Add another email.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%201A/45059983711d586099 0cb799efad0bb8_zpsd520c0d4.jpg

  • TS3999 how can i synch the time zone of the icloud in my pc with my iphone?

    how can i synch the time zone of the icloud in my pc with my iphone?

    Hi hmm15761,
    Thanks for visiting Apple Support Communities.
    This article may address your question:
    iCloud: Change your calendar’s time zone
    http://support.apple.com/kb/PH2677
    Best,
    Jeremy

  • How can we get current time date with resultset?

    Dear All,
    I have to insert current time date in the table.So,i need to get the current time and date with result set.So,I will first get the time date and then insert it into the table.
    I know how can we get current time and date without resultset.i have created this function its working.But now i want to use this.mean using resultset i want to put in the table.
    How can i do this?
    public static String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
    public static String now() {
    Calendar cal = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
    return sdf.format(cal.getTime());
    }

    yuck. Why not simply set a "new java.sql.Date()" to the SQL parameter in question?

  • How can I view my time capsule pic with my iPad

    How can I view my time capsule pic with my iPad

    What do you mean by "time capsule pic"
    Do you mean pictures stored on the TC?
    The ipad has no ability to access files.. so you need a file app.. there are plenty of them available.. filebrowser is one. What application you use to view files will depend on the format of the files.. google for that.
    The TC has no media server ability whatsoever.. it is a dumb as a board hard disk in a router. And should be treated as such.. especially to remember they die.. rather badly and suddenly.. and are difficult to backup should they do so.. it is design as a backup target for TM.. but TM cannot backup a TC or any other network drive.

  • I have just installed a 2TB time capsule on my iMac i7, it see my second 1TB hard drive but the 256 SSD doesn't come up in the list of hard drives I can back up. How can I enable the time machine to see my first SSD 256gb hard drive?

    I have just installed a 2TB time capsule on my iMac i7, it see my second 1TB hard drive but the 256 SSD doesn't come up in the list of hard drives I can back up. How can I enable the time machine to see my first SSD 256gb hard drive?

    iLife is preinstalled on all the Macs. If you purchased iLife in the App Store or your computer came without DVDs, open App Store > Purchases and download the applications. If your Mac came with discs, insert the Applications DVD and install iLife applications

  • How can I deal with long sql by the oo4o?

    I am using VB and oo4o to develop a sql executor which is a extention of an old system.
    For some reason, I have to use oo4o v8.1.7 to deal with Oracle Database 8i to 11g.
    But when I send a very long sql(11KB) to it I got a error in the VB enviroment.
    The Err.Description is "automention error. Started object is disconnected by the client.".
    The Err.Number is "-2147417848 ".
    The sql that I send it to the program is a simple select sql that like select a, b, c, substrb(d, 1, 2), substrb(e, 2, 3) .... from A_TBL where A=aa;
    This sql is normally executed by the sqlplus but I got an error by the oo4o.
    When I insert a '' between the 30Xth items, it got exectuted normally.
    ex. select a, b, c, substrb(d, 1, 2), substrb(e, 1, 2) ..... substrb(303th, 3, 4), '', substrb(304th, 1, 2) ... from A_TBL where A = aa;
    How can I deal with this problem? Thanks.

    So how can use this function correctly?By learning what exceptions are, how they're used, and what you can do to deal with them. There's a tutorial here: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.htmlAnd here's a quick overview:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

  • How can I sync with this library without erasing my data?

    The iPod "Sayira's iPod" is synced with another iTunes library. Do you want to erase this iPod and sync with this iTunes library? An iPod can be synced with only one iTunes library at a time. Erasing and syncing replaces the contents of this iPod with the contents of this iTunes library.
    So, okay, here's my story: My laptop caught a virus, so i sent it to this guy who fixes computers, now that my laptop is fixed, everything is deleted from it. I didn't really mind this too much, but anyway I redownloaded iTunes to my new hardrive and then it said the following (posted above). My question is, how can i sync with this new library without erasing any data from my apps (such as games, photos, videos, music)? I REALLY don't want to lose this data!

    - Transffer iTunes purchases to the computer by:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    - Transfer other music by using a third-party program like one of those discussed here.
    Copy music
    - Connect the iPod to the computer and make a backup by right clicking on the iPod under Devices in iTunes and select Back Up
    - Restore the IPod from that backup
    Note that the backup that iTunes makes does no include symec media like apps and music.

Maybe you are looking for