DBA Data[Home] [Help]

APPS.AR_ADJVALIDATE_PVT SQL Statements

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

Line: 106

       SELECT lookup_code
         FROM ar_lookups
        WHERE lookup_type = l_lookup_type
          AND   enabled_flag = 'Y'
          AND   trunc(sysdate) BETWEEN nvl(trunc(start_date_active),
                                           trunc(sysdate))
                                   AND nvl(trunc(end_date_active),trunc(sysdate)) ;
Line: 229

           SELECT trunc(g.start_date) start_date,
                  trunc(g.end_date) end_date
           FROM   gl_period_statuses g,
                  gl_sets_of_books   b
           WHERE  g.application_id          = 222
           AND    g.set_of_books_id         = l_set_of_books_id
           AND    g.set_of_books_id         = b.set_of_books_id
           AND    g.period_type             = b.accounted_period_type
           AND    g.adjustment_period_flag  = 'N'
           AND    g.closing_status IN ('O','F') ;
Line: 253

        SELECT set_of_books_id
          INTO l_set_of_books_id
          FROM ar_system_parameters ;
Line: 574

 |                              the select clause.                           |
 |    SNAMBIAR       31-May-00  Bug 1290698 . Included type ENDORSEMENT also |
 |                              BOE/BR
 |    SNAMBIAR       31-Jan-01  Bug 1620930 .                                |
 |    SNAMBIAR       02-Apr-01  Modified the cursor to pickup receivables trx|
 |                              id -12 which is used for deduction chargeback|
 |                              reversal
 |    M Raymond      30-JUL-02  Bug 2441496 - Need to add FINCHRG to
 |                              list of cached receivables trx.
 +===========================================================================*/

PROCEDURE Cache_Receivables_Trx (p_return_status IN OUT NOCOPY VARCHAR2 )
IS

    CURSOR l_receivables_csr  IS
           SELECT receivables_trx_id,name,type,code_combination_id ,accounting_affect_flag,
	          gl_account_source /*Bug 2925924*/
             FROM ar_receivables_trx
            WHERE nvl(status,'A') = 'A'
            AND   type in ('ADJUST','ENDORSEMENT','FINCHRG')
            AND   receivables_trx_id not in (-11,-13 )
            AND   trunc(sysdate) BETWEEN nvl(trunc(start_date_active),
					     trunc(sysdate))
                            AND   nvl(trunc(end_date_active),trunc(sysdate)) ;
Line: 677

           SELECT ussgl_transaction_code,context
             FROM gl_ussgl_transaction_codes
            WHERE chart_of_accounts_id = arp_global.chart_of_accounts_id
              AND trunc(sysdate) BETWEEN nvl(trunc(start_date_active),
					     trunc(sysdate))
                              AND nvl(trunc(end_date_active),trunc(sysdate)) ;
Line: 771

           SELECT code_combination_id
             FROM gl_code_combinations
            WHERE chart_of_accounts_id = arp_global.chart_of_accounts_id
              AND enabled_flag = 'Y'
              AND trunc(sysdate) BETWEEN nvl(trunc(start_date_active),
					     trunc(sysdate))
                              AND nvl(trunc(end_date_active),trunc(sysdate)) ;
Line: 944

          G_APPROVAL_TBL.DELETE;
Line: 945

          G_REASON_TBL.DELETE;
Line: 946

          G_ADJTYPE_TBL.DELETE;
Line: 947

          G_RCVTRX_TBL.DELETE;
Line: 948

          G_USSGL_TBL.DELETE;
Line: 949

          G_GLPERIOD_TBL.DELETE;
Line: 950

          G_CCID_TBL.DELETE;
Line: 1146

             SELECT amount_to,
                    amount_from
             INTO   l_approval_amount_to,
                    l_approval_amount_from
             FROM   ar_approval_user_limits
             WHERE  user_id       = l_user_id
             AND    currency_code = p_inv_curr_code
             AND    document_type = 'ADJ';
