DBA Data[Home] [Help]

APPS.PA_OTC_API SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 32

    G_Trx_Inserted_Tab     Pa_Otc_Api.Trx_Inserted_Table;
Line: 36

    G_Trx_Direct_Upd_Tab   Pa_Otc_Api.Trx_Inserted_Table;
Line: 131

    G_Last_Update_Date_Tbl		Pa_Txn_Interface_Items_Pkg.Last_Update_Date_Typ;
Line: 132

    G_Last_Updated_By_Tbl		Pa_Txn_Interface_Items_Pkg.Last_Updated_By_Typ;
Line: 362

     l_Insert_Rec_Flag      Boolean := False;
Line: 364

     l_Direct_Update_Flag   Boolean := False;
Line: 376

     L_MAX_RECS_FOR_BULKINSERT          Number := 1000;
Line: 389

		    Select
			    h.Vendor_Id
		    Into
			    X_Vendor_Id
		    from
			    PO_Headers_All h,
		     	PO_Lines_All l
		    where
			    l.po_line_Id = P_Po_Line_Id
		    and	l.po_header_id = h.po_header_Id;
Line: 432

	    G_Stage := 'Call BulkInsertReset() procedure for reset.';
Line: 437

        Pa_Otc_Api.BulkInsertReset(P_Command => 'RESET');
Line: 445

        G_EndDateBatchName_Table.Delete;
Line: 458

     G_Trx_Inserted_Tab.Delete;
Line: 459

     G_Trx_Direct_Upd_Tab.Delete;
Line: 557

		               Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).Deleted = 'Y' Then

			             G_Stage := 'Item Changed: N, Deleted: Y.';
Line: 564

			             -- Even though the building block was deleted prior to being imported into projects
                         -- appearantly attribution data is created and sent via the Generic retrieval process
                         -- via the Generic retrieval process.  Need to sequence thru to position
                         -- the global index variable for the next bb to process.
                         -- Since it was deleted means it does not need to be imported into projects.
			             -- There is also no need to look at the old pl/sql tables records.

			            G_Stage := 'Call Populate Project Record new 1 for positioning purposes only.';
Line: 586

			            l_insert_rec_flag := FALSE;
Line: 589

		                  Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).Deleted = 'N' Then

			             -- If this is the condition then there is only new data to process via PopulateProjRec() procedure
			             -- and there is no need to look at the old data via the same procedure.

			             G_Stage := 'Item Changed: N, Deleted: N.';
Line: 627

				              l_insert_rec_flag := FALSE;
Line: 650

	                                -- Insert a new record.  There should be no records in either
	                        	    -- pl/sql tables t_old_detail_bld_blks or t_old_detail_attributes
	                        	    -- for this building block id.
	                        	    --

	                        	    l_insert_rec_flag := TRUE;
Line: 675

					                l_insert_rec_flag := FALSE;
Line: 683

                          Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).Deleted = 'N' Then

			             G_Stage := 'Item Changed: Y, Deleted: N.';
Line: 732

					               l_insert_rec_Flag := FALSE;
Line: 777

						                l_insert_rec_Flag := FALSE;
Line: 782

			 			                -- insert record into pa_transaction_interface or update tables
			        		            -- pa_expenditure_comments and/or pa_expenditure_items_all.
						                G_Stage := 'Call Determine Direct Update 3.';
Line: 790

						                Pa_Otc_Api.DetermineDirectUpdate(
					      		             P_New_Timecard_Rec   => l_New_Timecard_Rec,
					      		             P_Old_Timecard_Rec   => l_Old_Timecard_Rec,
					      		             P_Direct_Update_Flag => l_direct_update_flag,
					      		             P_Comment_or_Dff     => l_Comment_or_Dff);
Line: 796

						                If l_direct_update_flag Then

							                 l_insert_rec_flag := FALSE;
Line: 800

                                             G_Stage := 'Direct Update of the exp item in projects.  '  ||
                                                        'Need to update (C)omment, (D)ff, (B)oth: ' || l_Comment_or_Dff;
Line: 805

							                 G_Stage := 'Direct Update get trx ref. by calling GetOrigTrxRef '||
								                        'to use to update the expenditure item.';
Line: 819

							                      G_Stage := 'Update hxc exception pl/sql tables 1.';
Line: 831

							                 G_Stage := 'Call Update Changed Original Txn 3.';
Line: 837

							                 Pa_Otc_Api.UpdateChangedOrigTxn(
				        			              P_Old_Orig_Txn_Ref => l_old_orig_trx_ref,
               							          P_New_Orig_Txn_Ref => l_new_orig_trx_ref,
               							          P_Comment_or_Dff   => l_comment_or_dff,
               							          P_Timecard_Rec     => l_new_timecard_rec,
               							          P_User_Id          => P_User_Id);
Line: 845

                                                        'in tieback process 3a for directly updated ei.';
Line: 855

							                 l_insert_rec_flag := TRUE;
Line: 892

							                      G_Stage := 'Update hxc exception pl/sql tables 2.';
Line: 930

							                 G_Trx_Inserted_Tab(Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).BB_Id).BB_Index := i;
Line: 932

						                End If; -- l_direct_update_flag
Line: 983

				              l_insert_rec_Flag := FALSE;
Line: 988

		                  Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).Deleted = 'Y' Then

			             -- The item was deleted in OTL after it was imported into Projects.
                         -- Need to Reverse out the original transaction.

			             G_Stage := 'Item Changed: Y, Deleted: Y.';
Line: 997

			             l_insert_rec_flag := FALSE;
Line: 1147

				              G_Trx_Inserted_Tab(Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).BB_Id).BB_Index := i;
Line: 1151

		            End If; -- Change/Delete flags
Line: 1153

		            If l_insert_rec_flag Then

			             G_Stage := 'Get the next available Transaction Interface Id from sequence.';
Line: 1161

			             select pa_txn_interface_s.nextval
			             into l_txn_xface_id
			             from dual;
Line: 1170

			             G_Stage := 'Store Trx Import record in pl/sql arrays for bulk insert.';
Line: 1273

                         G_Last_Update_Date_Tbl(G_Trx_Import_Index) := sysdate;
Line: 1274

                         G_Last_Updated_By_Tbl(G_Trx_Import_Index) := P_User_Id;
Line: 1303

			             G_Trx_Inserted_Tab(Hxc_User_Type_Definition_Grp.T_Detail_Bld_Blks(i).BB_Id).BB_Index := i;
Line: 1307

		            G_Stage := 'Check if need to call bulk insert.';
Line: 1312

                    If G_Txn_Rec_Count >= L_MAX_RECS_FOR_BULKINSERT Then

			             G_Stage := 'Call BulkInsertReset() procedure for insert.';
Line: 1319

                         Pa_Otc_Api.BulkInsertReset(P_Command => 'INSERT');
Line: 1321

			             G_Stage := 'Store total records inserted. Reset counter to 0.';
Line: 1373

	      G_Stage := 'Exited the loop.  Check if need to call bulk insert for any remaining pl/sql records.';
Line: 1381

		       G_Stage := 'Call bulk insert for the remaining pl/sql records.';
Line: 1386

		       Pa_Otc_Api.BulkInsertReset(P_Command => 'INSERT');
Line: 1418

	      G_Stage := 'Call Hxc_Generic_Retrieval_Pkg.Update_Transaction_Status() one last time.';
Line: 1424

          Hxc_Integration_Layer_V1_Grp.Update_Transaction_Status
               (P_Process               => 'Projects Retrieval Process',
                P_Status                => 'SUCCESS',
                P_Exception_Description => NULL);
Line: 1446

          Hxc_Integration_Layer_V1_Grp.Update_Transaction_Status
               (P_Process               => 'Projects Retrieval Process',
                P_Status                => 'ERRORS',
                P_Exception_Description => l_Error_Text);
Line: 1498

         	   Hxc_Integration_Layer_V1_Grp.Update_Transaction_Status
             			(P_Process               => 'Projects Retrieval Process',
             			 P_Status                => 'ERRORS',
             			 P_Exception_Description =>
				          substr('Pa_Otc_Api ::: ' || G_Path || ' :: ' || G_Stage || ' : ' || SQLERRM, 1, 2000));
Line: 1541

	    P_User_Id                 IN Pa_Expenditure_Items_All.Last_Updated_By%TYPE,
	    P_Orig_Exp_Txn_Reference1 IN Pa_Expenditures_All.Orig_Exp_Txn_Reference1%TYPE,
	    P_Xface_Id                IN Pa_Transaction_Interface_All.Txn_Interface_Id%TYPE )

   Is

      l_txn_rowid           RowId := Null;
