DBA Data[Home] [Help]

APPS.PSA_MFAR_ADJUSTMENTS SQL Statements

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

Line: 102

                Select  adj.customer_trx_id             cust_trx_id,
                        adj.customer_trx_line_id        cust_trx_line_id,
                        ard.code_combination_id         adj_ccid,
                        adj.amount                      adj_amount,
                        adj.type                        adj_type
                  From  ar_adjustments                  adj,
                        ar_distributions                ard
                  Where adj.adjustment_id		= g_adjustment_id
                    and adj.adjustment_id 		= ard.source_id
                    and ard.source_table  		= 'ADJ'
                    and ard.source_type   		IN ('ADJ', 'FINCHRG');
Line: 115

		Select	B.mf_receivables_ccid		mf_rec_ccid,
			C.mf_adjustment_ccid		mf_adj_ccid,
			C.prev_mf_adjustment_ccid       prev_mf_adj_ccid,
			C.prev_cust_trx_line_id		prev_cust_trx_line_id
		  From 	ra_cust_trx_line_gl_dist        A,
		  	psa_mf_trx_dist_all             B,
		  	psa_mf_adj_dist_all             C
		 Where 	C.adjustment_id			= g_adjustment_id
		 And	A.customer_trx_id		= g_customer_trx_id
                 And    A.CUST_TRX_LINE_GL_DIST_ID      = B.CUST_TRX_LINE_GL_DIST_ID
		 And	B.cust_trx_line_gl_dist_id	= C.cust_trx_line_gl_dist_id
		 FOR    UPDATE;
Line: 265

		       DELETE FROM psa_mf_adj_dist_all
		       WHERE adjustment_id = g_adjustment_id;
Line: 269

                      psa_utils.debug_other_string(g_state_level,l_full_path, ' DELETE FROM psa_mf_adj_dist_all --> ' || SQL%ROWCOUNT);
Line: 318

	  PSA_MFAR_UTILS.INSERT_DISTRIBUTIONS_LOG (g_run_id, 'ADJUSTMENT', g_customer_trx_id, g_adjustment_id, l_exception_error);
Line: 328

	  PSA_MFAR_UTILS.INSERT_DISTRIBUTIONS_LOG (g_run_id, 'ADJUSTMENT', g_customer_trx_id, g_adjustment_id, l_exception_error);
Line: 338

	  PSA_MFAR_UTILS.INSERT_DISTRIBUTIONS_LOG (g_run_id, 'ADJUSTMENT', g_customer_trx_id, g_adjustment_id, l_exception_error);
Line: 364

	Select	A.customer_trx_line_id		cust_trx_line_id,
		A.line_type			line_type,
		B.cust_trx_line_gl_dist_id	cust_trx_line_gl_dist_id,
		C.mf_receivables_ccid		mf_rec_ccid,
                b.code_combination_id           code_combination_id,
                decode (c_sum_adr,
			0, D.amount_due_original,
                        D.amount_due_remaining) amount_due,
		B.percent	-- panatara
        From 	ra_customer_trx_lines           A,
		ra_cust_trx_line_gl_dist        B,
		psa_mf_trx_dist_all		C,
		psa_mf_balances_view		D
	Where 	A.customer_trx_id		= g_customer_trx_id
            and A.customer_trx_line_id		= B.customer_trx_line_id
            and B.account_class <> 'REC'
            and	B.cust_trx_line_gl_dist_id	= C.cust_trx_line_gl_dist_id
	    and	C.cust_trx_line_gl_dist_id	= D.cust_trx_line_gl_dist_id
            and B.customer_trx_line_id 		= DECODE(g_adj_type,
					  		 'LINE', nvl(l_customer_trx_line_id, B.customer_trx_line_id),
					  		 B.customer_trx_line_id);
Line: 389

                   SELECT gl_account_source
                   FROM   ar_receivables_trx r, ar_adjustments a
                   WHERE  r.receivables_trx_id = a.receivables_trx_id
                   AND    a.adjustment_id = g_adjustment_id;