Line: 1185

        |  Ensure that approval data has been selected   |
      	+-----------------------------------------------*/

        IF ( p_approved_flag = FND_API.G_TRUE )
        THEN

	   /*--------------------------------------------+
           |  Perform actual check of approval limits.   |
      	   +--------------------------------------------*/

           IF  ((  p_adj_amount > l_approval_amount_to ) OR
                (  p_adj_amount < l_approval_amount_from ))
           THEN
  	       IF PG_DEBUG in ('Y', 'C') THEN
  	          arp_util.debug('Within_approval_limits: ' ||  'User ID: ' || l_user_id ||
                               ' Amount: ' || p_adj_amount ||
           		       ' From: '   || l_approval_amount_from ||
                               ' To: '     || l_approval_amount_to ||
                               ' exceeds approval limit', G_MSG_HIGH );
Line: 1603

      	SELECT	*
      	INTO	p_ps_rec
      	FROM	ar_payment_schedules
      	WHERE	payment_schedule_id = p_adj_rec.payment_schedule_id;
Line: 1708

                SELECT count(*)
                  INTO l_count
                  FROM RA_CUSTOMER_TRX_LINES
                  WHERE customer_trx_id = p_adj_rec.customer_trx_id AND
                        customer_trx_line_id = p_adj_rec.customer_trx_line_id ;
Line: 1730

			insert into ar_llca_adj_trx_errors_gt
			(
				customer_trx_id,
				customer_trx_line_id,
				receivables_trx_id,
				error_message,
				invalid_value
			)
			values
			(
				l_customer_trx_id,
				l_customer_trx_line_id,
				l_receivables_trx_id,
				'Validate_Payschd',
				'payment_sch_id'
			);
Line: 1767

			insert into ar_llca_adj_trx_errors_gt
			(
				customer_trx_id,
				customer_trx_line_id,
				receivables_trx_id,
				error_message,
				invalid_value
			)
			values
			(
				l_customer_trx_id,
				l_customer_trx_line_id,
				l_receivables_trx_id,
				'AR_AAPI_NO_CUSTOMER_TRX_LINEID',
				'payment_sch_id'
			);
Line: 2252

	       insert into ar_llca_adj_trx_errors_gt
	        (
		customer_trx_id,
		customer_trx_line_id,
		receivables_trx_id,
		error_message,
		invalid_value
		)
		values
		(
		l_customer_trx_id,
		l_customer_trx_line_id,
		l_receivables_trx_id,
		'AR_AAPI_INVALID_RCVABLE_TRX_ID',
		'receivables_trx_id'
		);
Line: 2300

	       insert into ar_llca_adj_trx_errors_gt
	        (
		customer_trx_id,
		customer_trx_line_id,
		receivables_trx_id,
		error_message,
		invalid_value
		)
		values
		(
		l_customer_trx_id,
		l_customer_trx_line_id,
		l_receivables_trx_id,
		'AR_AAPI_INVALID_RCVABLE_TRX_ID',
		'receivables_trx_id'
		);
Line: 2357

	       insert into ar_llca_adj_trx_errors_gt
	        (
		customer_trx_id,
		customer_trx_line_id,
		receivables_trx_id,
		error_message,
		invalid_value
		)
		values
		(
		l_customer_trx_id,
		l_customer_trx_line_id,
		l_receivables_trx_id,
		'AR_AAPI_NO_CCID_FOR_ACTIVITY',
		'receivables_trx_id'
		);
Line: 2411

                 SELECT count(*)
		   INTO l_count
                   FROM gl_code_combinations
                  WHERE code_combination_id  = p_adj_rec.code_combination_id
                    AND enabled_flag        = 'Y'
                    AND SYSDATE BETWEEN NVL(start_date_active, sysdate)
                    AND                 NVL(end_date_active, sysdate);
Line: 2439

	       insert into ar_llca_adj_trx_errors_gt
	        (
		customer_trx_id,
		customer_trx_line_id,
		receivables_trx_id,
		error_message,
		invalid_value
		)
		values
		(
		l_customer_trx_id,
		l_customer_trx_line_id,
		l_receivables_trx_id,
		'AR_AAPI_INVALID_CCID',
		'receivables_trx_id'
		);