Line: 1606

	Select
		EI.Task_Id,
		EI.Project_Id, -- Changed from T.Project_Id
        E.Expenditure_Ending_Date,
		E.Incurred_By_Organization_Id,
		E.Incurred_By_Person_Id,
		EI.Expenditure_Item_Date,
        EI.Expenditure_Type,
		EI.System_Linkage_Function,
		-(EI.quantity),
		EI.Attribute_Category,
		EI.Attribute1,
		EI.Attribute2,
		EI.Attribute3,
		EI.Attribute4,
		EI.Attribute5,
		EI.Attribute6,
		EI.Attribute7,
		EI.Attribute8,
		EI.Attribute9,
		EI.Attribute10,
		EI.Assignment_Id,
		EI.Work_Type_Id,
		EI.Billable_Flag,
		EC.Expenditure_Comment,
		-- Begin CWK changes PA.M
		EI.PO_Line_Id,
		EI.PO_Price_Type,
		E.Person_Type,
		E.Vendor_Id,
		-- End CWK changes PA.M
        -- 12i changes
        ei.org_id
	Into
		l_Task_Id,
		l_Proj_Id,
        l_Exp_End_Date,
		l_Inc_By_Org_Id,
		l_Inc_By_Person_Id,
		l_Exp_Item_Date,
		l_Exp_Type,
		l_Sys_Link,
 		l_Quantity,
		l_Attribute_Category,
		l_Attribute1,
        l_Attribute2,
        l_Attribute3,
        l_Attribute4,
        l_Attribute5,
        l_Attribute6,
        l_Attribute7,
        l_Attribute8,
        l_Attribute9,
        l_Attribute10,
		l_Assignment_Id,
		l_Work_Type_Id,
		l_Billable_Flag,
		l_Exp_Comment,
		-- Begin CWK changes PA.M
		l_PO_Line_Id,
		l_PO_Price_Type,
		l_Person_Type,
		l_Vendor_Id,
		-- End CWK changes PA.M
        -- 12i changes
        l_org_id
	From
		Pa_Expenditure_Items EI,
		Pa_Expenditure_Comments EC,
		Pa_Expenditures E
-- 3457943 S.N.
		--Pa_Tasks T
-- 3457943 E.N.
	Where
-- 3457943 S.N.
		--T.Task_Id = EI.Task_Id
-- 3457943 E.N.
	    	E.Expenditure_Id = EI.Expenditure_Id
	And     EI.Expenditure_Item_Id = EC.Expenditure_Item_Id(+)
	And    	EI.Transaction_Source = 'ORACLE TIME AND LABOR'
	And    	EI.Orig_Transaction_Reference = P_Old_Orig_Trx_Ref
	And     Nvl(EI.Net_Zero_Adjustment_Flag,'N') = 'N'
        And     EI.Adjusted_Expenditure_Item_Id is Null;
Line: 1696

        Select Pa_Txn_Interface_S.NextVal
	Into l_Txn_Xface_Id
	From Dual;
Line: 1715

        G_Stage := 'Inserting reversing item into interface table BB/Ovn: ' || P_New_Orig_Trx_Ref ||
                   ' for Resource_Id(Person_Id): ' || to_char(l_Inc_By_Person_Id);
Line: 1720

	G_Stage := 'Store record for reversing item into arrays for bulk insert later.';
Line: 1816

        G_Last_Update_Date_Tbl(G_Trx_Import_Index) := SysDate;
Line: 1817

        G_Last_Updated_By_Tbl(G_Trx_Import_Index) := P_User_Id;
Line: 1885

   Procedure  UpdateChangedOrigTxn(
               P_Old_Orig_Txn_Ref   IN Pa_Expenditure_Items_All.Orig_Transaction_Reference%TYPE,
               P_New_Orig_Txn_Ref   IN Pa_Expenditure_Items_All.Orig_Transaction_Reference%TYPE,
               P_Comment_Or_Dff     IN Varchar2,
	           P_Timecard_Rec       IN Pa_Otc_Api.Timecard_Rec,
	           P_User_Id            IN Pa_Expenditure_Items_All.Last_Updated_By%TYPE)

   Is

        l_Exp_Item_Id 	    Pa_Expenditure_Items_All.Expenditure_Item_Id%TYPE := Null;
Line: 1896

	    l_Last_Update_Login Pa_Expenditure_Items_All.Last_Update_Login%TYPE := to_Number(Fnd_Profile.Value('LOGIN_ID'));
Line: 1903

        Select
               Count(*)
        From
               Pa_Expenditure_Comments
        Where
               Expenditure_Item_Id = P_Ei_Id;
Line: 1914

	    G_Stage := 'Entering UpdateChangedOrigTxn(), add procedure to trackpath.';
Line: 1919

	    Pa_Otc_Api.TrackPath('ADD','UpdateChangedOrigTxn');
Line: 1927

	    Select
		       RowId,
		       Expenditure_Item_Id
	    Into
		       l_RowId,
		       l_Exp_Item_Id
	    From
		       Pa_Expenditure_Items_All
	    Where
		       Transaction_Source = 'ORACLE TIME AND LABOR'
	    And     Orig_Transaction_Reference = P_Old_Orig_Txn_Ref
	    And	Net_Zero_Adjustment_Flag = 'N'; -- Bug 3480159
Line: 1946

	     * faster code due to potentially less updates taking place
	     * when P_Comment_Or_Dff has a value of B.
	     */
	    G_Stage := 'What updating needs to be done.';
Line: 1957

		    G_Stage := 'P_Comment_Or_Dff Is C: Update ei table.';
Line: 1963

		    Update Pa_Expenditure_Items_All
		    Set Orig_Transaction_Reference = P_New_Orig_Txn_Ref,
		        Last_Updated_By            = P_User_Id,
		        Last_Update_Date           = SysDate,
		        Last_Update_Login          = l_Last_Update_Login,
                        Request_id                 = x_request_id,        --Added for bug 4105561
                        Program_application_id     = x_program_application_id,
                        Program_id                 = x_program_id,
                        Program_update_date        = sysdate
		    Where Rowid = l_RowId ;
Line: 1980

			    G_Stage := 'P_Comment_Or_Dff Is C: Insert record into exp comment table.';
Line: 1986

			    Insert into Pa_Expenditure_Comments
			    (  	Expenditure_Item_Id,
 				    Line_Number,
 				    Last_Update_Date,
 				    Last_Updated_By,
 				    Creation_Date,
 				    Created_By,
 				    Expenditure_Comment,
 				    Last_Update_Login,
 				    Request_Id,
 				    Program_Id,
 				    Program_Application_Id,
 				    Program_Update_Date )
			    Values (
				    l_Exp_Item_Id,
				    10,
				    SysDate,
				    P_User_Id,
				    SysDate,
				    P_User_Id,
				    P_Timecard_Rec.Expenditure_Item_Comment,
				    l_Last_Update_Login,
		       		    X_request_id,   --Added for bug 4105561
				    X_program_id,
				    X_program_application_id,
				    sysdate);
Line: 2015

			    G_Stage := 'P_Comment_Or_Dff Is C: Update exp comment table.';
Line: 2021

			    Update Pa_Expenditure_Comments
			    Set Expenditure_Comment   = P_Timecard_Rec.Expenditure_Item_Comment,
			        Last_Updated_By       = P_User_Id,
			        Last_Update_Date      = SysDate,
			        Last_Update_Login     = l_Last_Update_Login,
                                Request_id            = x_request_id,        --Added for bug 4105561
                                Program_application_id= x_program_application_id,
                                Program_id            = x_program_id,
                                Program_update_date   = sysdate
			    Where Expenditure_Item_Id = l_exp_item_id ;
Line: 2035

                G_Stage := 'P_Comment_Or_Dff Is B: Remove exp comment from table since comment has been updated to null by the user.';
Line: 2041

                Delete From Pa_Expenditure_Comments
                Where Expenditure_Item_Id = l_Exp_Item_Id ;
Line: 2049

		    G_Stage := 'P_Comment_Or_Dff Is D: Update ei table.';
Line: 2055

		    Update Pa_Expenditure_Items_All
		    Set Orig_Transaction_Reference = P_New_Orig_Txn_Ref,
		        Attribute_category         = P_Timecard_Rec.Attribute_Category,
		        Attribute1                 = P_Timecard_Rec.Attribute1,
                Attribute2                 = P_Timecard_Rec.Attribute2,
                Attribute3                 = P_Timecard_Rec.Attribute3,
                Attribute4                 = P_Timecard_Rec.Attribute4,
                Attribute5                 = P_Timecard_Rec.Attribute5,
                Attribute6                 = P_Timecard_Rec.Attribute6,
                Attribute7                 = P_Timecard_Rec.Attribute7,
                Attribute8                 = P_Timecard_Rec.Attribute8,
                Attribute9                 = P_Timecard_Rec.Attribute9,
                Attribute10                = P_Timecard_Rec.Attribute10,
	        Last_Updated_By            = P_User_Id,
                Last_Update_Date           = SysDate,
                Last_Update_Login          = l_Last_Update_Login,
                Request_id                 = x_request_id,        --Added for bug 4105561
                Program_application_id     = x_program_application_id,
                Program_id                 = x_program_id,
		Program_update_date        = sysdate
            Where RowId = l_RowId ;
