DBA Data[Home] [Help]

APPS.PA_PURGE_VALIDATE_COSTING SQL Statements

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

Line: 43

      select 'NOT COST DISTRIBUTED'
        from dual
       where exists (
		select ei.expenditure_item_id
                from pa_expenditure_items_all ei
                where ei.project_id = p_project_id
                and ( p_active_flag <> 'A'
                  or (trunc(ei.expenditure_item_date ) <=
				          trunc(p_txn_to_date ) ))
                and nvl(ei.cost_distributed_flag, 'N') <> 'Y') ;
Line: 55

      select 'NOT IMPORTED'
        from dual
       where exists (
		select 'X'
                from pa_transaction_interface_all it,
                     pa_projects t
                where it.project_number = t.segment1
                and t.project_id = p_project_id
                and ( p_active_flag <> 'A'
                   or (trunc(it.expenditure_item_date ) <=
					trunc(p_txn_to_date  ) ))
                and it.transaction_status_code <> 'A') ;
Line: 69

      select 'NOT Transferred and Accepted in other system'
        from dual
       where exists (
		select ei.expenditure_item_id
                from  pa_expenditure_items_all ei,
                      pa_cost_distribution_lines_all cdl
                where ei.expenditure_item_id = cdl.expenditure_item_id
              and ei.system_linkage_function not in ('VI', 'ER')  /* Bug#2427766 */
/*                and ei.system_linkage_function <> 'VI'  Bug#2616111 */
                and ei.project_id = p_project_id
                and ( p_active_flag <> 'A'
                   or (trunc(ei.expenditure_item_date ) <=
					trunc(p_txn_to_date  ) ))
                and (cdl.transfer_status_code not in ( 'A','V','G') /** 4317826 **/
		or exists (select 1
		             from xla_events xe
                            where xe.event_id = cdl.acct_event_id
			      and xe.event_status_code <> 'P'
			      and xe.process_status_code <> 'P')));
Line: 90

                or  exists (select reference26
                            from pa_gl_interface gl
                            where
                                gl.user_je_source_name || '' = P_User_Source_Name
                            and gl.reference26 = cdl.batch_name
			    and ((gl.Status NOT LIKE 'W%'
                                 and gl.Status <> 'NEW'
                                 and gl.Status <> 'PROCESSED')
                              or
			         gl.Status = 'NEW')))) ;
Line: 105

     select 'MRC NOT Transferred and Accepted in other system'
     from dual
     where exists (
     	select ei.expenditure_item_id
        from   pa_expenditure_items_all ei,
               pa_mc_cost_dist_lines_all mrccdl
        where ei.expenditure_item_id = mrccdl.expenditure_item_id
        and ei.system_linkage_function not in ('VI', 'ER')
        and ei.project_id = p_project_id
        and ( p_active_flag <> 'A'
            or (trunc(ei.expenditure_item_date ) <= trunc(p_txn_to_date  ) ))
        and (mrccdl.transfer_status_code not in ('A','V','G')
        or  exists (select reference26
                    from pa_gl_interface gl
                    where
                        gl.user_je_source_name || '' = P_User_Source_Name
                    and gl.reference26 = mrccdl.batch_name
                    and ((gl.Status NOT LIKE 'W%'
                         and gl.Status <> 'NEW'
                         and gl.Status <> 'PROCESSED')
                       or
                         gl.Status = 'NEW')))) ;
Line: 130

      select 'Cost not accumulated'
        from dual
       where exists (
		select ei.expenditure_item_id
                from pa_expenditure_items_all ei,
                     pa_cost_distribution_lines_all cdl
                where ei.expenditure_item_id = cdl.expenditure_item_id
                and ei.project_id = p_project_id
                and ( p_active_flag <> 'A'
                    or (trunc(ei.expenditure_item_date ) <=
					trunc(p_txn_to_date  ) ))
                and cdl.line_type = 'R'
                and nvl(cdl.resource_accumulated_flag, 'N') <> 'Y') ;