Line: 445

    Select decode (sum(mf_balances.amount_due_remaining), 0, sum(mf_balances.amount_due_original),
                   sum(mf_balances.amount_due_remaining)) total_amount_due,
                   sum(mf_balances.amount_due_remaining) sum_amt_due_rem
    Into  l_total_amount_due, sum_amt_due_rem
    From  ra_customer_trx_lines	      trx_lines,
          ra_cust_trx_line_gl_dist	trx_dist,
          psa_mf_balances_view		mf_balances
    Where trx_lines.customer_trx_id             = g_customer_trx_id
    And   trx_lines.customer_trx_line_id        = trx_dist.customer_trx_line_id
    And   trx_dist.cust_trx_line_gl_dist_id     = mf_balances.cust_trx_line_gl_dist_id
    And   trx_lines.customer_trx_line_id        = nvl(g_cust_trx_line_id, trx_dist.customer_trx_line_id)
    And   trx_lines.line_type                   = decode(g_adj_type, 'LINE', 'LINE',
                                                                     'TAX', FIND_TAX_FREIGHT_LINES('TAX', trx_lines.line_type),
                                                                     'FREIGHT', FIND_TAX_FREIGHT_LINES('FREIGHT', trx_lines.line_type),
                                                                     'INVOICE', trx_lines.line_type, trx_lines.line_type);
Line: 474

	-- Select the customer_trx_line_id if adjustment type is LINE

	IF (g_adj_type = 'LINE') THEN

		SELECT customer_trx_line_id INTO l_customer_trx_line_id
		FROM ar_adjustments
		WHERE adjustment_id = g_adjustment_id;
Line: 488

			SELECT	count(*) INTO    l_distr_line_count
        		FROM 	ra_customer_trx_lines           A,
				ra_cust_trx_line_gl_dist        B,
				psa_mf_trx_dist_all		C,
				psa_mf_balances_view		D
			WHERE 	A.customer_trx_id		= g_customer_trx_id
            		    and A.customer_trx_line_id		= B.customer_trx_line_id
            		    and B.account_class <> 'REC'
            		    and	B.cust_trx_line_gl_dist_id	= C.cust_trx_line_gl_dist_id
	    		    and	C.cust_trx_line_gl_dist_id	= D.cust_trx_line_gl_dist_id;
Line: 644

		 Select DECODE(g_adj_type, 'LINE',    'LINE',
					   'TAX',     FIND_TAX_FREIGHT_LINES('TAX',      ccid_info(i).line_type),
					   'FREIGHT', FIND_TAX_FREIGHT_LINES('FREIGHT', ccid_info(i).line_type),
					   'INVOICE', ccid_info(i).line_type, ccid_info(i).line_type)
		  Into l_temp_adj_type From Dual;
Line: 706

	   -- Insert into psa_mf_adj_dist_all
	   --

         -- ========================= FND LOG ===========================
            psa_utils.debug_other_string(g_state_level,l_full_path, ' Calling PSA_MF_ADJ_DIST_ALL_PKG.INSERT_ROW ');
Line: 713

	   PSA_MF_ADJ_DIST_ALL_PKG.INSERT_ROW
				   ( X_ROWID 			=> l_row_id,
				     X_ADJUSTMENT_ID		=> g_adjustment_id,
				     X_CUST_TRX_LINE_GL_DIST_ID	=> ccid_info(i).cust_trx_line_gl_dist_id,
				     X_MF_ADJUSTMENT_CCID	=> p_ccid,
				     X_AMOUNT			=> l_amount,
				     X_PERCENT			=> l_percent,
				     X_PREV_CUST_TRX_LINE_ID 	=> g_cust_trx_line_id,
				     X_PREV_MF_ADJUSTMENT_CCID  => p_ccid,
				     X_POSTING_CONTROL_ID 	=> -3,
				     X_MODE 			=> 'R' );
Line: 726

            psa_utils.debug_other_string(g_state_level,l_full_path, ' Calling PSA_MF_ADJ_DIST_ALL_PKG.INSERT_ROW --> ' || SQL%ROWCOUNT);
Line: 744

	  PSA_MFAR_UTILS.INSERT_DISTRIBUTIONS_LOG (g_run_id, 'ADJUSTMENT', g_customer_trx_id, g_adjustment_id, l_exception_error);
Line: 754

	  PSA_MFAR_UTILS.INSERT_DISTRIBUTIONS_LOG (g_run_id, 'ADJUSTMENT', g_customer_trx_id, g_adjustment_id, l_exception_error);
Line: 776

    SELECT line_type
    FROM   ra_customer_trx_lines
    WHERE  line_type = p_adjustment_type
    AND    rownum = 1;