Line: 2085

                G_Stage := 'P_Comment_Or_Dff Is B: Insert record into exp comment table.';
Line: 2091

                Insert into Pa_Expenditure_Comments
                (       Expenditure_Item_Id,
                        Line_Number,
                        Last_Update_Date,
                        Last_Updated_By,
                        Creation_Date,
                        Created_By,
                        Expenditure_Comment,
                        Last_Update_Login,
                        Request_Id,
                        Program_Id,
                        Program_Application_Id,
                        Program_Update_Date )
                Values (
                        l_Exp_Item_Id,
                        10,
                        SysDate,
                        P_User_Id,
		        SysDate,
		        P_User_Id,
                        P_Timecard_Rec.Expenditure_Item_Comment,
                        l_Last_Update_Login,
			X_request_id,
			X_program_id,
			X_program_application_id,
			sysdate);
Line: 2120

	            G_Stage := 'P_Comment_Or_Dff Is B: Update exp comment table.';
Line: 2126

               	Update Pa_Expenditure_Comments
                Set Expenditure_Comment   = P_Timecard_Rec.Expenditure_Item_Comment,
                	Last_Updated_By       = P_User_Id,
                	Last_Update_Date      = SysDate,
                	Last_Update_Login     = l_Last_Update_Login,
                        Request_id            = x_request_id,        --Added for bug 4105561
                        Program_application_id= x_program_application_id,
                        Program_id            = x_program_id,
                        Program_update_date   = sysdate
                Where Expenditure_Item_Id = l_Exp_Item_Id ;
Line: 2140

                G_Stage := 'P_Comment_Or_Dff Is B: Remove exp comment from table since comment has been updated to null by the user.';
Line: 2146

                Delete From Pa_Expenditure_Comments
                Where Expenditure_Item_Id = l_Exp_Item_Id ;
Line: 2152

            G_Stage := 'P_Comment_Or_Dff Is B: Update ei table.';
Line: 2158

            Update Pa_Expenditure_Items_All
            Set Orig_Transaction_Reference = P_New_Orig_Txn_Ref,
                Attribute_category         = P_Timecard_Rec.Attribute_Category,
                Attribute1                 = P_Timecard_Rec.Attribute1,
                Attribute2                 = P_Timecard_Rec.Attribute2,
                Attribute3                 = P_Timecard_Rec.Attribute3,
                Attribute4                 = P_Timecard_Rec.Attribute4,
                Attribute5                 = P_Timecard_Rec.Attribute5,
                Attribute6                 = P_Timecard_Rec.Attribute6,
                Attribute7                 = P_Timecard_Rec.Attribute7,
                Attribute8                 = P_Timecard_Rec.Attribute8,
                Attribute9                 = P_Timecard_Rec.Attribute9,
                Attribute10                = P_Timecard_Rec.Attribute10,
                Last_Updated_By            = P_User_Id,
                Last_Update_Date           = SysDate,
                Last_Update_Login          = l_Last_Update_Login,
                Request_id                 = x_request_id,    --Added for bug 4105561
                Program_application_id     = x_program_application_id,
                Program_id                 = x_program_id,
                Program_update_date        = sysdate
            Where RowId = l_RowId ;
Line: 2182

	    G_Stage := 'Leaving UpdateChangedOrigTxn(), strip procedure from trackpath.';
Line: 2183

	    Pa_Otc_Api.TrackPath('STRIP','UpdateChangedOrigTxn');
Line: 2193

   End UpdateChangedOrigTxn;
Line: 2230

	Select To_Number(Substr(Orig_Transaction_Reference,1,Instr(Orig_Transaction_Reference,':') - 1)) Detail_BB_Id,
	       Transaction_Status_Code,
	       Transaction_Rejection_Code,
	       Txn_Interface_Id,
	       Expenditure_Id,
	       Expenditure_Item_Id,
	       Orig_Transaction_Reference,
	       Person_Id
	From
	       Pa_Transaction_Interface
	Where
	       Interface_Id = P_Interface_Id
	And    Transaction_Source = 'ORACLE TIME AND LABOR'
	And    Transaction_Status_Code in ('I','R')
	And    Pa_Otc_Api.TrxInCurrentChunk(To_Number(Substr(Orig_Transaction_Reference,1,Instr(Orig_Transaction_Reference,':') - 1))) = 'Y'
	Order by 7,3; -- Bug 3355510
Line: 2284

                    G_Stage := 'Update Detail Status to SUCCESS for BB_Id: ' || to_char(TrxRecord.Detail_BB_Id) ||
                               ' Index position is: ' || to_char((G_Trx_Inserted_Tab(TrxRecord.Detail_BB_Id).BB_Index));
Line: 2290

		    Hxc_User_Type_Definition_Grp.T_Tx_Detail_Status(G_Trx_Inserted_Tab(TrxRecord.Detail_BB_Id).BB_Index) :=
										'SUCCESS';
Line: 2295

                    G_Stage := 'Update Detail Status to ERRORS for BB_Id: ' || to_char(TrxRecord.Detail_BB_Id) ||
                               ' Index position is: ' || to_char((G_Trx_Inserted_Tab(TrxRecord.Detail_BB_Id).BB_Index));
Line: 2303

		     * more than it currently is.  We have to make sure that we don't try to update rejected
		     * Trx records from other loops that have already been ran.  They are at a status of 'R'
		     * So we check to first see if it exists in the pl/sql table and then if it does
		     * we update the otl pl/sql table accordingly run.
		     */

                   Hxc_User_Type_Definition_Grp.T_Tx_Detail_Status(G_Trx_Inserted_Tab(TrxRecord.Detail_BB_Id).BB_Index) := 'ERRORS';
Line: 2314

		   	Hxc_User_Type_Definition_Grp.T_Tx_Detail_Exception(G_Trx_Inserted_Tab(TrxRecord.Detail_BB_Id).BB_Index) :=
 					Substr(Fnd_Message.Get,1,2000);
Line: 2346

	G_Stage := 'Update the Transaction_Status_Code for successful transactions in interface table.';
Line: 2352

	Update Pa_Transaction_Interface
	Set
              Transaction_Status_Code = 'A'
	Where
              Interface_Id = P_Xface_Id
	And   Transaction_Status_Code = 'I';
Line: 2359

	G_Stage := 'Loop thru and flag as success those building blocks where we directly updated the eis.';
Line: 2377

			 * records that were inserted.
			 * DO NOT CHANGE THIS SO WE DO NOT GET ANY NO_DATA_FOUND ERRORS.
			 */
			j := G_Trx_Direct_Upd_Tab.Next(j);
Line: 2384

                G_Stage := 'Update Detail Status to SUCCESS for direct updated ei BB_Id: ' || to_char(j) ||
                           '  Index position is: ' || to_char((G_Trx_Direct_Upd_Tab(j).BB_Index));
Line: 2398

	G_Stage := 'Call OTL API to update transactions';
Line: 2405

	Hxc_Integration_Layer_V1_Grp.Update_Transaction_Status (
				    P_Process               => 'Projects Retrieval Process',
                                    P_Status                => 'SUCCESS',
                                    P_Exception_Description => NULL);
Line: 2431

                Hxc_Integration_Layer_V1_Grp.Update_Transaction_Status (
                                    P_Process               => 'Projects Retrieval Process',
                                    P_Status                => 'ERRORS',
                                    P_Exception_Description => Pa_Debug.G_err_Stage);
Line: 2464

  Procedure DetermineDirectUpdate(
			P_New_Timecard_Rec   IN         Pa_Otc_Api.Timecard_Rec,
			P_Old_Timecard_Rec   IN         Pa_Otc_Api.Timecard_Rec,
                        P_Direct_Update_Flag OUT NOCOPY Boolean,
                        P_Comment_Or_Dff     OUT NOCOPY Varchar2) IS

	l_Others_Changed  Boolean := False;
Line: 2476

	G_Stage := 'Entering DetermineDirectUpdate(), add procedure to trackpath.';
Line: 2481

	Pa_Otc_Api.TrackPath('ADD','DetermineDirectUpdate');
Line: 2543

		G_Stage := 'No Direct Update.';
Line: 2548

		/* No direct update since other columns have been updated besides
		 * the comments and DFFs.
		 */
		P_Direct_Update_Flag := FALSE;
Line: 2555

		/* Looks like the comment or DFFS where updated in
		 * OTL so will do direct updating of the tables instead of
		 * using TRX_IMPORT.
		 */

		G_Stage := 'Direct Update.';
Line: 2566

		P_Direct_Update_Flag := TRUE;
Line: 2570

			G_Stage := 'Direct Update - Both.';
