DBA Data[Home] [Help]

APPS.ARP_AUTO_ACCOUNTING_BR SQL Statements

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

Line: 221

TYPE select_rec_type IS RECORD
(
  customer_trx_id                     BINARY_INTEGER,
  cust_trx_type_id                    BINARY_INTEGER,
  site_use_id                         BINARY_INTEGER,
  drawee_id                           BINARY_INTEGER,
  bill_to_site_use_id                 BINARY_INTEGER,
  br_unpaid_flag                      VARCHAR2(1),
  transaction_history_id              BINARY_INTEGER,
  batch_id                            BINARY_INTEGER,
  gl_date                             VARCHAR2(12),     -- Julian format
  source_type                         VARCHAR2(20),     --source type
  amount                              NUMBER,
  acctd_amount                        NUMBER,
  currency_code                       VARCHAR2(15),
  currency_conversion_rate            NUMBER,
  currency_conversion_type            VARCHAR2(30),
  currency_conversion_date            VARCHAR2(12),     -- Julian format
  receipt_method_id                   BINARY_INTEGER,
  bank_account_id                     BINARY_INTEGER,
  concatenated_segments               VARCHAR2(240),
  code_combination_id                 BINARY_INTEGER,
  br_unpaid_ccid                      BINARY_INTEGER
);
Line: 579

    SELECT
      ad.type type,
      ads.segment segment,
      upper(ads.table_name) table_name,
      ads.constant constant
    FROM
      ra_account_default_segments ads,
      ra_account_defaults ad
    WHERE ad.gl_default_id = ads.gl_default_id
    AND   ad.type in
    (
     'BR_REC', 'BR_UNPAID_REC', 'BR_FACTOR', 'BR_REMITTANCE'
    )
    ORDER BY
      type,
      segment_num;
Line: 624

        autoacc_def_segment_t.delete;
Line: 627

      autoacc_def_table_t.delete;
Line: 630

        autoacc_def_const_t.delete;
Line: 805

            SELECT
              nvl(gl_id_rec,-1),
              nvl(gl_id_unpaid_rec,-1),
              nvl(gl_id_factor,-1),
              nvl(gl_id_remittance,-1)
            INTO
              p_ccid_rec,
              p_ccid_unpaidrec,
              p_ccid_factor,
              p_ccid_remittance
            FROM ra_cust_trx_types
            WHERE cust_trx_type_id = p_trx_type_id;
Line: 901

            SELECT
              nvl(gl_id_rec,-1),
              nvl(gl_id_unpaid_rec,-1),
              nvl(gl_id_factor,-1),
              nvl(gl_id_remittance,-1)
            INTO
              p_ccid_rec,
              p_ccid_unpaidrec,
              p_ccid_factor,
              p_ccid_remittance
            FROM hz_cust_site_uses
            WHERE site_use_id = p_site_use_id;
Line: 988

            SELECT
              nvl(br_factor_ccid,-1),
              nvl(br_remittance_ccid,-1)
            INTO p_ccid_factor, p_ccid_remittance
            FROM ar_receipt_method_accounts
            WHERE remit_bank_acct_use_id = p_bank_account_id
            AND   receipt_method_id = p_receipt_method_id ;
Line: 1098

PROCEDURE define_columns( p_select_c   IN INTEGER,
                          p_select_rec IN select_rec_type) IS
BEGIN
    print_fcn_label2( 'arp_auto_accounting_br.define_columns()+' );
Line: 1103

    dbms_sql.define_column( p_select_c,  1, p_select_rec.customer_trx_id );
Line: 1104

    dbms_sql.define_column( p_select_c,  2, p_select_rec.cust_trx_type_id);
Line: 1105

    dbms_sql.define_column( p_select_c,  3, p_select_rec.site_use_id);
Line: 1106

    dbms_sql.define_column( p_select_c,  4, p_select_rec.drawee_id);
Line: 1107

    dbms_sql.define_column( p_select_c,  5, p_select_rec.bill_to_site_use_id);
Line: 1108

    dbms_sql.define_column( p_select_c,  6, p_select_rec.br_unpaid_flag,1);
Line: 1109

    dbms_sql.define_column( p_select_c,  7, p_select_rec.transaction_history_id);