Line: 2478

	       insert into ar_llca_adj_trx_errors_gt
	        (
		customer_trx_id,
		customer_trx_line_id,
		receivables_trx_id,
		error_message,
		invalid_value
		)
		values
		(
		l_customer_trx_id,
		l_customer_trx_line_id,
		l_receivables_trx_id,
		'AR_AAPI_OVERRIDE_CCID_DISALLOW',
		'receivables_trx_id'
		);
Line: 2627

          select set_of_books_id
            into l_set_of_books_id
	    from ar_system_parameters;
Line: 2633

           SELECT count(*)
             INTO l_count
           FROM   gl_period_statuses g,
                  gl_sets_of_books   b
           WHERE  g.application_id          = 222
           AND    g.set_of_books_id         = l_set_of_books_id
           AND    g.set_of_books_id         = b.set_of_books_id
           AND    g.period_type             = b.accounted_period_type
           AND    g.adjustment_period_flag  = 'N'
           AND    g.closing_status IN ('O','F')
           AND    trunc(p_gl_date) BETWEEN nvl(trunc(g.start_date),
							  trunc(p_gl_date))
                               AND nvl(trunc(g.end_date),trunc(p_gl_date)) ;
Line: 3121

         SELECT  descriptive_flexfield_name
           INTO  l_flex_name
           FROM  fnd_descriptive_flexs
          WHERE  application_id = arp_global.G_AR_APP_ID AND
                 application_table_name like 'AR_ADJUSTMENTS' ;
Line: 3490

           SELECT count(*)
             INTO l_count
             FROM ar_cash_receipts
            WHERE cash_receipt_id = p_adj_rec.associated_cash_receipt_id ;
Line: 3618

      SELECT creation_sign,
             allow_overapplication_flag
      INTO l_creation_sign,
           l_allow_overapp_flag
      FROM ra_cust_trx_types
      WHERE cust_trx_type_id    = p_ps_rec.cust_trx_type_id;
Line: 3795

     SELECT creation_sign,
             allow_overapplication_flag
      INTO l_creation_sign,
           l_allow_overapp_flag
      FROM ra_cust_trx_types
      WHERE cust_trx_type_id    = p_ps_rec.cust_trx_type_id;
Line: 3807

      SELECT sum(DECODE (lines.line_type,
                                'TAX',0,
                                'FREIGHT',0 , 1) *
                         DECODE(ct.complete_flag, 'N',
                                0, lines.amount_due_remaining)), -- line adr
                    sum(DECODE (lines.line_type,
                                'TAX',1,0) *
                          DECODE(ct.complete_flag,
                                 'N', 0,
                                 lines.amount_due_remaining )), -- tax adr
             sum(DECODE (lines.line_type,
                                'TAX',0,
                                'FREIGHT',0 , 1) *
                         DECODE(ct.complete_flag, 'N',
                                0, lines.amount_due_original)), -- line adr org
                    sum(DECODE (lines.line_type,
                                'TAX',1,0) *
                          DECODE(ct.complete_flag,
                                 'N', 0,
                                 lines.amount_due_original)),   -- tax adr  org
                    max(ct.invoice_currency_code) -- curr code
      INTO        l_line_remaining,
                  l_tax_remaining,
		  l_line_org,
                  l_tax_org,
                  l_invoice_currency_code
      FROM        ra_customer_trx ct,
                  ra_customer_trx_lines lines
      WHERE (lines.customer_Trx_line_id = p_adj_rec.customer_trx_line_id or
                   lines.link_to_cust_trx_line_id = p_adj_rec.customer_trx_line_id)
      AND  ct.customer_Trx_id = lines.customer_trx_id;
Line: 3861

               insert into ar_llca_adj_trx_errors_gt
			(
				customer_trx_id,
				customer_trx_line_id,
				receivables_trx_id,
				error_message,
				invalid_value
			)
			values
			(
				l_customer_trx_id,
				l_customer_trx_line_id,
				l_receivables_trx_id,
				l_message_name,
				'Overapplication'
			);
Line: 3901

               insert into ar_llca_adj_trx_errors_gt
			(
				customer_trx_id,
				customer_trx_line_id,
				receivables_trx_id,
				error_message,
				invalid_value
			)
			values
			(
				l_customer_trx_id,
				l_customer_trx_line_id,
				l_receivables_trx_id,
				l_message_name,
				'Overapplication'
			);