Line: 2575

			/* Update both the comment in the comment table and
			 * the DFFs in the ei table.
			 */
			P_Comment_Or_Dff := 'B';
Line: 2582

			G_Stage := 'Direct Update - Comment only.';
Line: 2587

			/* Only need to update the comment in the comment table */
			P_Comment_Or_Dff := 'C';
Line: 2592

			G_Stage := 'Direct Update - DFFs only.';
Line: 2597

			/* Only need to update the DFFs in the ei table. */
			P_Comment_Or_Dff := 'D';
Line: 2604

	G_Stage := 'Leaving DetermineDirectUpdate(), strip procedure from trackpath.';
Line: 2609

	Pa_Otc_Api.TrackPath('STRIP','DetermineDirectUpdate');
Line: 2615

  End DetermineDirectUpdate;
Line: 4006

/* UPDATE and VALIDATION ROUTINES */

-- ========================================================================
-- Start Of Comments
-- API Name      : Projects_Retrieval_Process
-- Type          : Public
-- Pre-Reqs      : None
-- Type          : Function
-- Return        : Varchar2
-- Function      : This function is called to provide the retrieval process name so that the appropriate
--                 attribution is retrieved for validation.
--

/*--------------------------------------------------------------------------*/


   Function Projects_Retrieval_Process RETURN Varchar2

   Is

        l_retrieval_process Hxc_Time_Recipients.Application_Retrieval_Function%TYPE;
Line: 4055

  Procedure Update_Otc_Data
            (P_Operation            IN Varchar2)

  Is

	l_Blocks     Hxc_User_Type_Definition_Grp.Timecard_Info;
Line: 4068

        G_Stage := 'Entering Update_Otc_Data() procedure.';
Line: 4069

        Pa_Otc_Api.TrackPath('ADD','Update_Otc_Data');
Line: 4079

		G_Stage := 'Call the Upate_Process() to update the billable flag.';
Line: 4080

		Pa_Otc_Api.Update_Process (
					P_Operation       => P_Operation,
                    P_Building_Blocks => l_Blocks,
                    P_Attribute_Table => l_Attributes);
Line: 4093

        G_Stage := 'Leaving Update_Otc_Data() procedure.';
Line: 4094

        Pa_Otc_Api.TrackPath('STRIP','Update_Otc_Data');
Line: 4100

  End Update_Otc_Data;
Line: 4129

  Procedure Update_Process(
                      P_Operation         IN     Varchar2,
                      P_Building_Blocks   IN OUT NOCOPY Hxc_User_Type_Definition_Grp.Timecard_Info, -- 2672653
                      P_Attribute_Table   IN OUT NOCOPY Hxc_User_Type_Definition_Grp.App_Attributes_Info) -- 2672653

  Is

	    l_Proj_Attrib_Rec           Pa_Otc_Api.Project_Attribution_Rec;
Line: 4142

        l_BB_Detail_Deleted         Varchar2(1)    := 'N';  -- The OTL item has been deleted.
Line: 4144

        l_Data_Conflict_Flag        Varchar2(1)    := 'N';  -- If attempt to delete,update after already saved change or
Line: 4169

	G_Stage := 'Entering procedure Update_Process().';
Line: 4170

        Pa_Otc_Api.TrackPath('ADD','Update_Process');
Line: 4220

                        P_Mode                 => 'UPDATE',
                        P_Process_Flag         => P_Building_Blocks(i).Process,
                        X_BB_Detail_Changed    => l_BB_Detail_Changed,
                        X_Data_Conflict_Flag   => l_Data_Conflict_Flag,
                        X_BB_Detail_Deleted    => l_BB_Detail_Deleted,
                        X_Adj_in_Projects_Flag => l_Adjusted_In_Projects);
Line: 4227

		     If l_BB_Detail_Deleted = 'N' and
		       (l_BB_Detail_Changed = 'Y' or P_Building_Blocks(i).New = 'Y') and
		        l_Adjusted_In_Projects = 'N' and
		        l_Data_Conflict_Flag = 'N' Then

			      l_Status := Null;
Line: 4308

		End If;  -- Detail building block not deleted and has changed.
Line: 4317

	G_Stage := 'Leaving procedure Update_Process().';
Line: 4318

	Pa_Otc_Api.TrackPath('STRIP','Update_Process');
Line: 4324

  End Update_Process;
Line: 4437

        l_BB_Detail_Deleted         Varchar2(1) := 'N';  -- The OTL item has been deleted.
Line: 4438

        l_Data_Conflict_Flag        Varchar2(1) := 'N';  -- If attempt to delete,update after already saved change or
Line: 4506

        Select
               Meaning
        From
               Fnd_Lookups
        Where
               Lookup_Type = 'YES_NO'
        And    Lookup_Code = P_Lookup_Code;
Line: 4516

		select max(person_id) from per_all_assignments_f paf,per_assignment_status_types past
		where paf.person_id = p_person_id
		and  paf.assignment_status_type_id = past.assignment_status_type_id
		and  past.per_system_status = 'TERM_ASSIGN';
Line: 4672

			       X_BB_Detail_Deleted    => l_BB_Detail_Deleted,
                   X_Adj_in_Projects_Flag => l_Adjusted_In_Projects);
Line: 4692

		   	      If l_BB_Detail_Deleted = 'Y' Then

				       G_Stage := 'Building Block has been deleted.';
Line: 4701

					        G_Stage := 'Not allowed to delete Item In OTL data conflict - Inserting error rec.';
Line: 4703

                            G_Msg_Tokens_Table.Delete;
Line: 4717

					        G_Stage := 'Not allowed to Delete Item In OTL - Inserting error rec.';
Line: 4718

					        G_Msg_Tokens_Table.Delete;
Line: 4732

			      End If; -- l_BB_Detail_Deleted is Y
Line: 4734

                  If l_BB_Detail_Changed = 'Y' and l_BB_Detail_Deleted = 'N' Then

				       If l_Data_Conflict_Flag = 'Y' Then

					        -- Really don't need to process this record any further.
					        -- The timecard cannot be save due to this.  Period!

                            G_Stage := 'Not allowed to Adjust Item In OTL confict - Inserting error rec.';
Line: 4742

					        G_Msg_Tokens_Table.Delete;
Line: 4756

					        G_Stage := 'Not allowed to Adjust Item In OTL - Inserting error rec.';
Line: 4758

					        G_Msg_Tokens_Table.Delete;
Line: 4772

                  End If;  -- l_BB_Detail_Changed is Y and l_BB_Detail_Deleted is N
Line: 4776

		     If l_BB_Detail_Deleted = 'N' and
		        l_Adjusted_In_Projects = 'N' and
		        ( l_BB_Detail_Changed = 'Y' or P_Building_Blocks(i).New = 'Y') Then

			      G_Stage := 'Check the Unit Of Measure value.';
Line: 4786

                       G_Stage := 'Cannot have data where UOM is not HOURS - Inserting error rec.';
Line: 4788

                       G_Msg_Tokens_Table.Delete;
Line: 4812

                       G_Stage := 'Negative quantity not allowed In OTL - Inserting error rec.';
Line: 4813

                       G_Msg_Tokens_Table.Delete;
Line: 4830

	                   G_Stage := 'Invalid Person Type - Inserting error rec.';
Line: 4831

        	           G_Msg_Tokens_Table.Delete;
Line: 4849

	                        G_Stage := 'Project organization does not allow CWK timecards - Inserting error rec.';
Line: 4850

        	                G_Msg_Tokens_Table.Delete;
Line: 4870

	                                  G_Stage := 'Price Type is null - Inserting error rec.';
Line: 4871

        	                          G_Msg_Tokens_Table.Delete;
Line: 4885

	                                  G_Stage := 'Derived Vendor Id is null - Inserting error rec.';
Line: 4886

        	                          G_Msg_Tokens_Table.Delete;
Line: 4918

				       G_Stage := 'Get Project Number - Inserting error rec.';
Line: 4919

                       G_Msg_Tokens_Table.Delete;
Line: 4945

				       G_Stage := 'Get Task Number - Inserting error rec.';
Line: 4946

                       G_Msg_Tokens_Table.Delete;
Line: 4973

				       G_Stage := 'Validate the exp type and syst link func - Inserting error rec.';
Line: 4976

                       G_Msg_Tokens_Table.Delete;
Line: 5005

				       G_Stage := 'Invalid sys link func - Inserting error rec.';
Line: 5008

				       G_Msg_Tokens_Table.Delete;
Line: 5031

				       G_Stage := 'Get Inc by Org Id - Inserting error rec.';
Line: 5032

                       G_Msg_Tokens_Table.Delete;
Line: 5064

                            G_Msg_Tokens_Table.Delete;
Line: 5070

					        G_Stage := 'Check Job Id - Inserting error rec.';
Line: 5141

  					        G_Msg_Tokens_Table.Delete;