Line: 1110

    dbms_sql.define_column( p_select_c,  8, p_select_rec.batch_id);
Line: 1111

    dbms_sql.define_column( p_select_c,  9, p_select_rec.gl_date,12);
Line: 1112

    dbms_sql.define_column( p_select_c, 10, p_select_rec.source_type, 30);
Line: 1113

    dbms_sql.define_column( p_select_c, 11, p_select_rec.amount);
Line: 1114

    dbms_sql.define_column( p_select_c, 12, p_select_rec.acctd_amount);
Line: 1115

    dbms_sql.define_column( p_select_c, 13, p_select_rec.currency_code,15);
Line: 1116

    dbms_sql.define_column( p_select_c, 14, p_select_rec.currency_conversion_rate);
Line: 1117

    dbms_sql.define_column( p_select_c, 15, p_select_rec.currency_conversion_type,30);
Line: 1118

    dbms_sql.define_column( p_select_c, 16, p_select_rec.currency_conversion_date,12);
Line: 1119

    dbms_sql.define_column( p_select_c, 17, p_select_rec.receipt_method_id);
Line: 1120

    dbms_sql.define_column( p_select_c, 18, p_select_rec.bank_account_id);
Line: 1121

    dbms_sql.define_column( p_select_c, 19, p_select_rec.concatenated_segments,240);
Line: 1122

    dbms_sql.define_column( p_select_c, 20, p_select_rec.code_combination_id);
Line: 1123

    dbms_sql.define_column( p_select_c, 21, p_select_rec.br_unpaid_ccid);
Line: 1162

FUNCTION build_select_sql( p_system_info 		IN
                             arp_trx_global.system_info_rec_type,
                           p_profile_info 		IN
                             arp_trx_global.profile_rec_type,
                           p_account_class 		IN VARCHAR2,
                           p_customer_trx_id 		IN BINARY_INTEGER,
                           p_receivable_application_id  IN BINARY_INTEGER,
                           p_br_unpaid_ccid             IN BINARY_INTEGER)
  RETURN VARCHAR2 IS

    l_select_stmt               VARCHAR2(32767);
Line: 1187

    print_fcn_label( 'arp_auto_accounting_br.build_select_sql()+' );
Line: 1310

       l_select_stmt :=
            'SELECT ct.customer_trx_id,'                 ||
                CRLF || 'ct.cust_trx_type_id,'           ||
                CRLF || 'ct.drawee_site_use_id,'         ||
                CRLF || 'ct.drawee_id,'                  ||
                CRLF || 'ct.bill_to_site_use_id,'        ||
                CRLF || 'ct.br_unpaid_flag,'             ||
                CRLF || 'th.transaction_history_id,'     ||
                CRLF || 'th.batch_id,'                   ||
                CRLF || 'to_char(th.gl_date,''J''),'     ||
                CRLF || ':account_class,'                ||
                CRLF || l_ps_app_col                     ||
                CRLF || 'ps.invoice_currency_code,'      ||
                CRLF || l_sel_trx_receipt_col            ||
                CRLF || l_receipt_batch_col              ||
                CRLF || l_ccid_col                       ||
                CRLF || l_br_unpaid_ccid_col             ||
      CRLF || 'FROM '|| 'ra_customer_trx ct,'      ||
      CRLF         || 'ar_transaction_history th,' ||
      CRLF         || 'ar_payment_schedules ps'    ||
                      l_receipt_app_table          ||
                      l_receipt_batch_table        ||
      CRLF || 'WHERE '|| l_trx_id_pred                                ||
      CRLF || 'AND th.customer_trx_id = ct.customer_trx_id'           ||
      CRLF || 'AND th.postable_flag = ''Y'''                          ||
      CRLF || 'AND th.posting_control_id = -3'                        ||
      CRLF || 'AND nvl(th.current_record_flag,''N'') = ''Y'''         ||
      CRLF || 'AND nvl(th.current_accounted_flag, ''N'') = ''Y'''     ||
      CRLF || 'AND th.gl_posted_date IS NULL'                         ||
      CRLF || 'AND ps.customer_trx_id = ct.customer_trx_id'           ||
              l_receipt_app_pred                                      ||
              l_receipt_batch_pred                                    ||
      CRLF || '/* prevent duplicate records from being created */'    ||
      CRLF || 'AND not exists'                                        ||
      CRLF || '    (SELECT ''distribution exists'''                   ||
      CRLF || '     FROM   ar_distributions ard'                      ||
      CRLF || '     WHERE  ard.source_id = th.transaction_history_id' ||
      CRLF || '     AND    ard.source_table = ''TH'''                 ||
      CRLF || '     AND    ard.source_type  = :account_class)';
