Clarity

 View Only
  • 1.  XOG Adjusted Timesheets

    Posted Mar 04, 2008 12:02 AM
    [left] Hi All, [left]  [left] I want to import adjusted timesheets in Clarity 8.1. We are managing timesheets in another system and we are importing monthly timesheets in Clarity at the end of the month. However, I also need to adjust timesheets of previous months. These adjusted timesheets should be created through XOG. So, I used the following XML to import the timesheet. [left]  [left]

         
         
                 
                         
                                 
                                         
                                                 
                                                         
                                                                 
                                                         
                                                 
                                         
                                 
                         
                 
         

    [left]
    This file gives me an error saying [left]  [left]  
          FATAL
          XOG-2028: Cannot create new time sheet because one already exists for resource: leo in timeperiod : 2008-02-01T00:00:00
         
         
         
         
    [left]
      [left] Can you guys give any suggestions? [left]  [left] Thanks in advance, [left]  [left] Leo. [left]


  • 2.  Re: XOG Adjusted Timesheets

    Posted Mar 12, 2008 09:33 AM
    Leo,[left]  [left] I too  attempted to write and XOG in adjusted timesheets. Couldn't figure out the syntax. My workaround was to create a timesheet new via xog (for a different timeperiod). Then update the appropriate fields via sql to make it an adjusted timesheet for the correct timeperiod. Definitely a kludge.[left]  [left] Interested to find out other "correct" solutions.[left] Mc[left]


  • 3.  Re: XOG Adjusted Timesheets
    Best Answer

    Posted Mar 27, 2008 07:25 AM
    Hi All,

    I found a solution for the problem. However, I'm not sure if CA support agrees with this solution.
    Anyways, here it is.
    I create a new timesheet for the same timeperiod and same resource, by inserting new row in the database and put the value of the PRADJUSTEDID = previous posted timesheetid. Then, I use the prj_timeperiods_write.xml to xog time-entries for the newly created timesheet.

    Below is the stored procedure to create an adjusted timesheet ID. It takes the posted timesheet ID as parameter.

    CREATE OR REPLACE PROCEDURE Z_CREATE_TIMESHEET_ADJUSTMENT (timesheetID IN NUMBER)
    AS
    temp NUMBER;
    periodID NUMBER;
    resourceID NUMBER;
    status NUMBER;
    BEGIN
    SELECT PRTIMEPERIODID, PRRESOURCEID, PRSTATUS INTO periodID, resourceID, status
    FROM PRTIMESHEET
    WHERE PRID = timesheetID;
    IF (status = 4) THEN
    SELECT PRTIMESHEET_S1.NEXTVAL INTO temp FROM DUAL;
    INSERT INTO PRTIMESHEET(PRUID, PRID, PRTIMEPERIODID, PRRESOURCEID, PRSTATUS, PRVERSION, PRISADJUSTMENT, PRADJUSTEDID, PRMODBY, PRMODTIME)
    VALUES ('PRTIMESHEETUID'||temp, temp, periodID, resourceID, 0, 1, 1, timesheetID, 1, SYSDATE);
    COMMIT;
    END IF;
    END;


    Regards,

    Leo.


  • 4.  Re: XOG Adjusted Timesheets

    Posted Jun 19, 2016 06:35 PM

    Hi Leo,

     

    Thanks for the suggested work around. I was using this solution but came across a couple of questions.

    1. Since we are doing it in SQL server, sequences don't exist do you know how should I handle the new time sheet creation.

    2. I also tried it in one of the Oracle instances and I was able to create the adjusted timesheet and also able to xog the the data in the newly created timesheet, but when I try to submit the timesheet it gives me an error that "cannot obtain lock on the timesheet". I also tried xogging in the timesheet withcstatus approved or submitted but it always xogs in the timesheet with status 0. I was just wondering if you came across these issues.

     

    Would appreciate if you have any recommendations for this.

     

    Regards

    Deepak