Line: 5227

					        G_Stage := 'Patc returned status that is Not Null - Inserting error rec.';
Line: 5228

                            G_Msg_Tokens_Table.Delete;
Line: 5315

                                  * in update phase of validation logic and billable no longer
                                  * matches what patc returns.
                                  */

                                  G_Stage := 'Get translated value for Billable_flag code using fnd_lookups.';
Line: 5331

                                  G_Stage := 'Invalid external change of billable flag  - Inserting error rec.';
Line: 5332

                                  G_Msg_Tokens_Table.Delete;
Line: 5361

					         * in update phase of validation logic and billable no longer
					         * matches what patc returns.
					         */

					        G_Stage := 'Get translated value for Billable_flag code using fnd_lookups.';
Line: 5377

                            G_Stage := 'Invalid external change of billable flag  - Inserting error rec.';
Line: 5378

	                        G_Msg_Tokens_Table.Delete;
Line: 5398

             End If; -- l_Adjusted_In_Projects = 'N' and l_BB_Detail_Changed = 'Y' and l_BB_Detail_Deleted = 'N'
Line: 5400

             If P_Message_Table.Count = 0 and l_BB_Detail_Deleted = 'N' Then

			      -- Add ei record to l_Timecard_Table
			      G_Stage := 'Add ei record to l_Timecard_Table for use by extensions.';
Line: 5445

			      G_Stage := 'Reset variable used for table insert';
Line: 5478

			G_Stage := 'Calling Summary-validation Extension - Insert Error Rec.';
Line: 5479

            G_Msg_Tokens_Table.Delete;
Line: 5513

                  G_Stage := 'Calling Business Message API - Insert Business Rec Msg.';
Line: 5514

		          G_Msg_Tokens_Table.Delete;
Line: 5609

	Select
                Project_Number
	From
                Pa_Online_Projects_V
	Where
                Project_Id = P_Proj_Id; */
Line: 5617

    select
          p.segment1
    from  Pa_Online_Projects_V pp,
          pa_projects_all p
    where pp.Project_Id = P_Proj_Id
    and   pp.project_id = p.project_id;
Line: 5721

	Select
              Task_Number
	From
              Pa_Online_Tasks_V
	Where
              Task_Id    = P_Tsk_Id
	And       Project_Id = P_Prj_Id; */
Line: 5731

    select
          t.task_number
    from  pa_online_tasks_v tt,
          pa_tasks t
    where
          tt.task_id    = P_Tsk_Id
    and   tt.project_id = P_Prj_Id
    and   t.task_id     = tt.task_id;
Line: 5840

      Select
             System_Linkage_Function,
             Expenditure_Type
      From
             Pa_Online_Expenditure_Types_V
      Where
             System_Linkage_Function = P_Sys_Link_Func
      And    Expenditure_Type        = P_Exp_Type
      And    P_Exp_Item_Date Between Sys_Link_Start_Date_Active
				                 And Nvl(Sys_Link_End_Date_Active,P_EI_Date)
      And    P_Exp_Item_Date Between Expnd_Typ_Start_Date_Active
				                 And Nvl(Expnd_Typ_End_Date_Active,P_EI_Date)
      And    system_linkage_function in ('ST','OT'); -- bug 5020394
Line: 5934

      		Select
                        Distinct
			Person_Id
      		Into
			X_Approver_Id
      		From
			Pa_Exp_Ovrrde_Approver_V
      		Where
			Person_Id = P_Approver_Id;
Line: 6010

		X_BB_Detail_Deleted    OUT NOCOPY Varchar2,
		X_Adj_in_Projects_Flag OUT NOCOPY Varchar2)

   Is

	l_Orig_Trx_Ref     Pa_Expenditure_Items_All.Orig_Transaction_Reference%TYPE := Null;
Line: 6024

	Select
		RowId,
		Expenditure_Item_Id,
                Net_Zero_Adjustment_Flag,
		Orig_Transaction_Reference
        From
                Pa_Expenditure_Items_All
        Where
                Transaction_Source = 'ORACLE TIME AND LABOR'
        And     Orig_Transaction_Reference like l_orig_trx_ref
	Order By Orig_Transaction_Reference;
Line: 6037

        Select
		'Y'
        From
		Pa_Expenditure_Items_All ei,
                Pa_Expenditure_Comments c
	Where
          	ei.Expenditure_Item_Id            =  c.Expenditure_Item_Id(+)
	And    (ei.Task_Id                        <> nvl(P_Proj_Attribute_Rec.Task_Id,-99)
        Or      ei.Expenditure_Type               <> nvl(P_Proj_Attribute_Rec.Expenditure_Type,'-999999999')
        Or      ei.System_Linkage_Function        <> nvl(P_Proj_Attribute_Rec.Sys_Linkage_Func,'-99')
        Or      ei.Quantity                       <> nvl(P_Proj_Attribute_Rec.Quantity,-99)
        Or      nvl(ei.Attribute_Category,'-99')  <> nvl(P_Proj_Attribute_Rec.Attrib_Category,'-99')
        Or      nvl(ei.Attribute1,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute1,'-99')
        Or      nvl(ei.Attribute2,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute2,'-99')
        Or      nvl(ei.Attribute3,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute3,'-99')
        Or      nvl(ei.Attribute4,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute4,'-99')
        Or      nvl(ei.Attribute5,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute5,'-99')
        Or      nvl(ei.Attribute6,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute6,'-99')
        Or      nvl(ei.Attribute7,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute7,'-99')
        Or      nvl(ei.Attribute8,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute8,'-99')
        Or      nvl(ei.Attribute9,'-99')          <> nvl(P_Proj_Attribute_Rec.Attribute9,'-99')
        Or      nvl(ei.Attribute10,'-99')         <> nvl(P_Proj_Attribute_Rec.Attribute10,'-99')
        Or      nvl(c.Expenditure_Comment,'-99')  <> nvl(P_Proj_Attribute_Rec.Expenditure_Item_Comment,'-99')
        Or      nvl(ei.PO_Line_Id,-99)            <> nvl(P_Proj_Attribute_Rec.PO_Line_Id,-99)
        Or      nvl(ei.PO_Price_Type,'-99')       <> nvl(P_Proj_Attribute_Rec.PO_Price_Type,'-99') )
        And     ei.RowId                          =  P_RowId;
Line: 6078

        X_BB_Detail_Deleted    := 'N';
Line: 6081

        G_Stage := 'Check for deleted detail bb.';
Line: 6084

		G_Stage := 'Detail bb block has been deleted.';
Line: 6085

               	X_BB_Detail_Deleted := 'Y';
Line: 6089

	-- If an item has been deleted in OTL then P_BB_Changed = Y as well.

	G_Stage := 'Check and setting the ovn value to scan Project ei table with';
Line: 6098

	ElsIf X_BB_Detail_Deleted = 'Y' Then

        G_Stage := 'The detail scope bb is being deleted.';
Line: 6203

				   X_BB_Detail_Deleted = 'N' Then

			   	   	G_Stage := 'Only Ovn has changed.  Update the orig_transaction_reference of the ei.';
Line: 6206

                    Update Pa_Expenditure_Items
                    Set
                         Orig_Transaction_Reference = To_Char(P_BB_Id) || ':' || To_Char(l_Ovn_Check_Value),
                         last_update_date = sysdate,
                         last_updated_by = to_Number(Fnd_Profile.Value('USER_ID')),
                         last_update_login = to_Number(Fnd_Profile.Value('LOGIN_ID'))
                    Where
                         RowId = l_RowId;
Line: 6220

			      /* Bug 2283011  The changed_flag is coming in as 'N' for deleted items not 'Y' so
                                 we don't need to consider it value then.
		 		ElsIf P_BB_Changed = 'Y' and */
				ElsIf X_BB_Detail_Deleted = 'Y' and
				      l_Net_Zero_flag = 'Y' Then

					G_Stage := 'BB/EI has been already changed in Projects, so cannot delete.';
Line: 6241

				   	If P_BB_Changed = 'N' and X_BB_Detail_Deleted = 'N' Then

				   		G_Stage := 'Data conflict exists.';
Line: 7184

                  select mc.segment
                  Into   G_Billable_Segment
                  from hxc_mapping_components mc,
                  hxc_bld_blk_info_types bbit
                  where mc.field_name = 'BILLABLE_FLAG'
                  and bbit.bld_blk_info_type_id = mc.bld_blk_info_type_id
                  and bbit.bld_blk_info_type = 'PROJECTS';
Line: 7208

                  P_Attribute_Table(billable_index).updated := 'N';