Line: 1393

    debug( l_select_stmt, MSG_LEVEL_DEBUG );
Line: 1394

    debug( '  len(l_select_stmt)=' ||
                        to_char(length(l_select_stmt)), MSG_LEVEL_DEBUG );
Line: 1397

    print_fcn_label( 'arp_auto_accounting_br.build_select_sql()-' );
Line: 1399

    RETURN l_select_stmt;
Line: 1403

        debug('EXCEPTION: arp_auto_accounting_br.build_select_sql()',
	      MSG_LEVEL_BASIC);
Line: 1408

END build_select_sql;
Line: 1479

    SELECT segment1,
           segment2,
           segment3,
           segment4,
           segment5,
           segment6,
           segment7,
           segment8,
           segment9,
           segment10,
           segment11,
           segment12,
           segment13,
           segment14,
           segment15,
           segment16,
           segment17,
           segment18,
           segment19,
           segment20,
           segment21,
           segment22,
           segment23,
           segment24,
           segment25,
           segment26,
           segment27,
           segment28,
           segment29,
           segment30,
    DECODE(p_segment_number,
           1, segment1,
           2, segment2,
           3, segment3,
           4, segment4,
           5, segment5,
           6, segment6,
           7, segment7,
           8, segment8,
           9, segment9,
           10, segment10,
           11, segment11,
           12, segment12,
           13, segment13,
           14, segment14,
           15, segment15,
           16, segment16,
           17, segment17,
           18, segment18,
           19, segment19,
           20, segment20,
           21, segment21,
           22, segment22,
           23, segment23,
           24, segment24,
           25, segment25,
           26, segment26,
           27, segment27,
           28, segment28,
           29, segment29,
           30, segment30, null)
    INTO   l_segment1,
           l_segment2,
           l_segment3,
           l_segment4,
           l_segment5,
           l_segment6,
           l_segment7,
           l_segment8,
           l_segment9,
           l_segment10,
           l_segment11,
           l_segment12,
           l_segment13,
           l_segment14,
           l_segment15,
           l_segment16,
           l_segment17,
           l_segment18,
           l_segment19,
           l_segment20,
           l_segment21,
           l_segment22,
           l_segment23,
           l_segment24,
           l_segment25,
           l_segment26,
           l_segment27,
           l_segment28,
           l_segment29,
           l_segment30,
           p_desired_segment
    FROM   gl_code_combinations
    WHERE  code_combination_id = p_ccid;
Line: 1576

   |  Add the selected segments to the segment cache  |
   |  only if the cache is not already full.          |
   +--------------------------------------------------*/

   IF ( segment1_cache.count <= MAX_SEGMENT_CACHE_SIZE )
   THEN
         segment1_cache(p_ccid) := l_segment1;
Line: 1737

      |  Select the segments from gl_code_combinations and add them  |
      |   to the cache if it is not already full.                    |
      +--------------------------------------------------------------*/

      add_segments_to_cache(p_ccid, p_segment_number,l_desired_segment);
Line: 2263

FUNCTION Get_Select_Cursor(
                           p_system_info 		IN
                             arp_trx_global.system_info_rec_type,
                           p_profile_info 		IN
                             arp_trx_global.profile_rec_type,
                           p_account_class 		IN VARCHAR2,
                           p_customer_trx_id 		IN BINARY_INTEGER,
                           p_receivable_application_id  IN BINARY_INTEGER,
                           p_br_unpaid_ccid             IN BINARY_INTEGER,
                           p_keep_cursor_open_flag      OUT NOCOPY BOOLEAN )
          RETURN BINARY_INTEGER IS

    l_select_rec    select_rec_type;