Line: 145

      select 'Not Burden Distributed'
        from dual
       where exists (
		select ei.expenditure_item_id
                from pa_expenditure_items_all ei,
                     pa_project_types_all pt,
                     pa_tasks t,
                     pa_projects_all p
                where ei.task_id = t.task_id
                and t.project_id = p.project_id
                and t.project_id = p_project_id
                and p.project_type = pt.project_type
                and pt.org_id = p.org_id -- Removed NVL for bug#590817 by vvjoshi
                and pt.burden_cost_flag = 'Y'
                and ( p_active_flag <> 'A'
                   or (trunc(ei.expenditure_item_date ) <=
					trunc(p_txn_to_date  ) ))) ;
Line: 168

      select 'INTERCOMPANY EIs INV EXISTS'
        from dual
      where exists (
               select ei.expenditure_item_id
               from pa_expenditure_items_all ei,
                    pa_tasks t
               where ei.task_id = t.task_id
               and   t.project_id = p_project_id
               and   ei.cc_cross_charge_code = 'I')
      or exists   (
               select null
               from   pa_draft_invoice_details_all di
               where  di.cc_project_id = p_project_id );
Line: 184

      select 'NOT BL DISTRIBUTED'
        from dual
       where exists (
		select ei.expenditure_item_id
                from pa_expenditure_items_all ei
                where ei.project_id = p_project_id
                and ( p_active_flag <> 'A'
                  or trunc(ei.expenditure_item_date) <= trunc(p_txn_to_date)  )
                and ei.cc_cross_charge_code = 'B'
                and ei.cc_bl_distributed_code <> 'Y') ;
Line: 196

      select 'NOT Transferred and Accepted in other system'
        from dual
       where exists (
		select ei.expenditure_item_id
                from pa_expenditure_items_all ei,
                     pa_cc_dist_lines_all ccdl
                where ei.expenditure_item_id = ccdl.expenditure_item_id
                and ei.project_id = p_project_id
                and ( p_active_flag <> 'A'
                   or (trunc(ei.expenditure_item_date ) <=
					trunc(p_txn_to_date  ) ))
                and (ccdl.transfer_status_code not in ( 'A','V')
		or exists (select 1
		             from xla_events xe
                            where xe.event_id = ccdl.acct_event_id
			      and xe.event_status_code <> 'P'
			      and xe.process_status_code <> 'P')));
Line: 215

                or  exists (select reference26
                            from pa_gl_interface gl
                            where
                                gl.user_je_source_name || '' = P_User_Source_Name
                            and gl.reference26 = ccdl.gl_batch_name
			    and ((gl.Status NOT LIKE 'W%'
                                 and gl.Status <> 'NEW'
                                 and gl.Status <> 'PROCESSED')
                              or
			         gl.Status = 'NEW')))) ;
Line: 229

      select 'This project is defined as a destination project in project type'
        from dual
       where exists (
		select project_type
		  from pa_project_types
	         where burden_sum_dest_project_id = p_project_id
		    );
Line: 246

SELECT 'VENDOR INVOICE NOT FULLY PAID'
FROM   dual
WHERE EXISTS ( SELECT aid.invoice_id
               FROM   ap_invoices_all ai,
   	      	      ap_invoice_distributions_all aid
-- bug 2404115	       WHERE  ai.project_id = p_project_id
	       WHERE  aid.project_id = p_project_id
               AND    nvl(ai.invoice_amount,0) <> 0 /* Bug 5063560 */
	       AND    ai.invoice_id = aid.invoice_id
               AND    ai.invoice_type_lookup_code <> 'EXPENSE REPORT'
               AND    (p_active_flag <> 'A' or
-- bug 2404115                       ai.expenditure_item_date < p_txn_to_date)
                       trunc(aid.expenditure_item_date) <= trunc(p_txn_to_date))
               AND    aid.pa_addition_flag = 'Y'
	       AND    nvl(ai.payment_status_flag,'N') <> 'Y'
               AND    nvl(aid.reversal_flag, 'N') <> 'Y'    /* 4065283 */
/* Bug#2407614. For all the supplier invoices check if payment has been done.
	       AND    exists (SELECT NULL
			      FROM   ap_payment_schedules_all aps
			      WHERE  aps.invoice_id = ai.invoice_id
			      AND    nvl(aps.discount_amount_available, 0) > 0
			      AND    nvl(aps.amount_remaining, 0 ) > 0
			     ) */
             );