Line: 7368

	Select
		FI.Project_Id,
		P.Segment1,
		FI.Item_Date,
		FI.Expenditure_Type,
		FI.Expenditure_Type_Class,
		FI.Item_Quantity
	From
		Pa_Forecast_Items FI,
		Pa_Projects_All P,
		Pa_Project_Assignments PPA
	Where
		Person_Id = P_Emp_Id
	And	Item_Date Between P_Start_Date
	                      And P_Stop_Date
	And Forecast_Item_Type in ('A','U')
    And FI.Project_Id = P.Project_Id
	And PPA.assignment_id = FI.assignment_id
	And FI.delete_flag = 'N'
	And Nvl(FI.expenditure_org_id,-99) = Nvl(P_Exp_Org_Id,-99)
	And Nvl(FI.Item_Quantity,0) <> 0
    Order by 2,4,3; -- project/exp_type/item_date
Line: 7398

    Select
            FI.Project_Id,
            P.Segment1,
            FI.Item_Date,
            FI.Expenditure_Type,
            FI.Expenditure_Type_Class,
            FI.Item_Quantity
    From
            Pa_Forecast_Items FI,
            Pa_Projects_All P
    Where
            Person_Id = P_Emp_Id
    And Item_Date Between P_Start_Date
                      And P_Stop_Date
    And Forecast_Item_Type = 'A'
    And FI.Project_Id = P.Project_Id
    And FI.delete_flag = 'N'
    And FI.expenditure_org_id = P_Exp_Org_Id
    And FI.Item_Quantity <> 0
    Order by 2,4,3; -- project/exp_type/item_date
Line: 7426

    Select
            FI.Project_Id,
            P.Segment1,
            FI.Item_Date,
            FI.Expenditure_Type,
            FI.Expenditure_Type_Class,
            FI.Item_Quantity
    From
            Pa_Forecast_Items FI,
            Pa_Projects_All P,
            Pa_Resource_Txn_Attributes PTA
    Where
            PTA.Person_Id = P_Emp_Id
    And FI.Resource_id = PTA.Resource_id
    And FI.Item_Date Between P_Start_Date
                     And P_Stop_Date
    And FI.Forecast_Item_Type = 'A'
    And FI.Project_Id = P.Project_Id
    And FI.delete_flag = 'N'
    And FI.expenditure_org_id = P_Exp_Org_Id
    And FI.Item_Quantity <> 0
    Order by 2,4,3; -- project/exp_type/item_date
Line: 7469

	-- Select
	-- 	'Y'
	-- From
	-- 	Pa_Online_Projects_V
	-- Where
    -- 	Project_Id = P_Project_Id;
Line: 7495

	l_Message_Table.Delete;
Line: 7496

    l_Building_Blocks_Table.Delete;
Line: 7497

    l_Attribute_Table.Delete;
Line: 7498

    l_dummy_bb_Table.Delete;
Line: 7499

    l_dummy_Attrib_Table.Delete;
Line: 7517

             G_Msg_Tokens_Table.Delete;
Line: 7553

		-- Insert Timecard Scope record
		G_Stage := 'Build/Insert Timecard Scope BB record.';
Line: 7576

		-- Insert Day Scope records.
		G_Stage := 'Build/Insert day scope records using loop based on the number of days in timecard period.';
Line: 7660

				G_Stage := 'Building and insert detail scope record.';
Line: 7699

				G_Stage := 'Building and insert detail scope attribution records.';
Line: 7702

				G_Stage := 'Building and insert detail scope attribution record project_Id.';
Line: 7709

                l_Attribute_Table(l_Attrib_Index).Updated := 'N';
Line: 7715

				G_Stage := 'Building and insert detail scope attribution record Expenditure Type.';
Line: 7722

                l_Attribute_Table(l_Attrib_Index).Updated := 'N';
Line: 7728

				G_Stage := 'Building and insert detail scope attribution record Expenditure_Type_Class.';
Line: 7735

                l_Attribute_Table(l_Attrib_Index).Updated := 'N';
Line: 7742

				G_Msg_Tokens_Table.Delete;
Line: 7867

	     select hrp.period_type
	       from hxc_recurring_periods hrp
	      where hrp.recurring_period_id = p_rec_id;
Line: 7872

	      Select max(effective_end_date) from per_people_f
	      where person_id = p_person_id and
	      effective_end_date <= p_stop_date and
	      (current_employee_flag = 'Y' or current_npw_flag = 'Y');
Line: 7930

				           G_Msg_Tokens_Table.Delete;
Line: 7996

                                     G_Stage := 'Validate Overriding Approver - Inserting error rec.';
Line: 7997

				                     G_Msg_Tokens_Table.Delete;
Line: 8028

                           G_Msg_Tokens_Table.Delete;
Line: 8122

        l_Timecard_Table.delete;
Line: 8123

	l_Message_Table.delete;
Line: 8148

		G_Msg_Tokens_Table.Delete;
Line: 8184

                         G_Msg_Tokens_Table.Delete;
Line: 8297

        l_Timecard_Table.Delete;
Line: 8343

                	G_Msg_Tokens_Table.Delete;
Line: 8452

				G_Msg_Tokens_Table.Delete;
Line: 8468

				G_Msg_Tokens_Table.Delete;
Line: 8552

	X_Timecard_Table.delete;
Line: 8681

	Select
               'Y'
	Into
               l_Exists_Flag
	From
               Pa_Expenditure_Items_All
	Where
               Transaction_Source = 'ORACLE TIME AND LABOR'
	And    Orig_Transaction_Reference = P_Orig_Transaction_Reference;
Line: 8849

        	Select
                       To_Char(P_Exp_End_Date,'YYMMDD')
        	Into
                       l_Date_String
        	From
                       Dual;
Line: 8862

        	SELECT
                       Mod(Pa_Expenditure_Groups_S.NextVal,1000)
        	INTO
                       l_Sequence_No
        	FROM
                       Dual;
Line: 8988

	Select
		Orig_Transaction_Reference
	Into
		X_OrigTrxRef
	From
		Pa_Expenditure_Items_All
	Where
		Orig_Transaction_Reference like l_Search
	And   	Transaction_Source = 'ORACLE TIME AND LABOR'
	And     Nvl(Net_Zero_Adjustment_Flag,'N') = 'N'
	And     Adjusted_Expenditure_Item_Id is Null
	And 	to_number(substr(Orig_Transaction_Reference,instr(Orig_Transaction_Reference,':') + 1)) = (
		Select
		    	Max(to_Number(Substr(Orig_Transaction_Reference,instr(Orig_Transaction_Reference,':') + 1)))
		From
		    	Pa_Expenditure_Items_All
		Where
		    	Orig_Transaction_Reference like l_Search
		And 	Transaction_Source = 'ORACLE TIME AND LABOR'
                And     Nvl(Net_Zero_Adjustment_Flag,'N') = 'N'
		And     Adjusted_Expenditure_Item_Id is Null);
Line: 9138

  Procedure BulkInsertReset (P_Command IN Varchar2)

  Is

  Begin

	G_Stage := 'Entering BulkInsertReset(), add procedure to trackpath.';
Line: 9147

	   pa_cc_utils.log_message('BulkInsertReset: ' || Pa_Debug.G_Err_Stage,0);
Line: 9149

	Pa_Otc_Api.TrackPath('ADD','BulkInsertReset');
Line: 9151

	If P_Command = 'INSERT' Then

		G_Stage := 'Bulk Insert records into Interface table via Pa_Txn_Interface_Items_Pkg.Bulk_Insert().';
Line: 9156

		   pa_cc_utils.log_message('BulkInsertReset: ' || Pa_Debug.G_Err_Stage,0);