Line: 2277

    l_select_c      BINARY_INTEGER;
Line: 2284

       print_fcn_label2( 'arp_auto_accounting_br.Get_Select_Cursor()+' );
Line: 2324

             print_fcn_label2( 'arp_auto_accounting_br.Get_Select_Cursor()-' );
Line: 2339

       |  construct and parse the select statement.   |
       +----------------------------------------------*/

       debug('Reparsing cursor that was not found in the cache. Key: ' ||
             l_key,
             MSG_LEVEL_DEBUG);
Line: 2348

                l_select_stmt VARCHAR2(32767);
Line: 2353

                l_select_c := dbms_sql.open_cursor;
Line: 2365

                      cursor_cache( l_cache_index )      := l_select_c;
Line: 2373

                l_select_stmt := build_select_sql( p_system_info,
                                               p_profile_info,
                                               p_account_class,
                                               p_customer_trx_id,
                                               p_receivable_application_id,
                                               p_br_unpaid_ccid );
Line: 2384

		debug( '  Parsing select stmt', MSG_LEVEL_DEBUG );
Line: 2386

                dbms_sql.parse( l_select_c, l_select_stmt, dbms_sql.v7);
Line: 2392

                define_columns( l_select_c, l_select_rec );
Line: 2397

                  debug( 'Error constructing/parsing select cursor',
                         MSG_LEVEL_BASIC );
Line: 2404

       print_fcn_label2( 'arp_auto_accounting_br.Get_Select_Cursor()-' );
Line: 2406

       RETURN( l_select_c );
Line: 2412

        debug('EXCEPTION: arp_auto_accounting_br.Get_Select_Cursor()',
	      MSG_LEVEL_BASIC);
Line: 2572

              p_cursor := Get_Select_Cursor(
                                             system_info,
                                             profile_info,
                                             p_account_class,
                                             p_customer_trx_id,
                                             p_receivable_application_id,
                                             p_br_unpaid_ccid,
                                             p_keep_cursor_open_flag);
Line: 3013

FUNCTION build_delete_sql( p_system_info 		IN
                             arp_trx_global.system_info_rec_type,
                           p_profile_info 		IN
                             arp_trx_global.profile_rec_type,
                           p_account_class 		IN VARCHAR2,
                           p_customer_trx_id 		IN BINARY_INTEGER)
  RETURN VARCHAR2 IS

    l_delete_stmt               VARCHAR2(1000);
Line: 3024

    print_fcn_label( 'arp_auto_accounting_br.build_delete_sql()+' );