Line: 274

      select 'This is an Inter-Project Receiver Project'
        from dual
       where exists ( select NULL
                        from pa_tasks pt
                       where pt.project_id = p_project_id
                         and pt.receive_project_invoice_flag = 'Y'
                         and exists ( select NULL
				      from   pa_project_customers ppc
				      where  ppc.receiver_task_id = pt.task_id )
                    );
Line: 288

    select 'Discount Not Interfaced'
    from dual
    where exists (
    select null from ap_invoices ai,
                     ap_invoice_distributions aid,
                     -- ap_invoice_payments pay --R12 change
                     ap_payment_hist_dists paydist
    where aid.project_id = p_project_id
    and   ai.invoice_id = aid.invoice_id
    -- and   paydist.invoice_id = ai.invoice_id -- R12 change
    -- and   pay.discount_taken <> 0 -- R12 change
    and   paydist.invoice_distribution_id = aid.invoice_distribution_id
    and   paydist.amount <> 0
    and   ai.invoice_type_lookup_code <> 'EXPENSE REPORT'
    and   paydist.pay_dist_lookup_code = 'DISCOUNT'
    and   paydist.pa_addition_flag  = 'N'
    and   aid.expenditure_item_date >= nvl(to_date(fnd_profile.value_specific('PA_DISC_PULL_START_DATE'),'YYYY/MM/DD'),to_date('01/01/2051','DD/MM/YYYY'))  /* Bug 3134267 */ /*Bug4124600*/ /*Bug 6855026*/
  /* --Commented for R12
    and   not exists
           ( select 'X' from pa_cost_distribution_lines cdl
             where cdl.system_reference2=to_char(aid.invoice_id)
             and cdl.system_reference3=to_char(aid.distribution_line_number)
             and cdl.system_reference4=to_char(pay.invoice_payment_id)
           )
  */
   );
Line: 318

   select 'Organization Forecast Project'
   from dual
   where exists (
              select null from pa_projects pj,
                               pa_project_types pt
              where pj.project_id = p_project_id
              and   pj.project_type = pt.project_type
              and   pt.org_project_flag = 'Y'
                );
Line: 332

      select 'Unassigned Time Project Type'
      from dual
      where exists ( select    pt.project_type
                     from      pa_project_types pt,
                               pa_projects p
                      where    p.project_id = p_project_id
                      and      pt.project_type = p.project_type
                      and      nvl(pt.unassigned_time, 'N') = 'Y' );
Line: 345

      select 'Iexpense Transactions Pending'
      from dual
      where exists (select h.report_header_id
                    from   ap_expense_report_headers h,
                           ap_expense_report_lines l
                    where  h.report_header_id = l.report_header_id
                    and    h.source <> 'Oracle Project Accounting'
                    and    l.project_id = p_project_id
                    and    ( p_active_flag <> 'A'
                             or (trunc(l.expenditure_item_date ) <=
                                          trunc(p_txn_to_date ) ))
                    and    nvl(l.pa_interfaced_flag,'N') <> 'Y'); */
Line: 361

     select 'Iexpense Transactions Pending'
     from dual
     where exists (
                   select null
                   from   ap_expense_report_headers h,
                          ap_expense_report_lines l
                   where  l.project_id = p_project_id
                   and    (p_active_flag <> 'A'
                           or (trunc(l.expenditure_item_date ) <=
                                                        trunc(p_txn_to_date )))
                   and    l.report_header_id = h.report_header_id
                   and    h.source <> 'Oracle Project Accounting'
                   and    not exists (
                                      select null
                                      from  ap_invoice_distributions d
                                      where d.invoice_id = h.vouchno
                                      and d.pa_addition_flag IN ('Z','T','E','Y')));