Line: 9159

		Pa_Txn_Interface_Items_Pkg.Bulk_Insert(
			   P_Txn_Interface_Id_Tbl               => G_Txn_Interface_Id_Tbl,
			   P_Transaction_Source_Tbl             => G_Transaction_Source_Tbl,
			   P_User_Transaction_Source_Tbl        => G_User_Transaction_Source_Tbl,
			   P_Batch_Name_Tbl                     => G_Batch_Name_Tbl,
			   P_Expenditure_End_Date_Tbl           => G_Expenditure_End_Date_Tbl,
			   P_Person_Bus_Grp_Name_Tbl            => G_Person_Bus_Grp_Name_Tbl,
			   P_Person_Bus_Grp_Id_Tbl              => G_Person_Bus_Grp_Id_Tbl,
			   P_Employee_Number_Tbl                => G_Employee_Number_Tbl,
			   P_Person_Id_Tbl                      => G_Person_Id_Tbl,
			   P_Organization_Name_Tbl              => G_Organization_Name_Tbl,
			   P_Organization_Id_Tbl                => G_Organization_Id_Tbl,
			   P_Expenditure_Item_Date_Tbl          => G_Expenditure_Item_Date_Tbl,
			   P_Project_Number_Tbl                 => G_Project_Number_Tbl,
			   P_Project_Id_Tbl                     => G_Project_Id_Tbl,
			   P_Task_Number_Tbl                    => G_Task_Number_Tbl,
			   P_Task_Id_Tbl                        => G_Task_Id_Tbl,
			   P_Expenditure_Type_Tbl               => G_Expenditure_Type_Tbl,
			   P_System_Linkage_Tbl                 => G_System_Linkage_Tbl,
			   P_Non_Labor_Resource_Tbl             => G_Non_Labor_Resource_Tbl,
			   P_Non_Labor_Res_Org_Name_Tbl         => G_Non_Labor_Res_Org_Name_Tbl,
			   P_Non_Labor_Res_Org_Id_Tbl           => G_Non_Labor_Res_Org_Id_Tbl,
			   P_Quantity_Tbl                       => G_Quantity_Tbl,
			   P_Raw_Cost_Tbl                       => G_Raw_Cost_Tbl,
			   P_Raw_Cost_Rate_Tbl                  => G_Raw_Cost_Rate_Tbl,
			   P_Burden_Cost_Tbl                    => G_Burden_Cost_Tbl,
			   P_Burden_Cost_Rate_Tbl               => G_Burden_Cost_Rate_Tbl,
			   P_Expenditure_Comment_Tbl            => G_Expenditure_Comment_Tbl,
			   P_Gl_Date_Tbl                        => G_Gl_Date_Tbl,
			   P_Transaction_Status_Code_Tbl        => G_Transaction_Status_Code_Tbl,
			   P_Trans_Rejection_Code_Tbl           => G_Trans_Rejection_Code_Tbl,
			   P_Orig_Trans_Reference_Tbl           => G_Orig_Trans_Reference_Tbl,
			   P_Unmatched_Neg_Txn_Flag_Tbl         => G_Unmatched_Neg_Txn_Flag_Tbl,
			   P_Expenditure_Id_Tbl                 => G_Expenditure_Id_Tbl,
			   P_Attribute_Category_Tbl             => G_Attribute_Category_Tbl,
			   P_Attribute1_Tbl                     => G_Attribute1_Tbl,
			   P_Attribute2_Tbl                     => G_Attribute2_Tbl,
			   P_Attribute3_Tbl                     => G_Attribute3_Tbl,
			   P_Attribute4_Tbl                     => G_Attribute4_Tbl,
			   P_Attribute5_Tbl                     => G_Attribute5_Tbl,
			   P_Attribute6_Tbl                     => G_Attribute6_Tbl,
			   P_Attribute7_Tbl                     => G_Attribute7_Tbl,
			   P_Attribute8_Tbl                     => G_Attribute8_Tbl,
			   P_Attribute9_Tbl                     => G_Attribute9_Tbl,
			   P_Attribute10_Tbl                    => G_Attribute10_Tbl,
			   P_Dr_Code_Combination_Id_Tbl         => G_Dr_Code_Combination_Id_Tbl,
			   P_Cr_Code_Combination_Id_Tbl         => G_Cr_Code_Combination_Id_Tbl,
			   P_Cdl_System_Reference1_Tbl          => G_Cdl_System_Reference1_Tbl,
			   P_Cdl_System_Reference2_Tbl          => G_Cdl_System_Reference2_Tbl,
			   P_Cdl_System_Reference3_Tbl          => G_Cdl_System_Reference3_Tbl,
			   P_Interface_Id_Tbl                   => G_Interface_Id_Tbl,
			   P_Receipt_Currency_Amount_Tbl        => G_Receipt_Currency_Amount_Tbl,
			   P_Receipt_Currency_Code_Tbl          => G_Receipt_Currency_Code_Tbl,
			   P_Receipt_Exchange_Rate_Tbl          => G_Receipt_Exchange_Rate_Tbl,
			   P_Denom_Currency_Code_Tbl            => G_Denom_Currency_Code_Tbl,
			   P_Denom_Raw_Cost_Tbl                 => G_Denom_Raw_Cost_Tbl,
			   P_Denom_Burdened_Cost_Tbl            => G_Denom_Burdened_Cost_Tbl,
			   P_Acct_Rate_Date_Tbl                 => G_Acct_Rate_Date_Tbl,
			   P_Acct_Rate_Type_Tbl                 => G_Acct_Rate_Type_Tbl,
			   P_Acct_Exchange_Rate_Tbl             => G_Acct_Exchange_Rate_Tbl,
			   P_Acct_Raw_Cost_Tbl                  => G_Acct_Raw_Cost_Tbl,
			   P_Acct_Burdened_Cost_Tbl             => G_Acct_Burdened_Cost_Tbl,
			   P_Acct_Exch_Rounding_Limit_Tbl       => G_Acct_Exch_Rounding_Limit_Tbl,
			   P_Project_Currency_Code_Tbl          => G_Project_Currency_Code_Tbl,
			   P_Project_Rate_Date_Tbl              => G_Project_Rate_Date_Tbl,
			   P_Project_Rate_Type_Tbl              => G_Project_Rate_Type_Tbl,
			   P_Project_Exchange_Rate_Tbl          => G_Project_Exchange_Rate_Tbl,
			   P_Orig_Exp_Txn_Reference1_Tbl        => G_Orig_Exp_Txn_Reference1_Tbl,
			   P_Orig_Exp_Txn_Reference2_Tbl        => G_Orig_Exp_Txn_Reference2_Tbl,
			   P_Orig_Exp_Txn_Reference3_Tbl        => G_Orig_Exp_Txn_Reference3_Tbl,
			   P_Orig_User_Exp_Txn_Ref_Tbl          => G_Orig_User_Exp_Txn_Ref_Tbl,
			   P_Vendor_Number_Tbl                  => G_Vendor_Number_Tbl,
			   P_Vendor_Id_Tbl                      => G_Vendor_Id_Tbl,
			   P_Override_To_Org_Name_Tbl           => G_Override_To_Org_Name_Tbl,
			   P_Override_To_Org_Id_Tbl             => G_Override_To_Org_Id_Tbl,
			   P_Reversed_Orig_Txn_Ref_Tbl          => G_Reversed_Orig_Txn_Ref_Tbl,
			   P_Billable_Flag_Tbl                  => G_Billable_Flag_Tbl,
			   P_ProjFunc_Currency_Code_Tbl         => G_ProjFunc_Currency_Code_Tbl,
			   P_ProjFunc_Cost_Rate_Date_Tbl        => G_ProjFunc_Cost_Rate_Date_Tbl,
			   P_ProjFunc_Cost_Rate_Type_Tbl        => G_ProjFunc_Cost_Rate_Type_Tbl,
			   P_ProjFunc_Cost_Exch_Rate_Tbl        => G_ProjFunc_Cost_Exch_Rate_Tbl,
			   P_Project_Raw_Cost_Tbl               => G_Project_Raw_Cost_Tbl,
			   P_Project_Burdened_Cost_Tbl          => G_Project_Burdened_Cost_Tbl,
			   P_Assignment_Name_Tbl                => G_Assignment_Name_Tbl,
			   P_Assignment_Id_Tbl                  => G_Assignment_Id_Tbl,
			   P_Work_Type_Name_Tbl                 => G_Work_Type_Name_Tbl,
			   P_Work_Type_Id_Tbl                   => G_Work_Type_Id_Tbl,
			   P_Cdl_System_Reference4_Tbl          => G_Cdl_System_Reference4_Tbl,
			   P_Accrual_Flag_Tbl                   => G_Accrual_Flag_Tbl,
			   P_Last_Update_Date_Tbl               => G_Last_Update_Date_Tbl,
			   P_Last_Updated_By_Tbl                => G_Last_Updated_By_Tbl,
			   P_Creation_Date_Tbl                  => G_Creation_Date_Tbl,
			   P_Created_By_Tbl                     => G_Created_By_Tbl,
			   P_PO_Number_Tbl			            => G_PO_Number_Tbl,
			   P_PO_Header_Id_Tbl			        => G_PO_Header_Id_Tbl,
			   P_PO_Line_Num_Tbl			        => G_PO_Line_Num_Tbl,
			   P_PO_Line_Id_Tbl                     => G_PO_Line_Id_Tbl,
			   P_PO_Price_Type_Tbl                  => G_PO_Price_Type_Tbl,
			   P_Person_Type_Tbl                    => G_Person_Type_Tbl,
			   P_Inventory_Item_Id_Tbl              => G_Inventory_Item_Id_Tbl,
			   P_WIP_Resource_Id_Tbl		        => G_WIP_Resource_Id_Tbl,
    		   P_Unit_Of_Measure_Tbl		        => G_Unit_Of_Measure_Tbl,
               P_Org_Id_Tbl                         => G_OU_Tbl);
Line: 9265

	If P_Command in ( 'INSERT', 'RESET' ) Then

        G_Stage := 'Reset all pl/sql table arrays used for bulk insert.';
Line: 9270

             pa_cc_utils.log_message('BulkInsertReset: ' || Pa_Debug.G_Err_Stage,0);