Line: 3029

    l_delete_stmt :=
      'DELETE from ar_distributions ard'                           ||
      CRLF || 'WHERE ard.source_id in'                             ||
      CRLF || '(SELECT th.transaction_history_id'                  ||
      CRLF || 'FROM ar_transaction_history th'                     ||
      CRLF || 'WHERE th.customer_trx_id = '||p_customer_trx_id     ||
      CRLF || 'AND th.postable_flag = ''Y'''                       ||
      CRLF || 'AND th.posting_control_id = -3'                     ||
      CRLF || 'AND th.gl_posted_date IS NULL'                      ||
      CRLF || 'AND nvl(th.current_record_flag,''N'') = ''Y'''      ||
      CRLF || 'AND nvl(th.current_accounted_flag, ''N'') = ''Y'')' ||
      CRLF || 'AND ard.source_table = ''TH'''                      ||
      CRLF || 'AND ard.source_type = ''' || p_account_class || '''';
Line: 3043

    debug( l_delete_stmt, MSG_LEVEL_DEBUG );
Line: 3044

    debug( '  len(l_delete_stmt)=' || to_char(length(l_delete_stmt)),
           MSG_LEVEL_DEBUG );
Line: 3047

    print_fcn_label( 'arp_auto_accounting_br.build_delete_sql()-' );
Line: 3049

    RETURN l_delete_stmt;
Line: 3054

        debug('EXCEPTION: arp_auto_accounting_br.build_delete_sql()',
	      MSG_LEVEL_BASIC);
Line: 3058

END build_delete_sql;
Line: 3062

PROCEDURE get_column_values( p_select_c   IN  INTEGER,
                             p_select_rec OUT NOCOPY select_rec_type ) IS
BEGIN
    print_fcn_label2( 'arp_auto_accounting_br.get_column_values()+' );
Line: 3067

    dbms_sql.column_value( p_select_c,  1, p_select_rec.customer_trx_id );
Line: 3068

    dbms_sql.column_value( p_select_c,  2, p_select_rec.cust_trx_type_id);
Line: 3069

    dbms_sql.column_value( p_select_c,  3, p_select_rec.site_use_id);
Line: 3070

    dbms_sql.column_value( p_select_c,  4, p_select_rec.drawee_id);
Line: 3071

    dbms_sql.column_value( p_select_c,  5, p_select_rec.bill_to_site_use_id);
Line: 3072

    dbms_sql.column_value( p_select_c,  6, p_select_rec.br_unpaid_flag);
Line: 3073

    dbms_sql.column_value( p_select_c,  7, p_select_rec.transaction_history_id);
Line: 3074

    dbms_sql.column_value( p_select_c,  8, p_select_rec.batch_id);
Line: 3075

    dbms_sql.column_value( p_select_c,  9, p_select_rec.gl_date);
Line: 3076

    dbms_sql.column_value( p_select_c, 10, p_select_rec.source_type);
Line: 3077

    dbms_sql.column_value( p_select_c, 11, p_select_rec.amount);
Line: 3078

    dbms_sql.column_value( p_select_c, 12, p_select_rec.acctd_amount);
Line: 3079

    dbms_sql.column_value( p_select_c, 13, p_select_rec.currency_code);
Line: 3080

    dbms_sql.column_value( p_select_c, 14, p_select_rec.currency_conversion_rate);
Line: 3081

    dbms_sql.column_value( p_select_c, 15, p_select_rec.currency_conversion_type);
Line: 3082

    dbms_sql.column_value( p_select_c, 16, p_select_rec.currency_conversion_date);
Line: 3083

    dbms_sql.column_value( p_select_c, 17, p_select_rec.receipt_method_id);
Line: 3084

    dbms_sql.column_value( p_select_c, 18, p_select_rec.bank_account_id);
Line: 3085

    dbms_sql.column_value( p_select_c, 19, p_select_rec.concatenated_segments);
Line: 3086

    dbms_sql.column_value( p_select_c, 20, p_select_rec.code_combination_id);
Line: 3087

    dbms_sql.column_value( p_select_c, 21, p_select_rec.br_unpaid_ccid);
Line: 3099

PROCEDURE insert_dist_row( p_system_info  IN
                              arp_trx_global.system_info_rec_type,
                           p_profile_info IN
                              arp_trx_global.profile_rec_type,
                           p_select_rec   IN select_rec_type,
                           p_receivable_application_id IN NUMBER )  IS
l_amount_dr NUMBER;
Line: 3117

  print_fcn_label2( 'arp_auto_accounting_br.insert_dist_row()+' );
Line: 3127

  IF ((sign(p_select_rec.amount) <> -1) OR
      (sign(p_select_rec.acctd_amount) <> -1)) THEN

     IF (p_receivable_application_id IS NULL) THEN --Dr

        l_amount_dr := p_select_rec.amount;
Line: 3133

        l_acctd_amount_dr := p_select_rec.acctd_amount;
Line: 3141

        l_amount_cr := p_select_rec.amount;
Line: 3142

        l_acctd_amount_cr := p_select_rec.acctd_amount;
Line: 3146

  ELSIF ((sign(p_select_rec.amount) = -1) OR
         (sign(p_select_rec.acctd_amount) = -1)) THEN

     IF (p_receivable_application_id IS NULL) THEN --Cr the BR account

        l_amount_dr := NULL;
Line: 3153

        l_amount_cr := p_select_rec.amount;
Line: 3154

        l_acctd_amount_cr := p_select_rec.acctd_amount;
Line: 3157

        l_amount_dr := p_select_rec.amount;
Line: 3158

        l_acctd_amount_dr := p_select_rec.acctd_amount;
Line: 3171

  IF ((nvl(p_select_rec.br_unpaid_flag,'N') = 'Y') AND (p_select_rec.source_type = UNPAIDREC)
     AND (p_select_rec.br_unpaid_ccid = p_select_rec.code_combination_id)) THEN

     debug('Derived Unpaid account matches existing Unpaid account ');
Line: 3183

     l_ae_line_rec.source_type          :=  p_select_rec.source_type;
Line: 3184

     l_ae_line_rec.source_id            :=  p_select_rec.transaction_history_id;
Line: 3186

     l_ae_line_rec.code_combination_id  := p_select_rec.code_combination_id;
Line: 3191

     l_ae_line_rec.currency_code        := p_select_rec.currency_code;
Line: 3193

                                p_select_rec.currency_conversion_rate;
Line: 3195

                                p_select_rec.currency_conversion_type;
Line: 3197

                     to_date(p_select_rec.currency_conversion_date, 'J');
Line: 3199

     l_ae_line_rec.third_party_id           := p_select_rec.drawee_id;
Line: 3200

     l_ae_line_rec.third_party_sub_id       := p_select_rec.site_use_id;
Line: 3204

       /* caling table handler instead of direct insert */
       arp_distributions_pkg.insert_p( l_ae_line_rec, l_dummy);
Line: 3208

          /* need to insert records into the MRC table.  Calling new
              mrc engine */
--         IF PG_DEBUG in ('Y', 'C') THEN
--            arp_standard.debug('insert_dist_row: ' || 'getting information for the mrc trigger');
Line: 3245

  print_fcn_label2( 'arp_auto_accounting_br.insert_dist_row()-' );
Line: 3248

        debug('EXCEPTION: arp_auto_accounting_br.insert_dist_row()',
		MSG_LEVEL_BASIC);
Line: 3252

END insert_dist_row;
Line: 3255

PROCEDURE dump_select_rec( p_select_rec IN select_rec_type ) IS
BEGIN
    print_fcn_label2( 'arp_auto_accounting_br.dump_select_rec()+' );
Line: 3259

    debug( '  Dumping select record: ', MSG_LEVEL_DEBUG );
Line: 3261

           || to_char( p_select_rec.customer_trx_id ), MSG_LEVEL_DEBUG );
Line: 3263

           || to_char( p_select_rec.cust_trx_type_id), MSG_LEVEL_DEBUG );
Line: 3265

          || to_char( p_select_rec.site_use_id),
          MSG_LEVEL_DEBUG );
Line: 3268

           || to_char( p_select_rec.drawee_id ), MSG_LEVEL_DEBUG );
Line: 3270

           || to_char( p_select_rec.bill_to_site_use_id ), MSG_LEVEL_DEBUG );
Line: 3272

           || p_select_rec.br_unpaid_flag, MSG_LEVEL_DEBUG );
Line: 3274

           || to_char( p_select_rec.transaction_history_id ), MSG_LEVEL_DEBUG );
Line: 3276

           || to_char( p_select_rec.batch_id ), MSG_LEVEL_DEBUG );
Line: 3278

           || p_select_rec.gl_date, MSG_LEVEL_DEBUG );
Line: 3280

           || p_select_rec.source_type , MSG_LEVEL_DEBUG );
Line: 3281

    debug( '  amount=' || to_char(p_select_rec.amount), MSG_LEVEL_DEBUG );
Line: 3282

    debug( '  acctd_amount=' || to_char(p_select_rec.acctd_amount), MSG_LEVEL_DEBUG );
Line: 3283

    debug( '  currency_code=' || p_select_rec.currency_code,
           MSG_LEVEL_DEBUG );
Line: 3286

           || to_char( p_select_rec.currency_conversion_rate ), MSG_LEVEL_DEBUG );
Line: 3288

           p_select_rec.currency_conversion_type, MSG_LEVEL_DEBUG );
Line: 3290

           p_select_rec.currency_conversion_date, MSG_LEVEL_DEBUG );
Line: 3292

           p_select_rec.receipt_method_id, MSG_LEVEL_DEBUG );
Line: 3294

           p_select_rec.bank_account_id, MSG_LEVEL_DEBUG );
Line: 3296

           || p_select_rec.concatenated_segments, MSG_LEVEL_DEBUG );
Line: 3298

           || to_char( p_select_rec.code_combination_id ), MSG_LEVEL_DEBUG );
Line: 3300

           || to_char( p_select_rec.br_unpaid_ccid), MSG_LEVEL_DEBUG );
Line: 3302

    print_fcn_label2( 'arp_auto_accounting_br.dump_select_rec()-' );
Line: 3306

        debug('EXCEPTION: arp_auto_accounting_br.dump_select_rec()',
		MSG_LEVEL_BASIC);
Line: 3310

END dump_select_rec;
Line: 3316

                        p_select_rec  		IN OUT NOCOPY select_rec_type,
                        p_failure_count	 	IN OUT NOCOPY BINARY_INTEGER )  IS

    l_boolean  			BOOLEAN;
Line: 3327

    validation_date := TO_DATE(p_select_rec.gl_date, 'J');
Line: 3331

    IF( p_select_rec.code_combination_id IS NULL ) THEN

        flex_manager( p_select_rec.source_type,
                      p_select_rec.cust_trx_type_id,
                      p_select_rec.site_use_id,
                      p_select_rec.receipt_method_id,
                      p_select_rec.bank_account_id,
                      p_select_rec.code_combination_id,
                      p_select_rec.concatenated_segments);
Line: 3342

    IF( p_select_rec.code_combination_id = -1 ) THEN

        -- keep track of # rows where ccid was not found
        -- if > 0, then need to call AOL dynamic insert
        -- on the client-side
        --
        p_failure_count	 := nvl(p_failure_count, 0) + 1;
Line: 3373

    l_select_rec select_rec_type;
Line: 3374

    l_null_rec   CONSTANT select_rec_type := l_select_rec;
Line: 3378

    l_select_c INTEGER;
Line: 3379

    l_delete_c INTEGER;
Line: 3405

        l_select_rec := l_null_rec;     -- start with null record
Line: 3407

        l_select_rec.customer_trx_id := p_customer_trx_id;
Line: 3408

        l_select_rec.source_type := p_account_class;
Line: 3409

        l_select_rec.cust_trx_type_id := p_cust_trx_type_id;
Line: 3410

        l_select_rec.site_use_id := p_site_use_id;
Line: 3411

        l_select_rec.receipt_method_id := p_receipt_method_id;
Line: 3412

        l_select_rec.bank_account_id := p_bank_account_id;
Line: 3414

	dump_select_rec( l_select_rec );
Line: 3417

                      l_select_rec,
                      p_failure_count );
Line: 3423

        p_ccid := l_select_rec.code_combination_id;
Line: 3424

        p_concat_segments := l_select_rec.concatenated_segments;
Line: 3431

    	    -- Delete distributions in Update and Delete mode
	    --

            ----------------------------------------------------------------
            -- Construct delete stmt
            ----------------------------------------------------------------
            DECLARE
                l_delete_stmt VARCHAR2(32767);
Line: 3442

                l_delete_c := dbms_sql.open_cursor;
Line: 3443

                l_delete_stmt := build_delete_sql( system_info,
                                               profile_info,
                                               p_account_class,
                                               p_customer_trx_id );
Line: 3448

                dbms_sql.parse( l_delete_c, l_delete_stmt, dbms_sql.v7 );
Line: 3452

                  debug( 'Error constructing/parsing delete cursor',
                         MSG_LEVEL_BASIC );
Line: 3465

                l_ignore := dbms_sql.execute( l_delete_c );
Line: 3467

                debug( to_char(l_ignore) || ' row(s) deleted',
			MSG_LEVEL_DEBUG );
Line: 3470

                close_cursor( l_delete_c );
Line: 3474

                    debug( 'Error executing delete stmt', MSG_LEVEL_BASIC );
Line: 3486

    	    -- Insert distributions in Insert and Update mode
	    --

            --
            -- Fetch records using select stmt
            --

            l_select_c := Get_Select_Cursor(
                                             system_info,
                                             profile_info,
                                             p_account_class,
                                             p_customer_trx_id,
                                             p_receivable_application_id,
                                             p_br_unpaid_ccid,
                                             l_keep_cursor_open_flag);
Line: 3504

                                 l_select_c,
                                 system_info,
                                 profile_info,
                                 p_account_class,
                                 p_customer_trx_id,
                                 p_receivable_application_id,
                                 p_br_unpaid_ccid,
                                 l_keep_cursor_open_flag);
Line: 3520

		debug( '  Executing select stmt', MSG_LEVEL_DEBUG );
Line: 3522

                l_ignore := dbms_sql.execute( l_select_c );
Line: 3526

                    debug( 'Error executing select cursor', MSG_LEVEL_BASIC );
Line: 3534

	    debug( '  Fetching select stmt', MSG_LEVEL_DEBUG );
Line: 3541

                    IF dbms_sql.fetch_rows( l_select_c ) > 0  THEN

			debug( '  Fetched a row', MSG_LEVEL_DEBUG );
Line: 3547

                        l_select_rec := l_null_rec;
Line: 3548

                        get_column_values( l_select_c, l_select_rec );
Line: 3550

                        dump_select_rec( l_select_rec );
Line: 3558

                        THEN  close_cursor( l_select_c );
Line: 3561

			-- No rows selected
			IF( l_first_fetch ) THEN

			    debug( '  raising NO_DATA_FOUND',
				   MSG_LEVEL_DEBUG );
Line: 3577

                        debug( 'Error fetching select cursor',
	                       MSG_LEVEL_BASIC );
Line: 3585

                              l_select_rec,
                              p_failure_count );
Line: 3592

                    insert_dist_row( system_info,
                                     profile_info,
                                     l_select_rec,
                                     p_receivable_application_id );
Line: 3598

                       debug( 'Error inserting distributions',
                              MSG_LEVEL_BASIC );
Line: 3604

		IF( l_select_rec.code_combination_id = -1 ) THEN

                    IF( p_account_class = REC ) THEN

			put_message_on_stack(
				MSG_COMPLETE_REC_ACCOUNT,
				l_select_rec.concatenated_segments );
Line: 3616

				l_select_rec.concatenated_segments );
Line: 3622

				l_select_rec.concatenated_segments );
Line: 3628

				l_select_rec.concatenated_segments );
Line: 3647

    THEN  close_cursor( l_select_c );
Line: 3650

    close_cursor( l_delete_c );
Line: 3660

         THEN  close_cursor( l_select_c );
Line: 3663

        close_cursor( l_delete_c );
Line: 3678

        close_cursor( l_select_c );
Line: 3679

        close_cursor( l_delete_c );
Line: 3744

    l_select_rec select_rec_type;
Line: 3745

    l_null_rec   CONSTANT select_rec_type := l_select_rec;
Line: 3855

    select_stmt VARCHAR2(32767);
Line: 3856

    delete_stmt VARCHAR2(32767);
Line: 3865

    select_stmt :=
     build_select_sql(system_info, profile_info,
                      REC, 1, NULL, NULL);
Line: 3868

    debug(select_stmt);
Line: 3872

    select_stmt :=
    build_select_sql(system_info, profile_info,
                      UNPAIDREC, 1, NULL, NULL);
Line: 3875

    debug(select_stmt);
Line: 3879

     select_stmt :=
     build_select_sql(system_info, profile_info,
                      UNPAIDREC, 1, 2, NULL);
Line: 3882

     debug(select_stmt);
Line: 3886

     select_stmt :=
     build_select_sql(system_info, profile_info,
                      UNPAIDREC, 1, 2, 3333);
Line: 3889

     debug(select_stmt);
Line: 3893

     select_stmt :=
     build_select_sql(system_info, profile_info,
                      REMITTANCE, 1, NULL, NULL);
Line: 3896

     debug(select_stmt);
Line: 3900

     select_stmt :=
     build_select_sql(system_info, profile_info,
                      FACTOR, 1, NULL, NULL);
Line: 3903

     debug(select_stmt);
Line: 3907

     delete_stmt :=
     build_delete_sql(system_info, profile_info,
                      FACTOR, 1234);
Line: 3910

     debug(select_stmt);
Line: 3950

'SELECT
detail_posting_allowed_flag,
summary_flag
FROM  gl_code_combinations
WHERE code_combination_id = :ccid
';