Line: 382

      SELECT 'EXPENSE REPORTS NOT FULLY PAID'
      FROM   dual
      WHERE EXISTS ( SELECT aid.invoice_id
                     FROM   ap_invoices_all ai,
   	      	            ap_invoice_distributions_all aid
	             WHERE  aid.project_id = p_project_id
	             AND    ai.invoice_id = aid.invoice_id
                     AND    ai.invoice_type_lookup_code = 'EXPENSE REPORT'
                     AND    (p_active_flag <> 'A' or
                             trunc(aid.expenditure_item_date) <=
                                                 trunc(p_txn_to_date))
	             AND    nvl(ai.payment_status_flag,'N') <> 'Y' );
Line: 410

      V_Delete_Allowed  VARCHAR2(1);
Line: 464

     SELECT user_je_source_name
     INTO   l_user_source_name
     FROM   GL_Je_Sources
     WHERE je_source_name='Project Accounting';
Line: 675

     IF ( NOT PNP_OTH_PROD.delete_project (p_project_id) ) then
        fnd_message.set_name('PA', 'PA_ARPR_PROJ_INUSE_PROP_MGR');
Line: 689

   call to the procedure IGC_CC_PROJECTS_PKG.delete_project for bug#2272487
       IF ( NOT IGC_CC_PROJECTS_PKG.delete_project (p_project_id) ) then
        fnd_message.set_name('PA', 'PA_ARPR_PROJ_INUSE_CNTR_CMTS');
Line: 703

       select count(*) into l_igc_exists
	 from fnd_product_installations
        where application_id = 8407
        and   status <> 'N';
Line: 713

                     IGC_CC_PROJECTS_PKG.delete_project (:project_id, :delete_allowed);
Line: 719

       DBMS_SQL.BIND_VARIABLE(V_CursorID, ':delete_allowed', V_Delete_Allowed, 1);
Line: 723

       DBMS_SQL.VARIABLE_VALUE(V_CursorID, ':delete_allowed', V_Delete_Allowed);
Line: 727

       IF ( V_Delete_Allowed = 'N' ) then
           fnd_message.set_name('PA', 'PA_ARPR_PROJ_INUSE_CNTR_CMTS');
Line: 809

     select to_number(replace(release_name,'.'))
     into   l_dummy_num
     from fnd_product_groups;
Line: 814

	     V_Stmt := 'select ' || '''Iexpense Transactions Pending''' ||
			' from dual '||
			' where exists (select h.report_header_id '||
			    ' from   ap_expense_report_headers h, '||
				   ' ap_expense_report_lines l '||
			    ' where  h.report_header_id = l.report_header_id '||
			    ' and    h.source <> '||'''Oracle Project Accounting''' ||
			    ' and    l.project_id = :p_proj_id '||
			    ' and    ( :p_act_flag <> '|| '''A''' ||
			    ' or (trunc(l.expenditure_item_date ) <= trunc(:p_txn_date ) )) '||
			    ' and    nvl(l.pa_interfaced_flag,'||'''N'''||') <> '||'''Y'''||')';
Line: 903

      select 1
        from dual
      where exists ( select null
                       from pa_alloc_run_sources pars,
                            pa_alloc_runs par
                      where par.rule_id = pars.rule_id
                        and pars.project_id = p_proj_id
                        and par.run_id = pars.run_id
                   /*     and par.run_status <> 'RS'   commented for bug#2446122   */
			and par.run_status not in ( 'RS', 'RV')   /* Added for bug#2446122  */
                   );
Line: 916

      select 1
        from dual
       where exists ( select null
                        from pa_alloc_run_targets part,
                             pa_alloc_runs par
                       where par.rule_id = part.rule_id
                         and part.project_id = p_proj_id
                         and par.run_id = part.run_id
                   /*     and par.run_status <> 'RS'   commented for bug#2446122   */
			and par.run_status not in ( 'RS', 'RV')   /* Added for bug#2446122  */
                    );
Line: 931

      select 1
        from dual
       where exists ( select null
                        from pa_alloc_rules_all para,
                             pa_alloc_runs par
                       where par.rule_id = para.rule_id
                         and para.offset_project_id = p_proj_id
                   /*     and par.run_status <> 'RS'   commented for bug#2446122   */
			and par.run_status not in ( 'RS', 'RV')   /* Added for bug#2446122  */
                    );