Line: 9273

		G_Txn_Interface_Id_Tbl.Delete;
Line: 9274

		G_Transaction_Source_Tbl.Delete;
Line: 9275

		G_User_Transaction_Source_Tbl.Delete;
Line: 9276

		G_Batch_Name_Tbl.Delete;
Line: 9277

		G_Expenditure_End_Date_Tbl.Delete;
Line: 9278

		G_Person_Bus_Grp_Name_Tbl.Delete;
Line: 9279

		G_Person_Bus_Grp_Id_Tbl.Delete;
Line: 9280

		G_Employee_Number_Tbl.Delete;
Line: 9281

		G_Person_Id_Tbl.Delete;
Line: 9282

		G_Organization_Name_Tbl.Delete;
Line: 9283

		G_Organization_Id_Tbl.Delete;
Line: 9284

		G_Expenditure_Item_Date_Tbl.Delete;
Line: 9285

		G_Project_Number_Tbl.Delete;
Line: 9286

		G_Project_Id_Tbl.Delete;
Line: 9287

		G_Task_Number_Tbl.Delete;
Line: 9288

		G_Task_Id_Tbl.Delete;
Line: 9289

		G_Expenditure_Type_Tbl.Delete;
Line: 9290

		G_System_Linkage_Tbl.Delete;
Line: 9291

		G_Non_Labor_Resource_Tbl.Delete;
Line: 9292

		G_Non_Labor_Res_Org_Name_Tbl.Delete;
Line: 9293

		G_Non_Labor_Res_Org_Id_Tbl.Delete;
Line: 9294

		G_Quantity_Tbl.Delete;
Line: 9295

		G_Raw_Cost_Tbl.Delete;
Line: 9296

		G_Raw_Cost_Rate_Tbl.Delete;
Line: 9297

		G_Burden_Cost_Tbl.Delete;
Line: 9298

		G_Burden_Cost_Rate_Tbl.Delete;
Line: 9299

		G_Expenditure_Comment_Tbl.Delete;
Line: 9300

		G_Gl_Date_Tbl.Delete;
Line: 9301

		G_Transaction_Status_Code_Tbl.Delete;
Line: 9302

		G_Trans_Rejection_Code_Tbl.Delete;
Line: 9303

		G_Orig_Trans_Reference_Tbl.Delete;
Line: 9304

		G_Unmatched_Neg_Txn_Flag_Tbl.Delete;
Line: 9305

		G_Expenditure_Id_Tbl.Delete;
Line: 9306

		G_Attribute_Category_Tbl.Delete;
Line: 9307

		G_Attribute1_Tbl.Delete;
Line: 9308

		G_Attribute2_Tbl.Delete;
Line: 9309

		G_Attribute3_Tbl.Delete;
Line: 9310

		G_Attribute4_Tbl.Delete;
Line: 9311

		G_Attribute5_Tbl.Delete;
Line: 9312

		G_Attribute6_Tbl.Delete;
Line: 9313

		G_Attribute7_Tbl.Delete;
Line: 9314

		G_Attribute8_Tbl.Delete;
Line: 9315

		G_Attribute9_Tbl.Delete;
Line: 9316

		G_Attribute10_Tbl.Delete;
Line: 9317

		G_Dr_Code_Combination_Id_Tbl.Delete;
Line: 9318

		G_Cr_Code_Combination_Id_Tbl.Delete;
Line: 9319

		G_Cdl_System_Reference1_Tbl.Delete;
Line: 9320

		G_Cdl_System_Reference2_Tbl.Delete;
Line: 9321

		G_Cdl_System_Reference3_Tbl.Delete;
Line: 9322

		G_Interface_Id_Tbl.Delete;
Line: 9323

		G_Receipt_Currency_Amount_Tbl.Delete;
Line: 9324

		G_Receipt_Currency_Code_Tbl.Delete;
Line: 9325

		G_Receipt_Exchange_Rate_Tbl.Delete;
Line: 9326

		G_Denom_Currency_Code_Tbl.Delete;
Line: 9327

		G_Denom_Raw_Cost_Tbl.Delete;
Line: 9328

		G_Denom_Burdened_Cost_Tbl.Delete;
Line: 9329

		G_Acct_Rate_Date_Tbl.Delete;
Line: 9330

		G_Acct_Rate_Type_Tbl.Delete;
Line: 9331

		G_Acct_Exchange_Rate_Tbl.Delete;
Line: 9332

		G_Acct_Raw_Cost_Tbl.Delete;
Line: 9333

		G_Acct_Burdened_Cost_Tbl.Delete;
Line: 9334

		G_Acct_Exch_Rounding_Limit_Tbl.Delete;
Line: 9335

		G_Project_Currency_Code_Tbl.Delete;
Line: 9336

		G_Project_Rate_Date_Tbl.Delete;
Line: 9337

		G_Project_Rate_Type_Tbl.Delete;
Line: 9338

		G_Project_Exchange_Rate_Tbl.Delete;
Line: 9339

		G_Orig_Exp_Txn_Reference1_Tbl.Delete;
Line: 9340

		G_Orig_Exp_Txn_Reference2_Tbl.Delete;
Line: 9341

		G_Orig_Exp_Txn_Reference3_Tbl.Delete;
Line: 9342

		G_Orig_User_Exp_Txn_Ref_Tbl.Delete;
Line: 9343

		G_Vendor_Number_Tbl.Delete;
Line: 9344

		G_Vendor_Id_Tbl.Delete;
Line: 9345

		G_Override_To_Org_Name_Tbl.Delete;
Line: 9346

		G_Override_To_Org_Id_Tbl.Delete;
Line: 9347

		G_Reversed_Orig_Txn_Ref_Tbl.Delete;
Line: 9348

		G_Billable_Flag_Tbl.Delete;
Line: 9349

		G_ProjFunc_Currency_Code_Tbl.Delete;
Line: 9350

		G_ProjFunc_Cost_Rate_Date_Tbl.Delete;
Line: 9351

		G_ProjFunc_Cost_Rate_Type_Tbl.Delete;
Line: 9352

		G_ProjFunc_Cost_Exch_Rate_Tbl.Delete;
Line: 9353

		G_Project_Raw_Cost_Tbl.Delete;
Line: 9354

		G_Project_Burdened_Cost_Tbl.Delete;
Line: 9355

		G_Assignment_Name_Tbl.Delete;
Line: 9356

		G_Assignment_Id_Tbl.Delete;
Line: 9357

		G_Work_Type_Name_Tbl.Delete;
Line: 9358

		G_Work_Type_Id_Tbl.Delete;
Line: 9359

		G_Cdl_System_Reference4_Tbl.Delete;
Line: 9360

		G_Accrual_Flag_Tbl.Delete;
Line: 9361

		G_Last_Update_Date_Tbl.Delete;
Line: 9362

		G_Last_Updated_By_Tbl.Delete;
Line: 9363

		G_Creation_Date_Tbl.Delete;
Line: 9364

		G_Created_By_Tbl.Delete;
Line: 9366

		G_PO_Number_Tbl.Delete;
Line: 9367

		G_PO_Header_Id_Tbl.Delete;
Line: 9368

		G_PO_Line_Num_Tbl.Delete;
Line: 9369

		G_PO_Line_Id_Tbl.Delete;
Line: 9370

		G_PO_Price_Type_Tbl.Delete;
Line: 9371

		G_Person_Type_Tbl.Delete;
Line: 9373

		G_Inventory_Item_Id_Tbl.Delete;
Line: 9374

		G_WIP_Resource_Id_Tbl.Delete;
Line: 9375

    	G_Unit_Of_Measure_Tbl.Delete;
Line: 9377

        G_OU_Tbl.Delete;
Line: 9381

    G_Stage := 'Leaving BulkInsertReset(), strip procedure from trackpath.';
Line: 9384

         Pa_Cc_Utils.Log_Message('BulkInsertReset: ' || Pa_Debug.G_Err_Stage,0);
Line: 9386

    Pa_Otc_Api.TrackPath('STRIP','BulkInsertReset');
Line: 9392

  End BulkInsertReset;
Line: 9420

        If G_Trx_Inserted_Tab.Exists(P_Detail_BB_Id) Then

                Return ( 'Y' );
Line: 9495

	Select
		Decode(Current_Npw_Flag,'Y','CWK','EMP')
	Into
		X_Person_Type
	From
		Per_People_F
	Where
		P_Ei_Date between Effective_Start_Date
			      and Effective_End_Date
	And	Person_Id = P_Person_Id;
Line: 9546

		Select
			h.Vendor_Id,
			h.Po_Header_Id
		Into
			l_Vendor_Id,
			l_Po_Header_Id
		from
			PO_Headers_All h,
		     	PO_Lines_All l
		where
			l.po_line_Id = P_Po_Line_Id
		and	l.po_header_id = h.po_header_Id;