DBA Data[Home] [Help]

APPS.FV_LOCKBOX_FC_PKG SQL Statements

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

Line: 40

 v_last_updated_by       number(15)      := fnd_global.user_id;
Line: 41

 v_last_update_date      date            := sysdate;
Line: 49

        select *
          from ar_batches
         where transmission_id = cv_transmission_id;
Line: 56

        select distinct(decode(a.customer_trx_id,null,b.customer_trx_id,
                                             a.customer_trx_id)) customer_trx_id
          from ar_interim_cash_receipts a,
               ar_interim_cash_rcpt_lines_all b
         where a.batch_id = cv_batch_id
           and a.cash_receipt_id = b.cash_receipt_id (+)
           and(a.customer_trx_id is not null or b.customer_trx_id is not null);
Line: 64

        select distinct(customer_trx_id) customer_trx_id
          from ar_interim_cash_receipts
         where batch_id = cv_batch_id
           and customer_trx_id is not null
        union
        select distinct(customer_trx_id) customer_trx_id
          from ar_interim_cash_rcpt_lines_all
         where batch_id =  cv_batch_id
           and org_id = cv_org_id
           and customer_trx_id is not null;
Line: 76

        Select aps.customer_trx_id,
               aps.amount_due_remaining,
               fcc.priority,
               aps.payment_schedule_id
          from ra_customer_trx      rct,
               ar_payment_schedules aps,
               fv_finance_charge_controls fcc
          where rct.related_customer_trx_id = cv_invoice_id
          and   aps.customer_trx_id = rct.customer_trx_id
          and   rct.interface_header_attribute3    = fcc.charge_type
          and   rct.set_of_books_id    = fcc.set_of_books_id
          and   aps.amount_due_remaining > 0
          order by fcc.priority ;
Line: 92

          select sum(amount) amount,
                aicr.customer_trx_id,
                aicr.payment_schedule_id
          from ar_interim_cash_receipts aicr,
               ra_customer_trx rct,
               fv_finance_charge_controls fcc
          where aicr.batch_id = cv_batch_id
          and aicr.customer_trx_id is not null
          and aicr.customer_trx_id = rct.customer_trx_id
          and rct.interface_header_attribute3 = fcc.charge_type
          and rct.set_of_books_id             = fcc.set_of_books_id
          group by aicr.customer_trx_id, aicr.payment_schedule_id
          union
          select sum(payment_amount) amount,
                 aicrl.customer_trx_id,
                 aicrl.payment_schedule_id
          from ar_interim_cash_rcpt_lines_all aicrl,
               ra_customer_trx rct,
               fv_finance_charge_controls fcc
          where aicrl.batch_id = cv_batch_id
          and aicrl.customer_trx_id is not null
          and aicrl.customer_trx_id = rct.customer_trx_id
          and rct.interface_header_attribute3 = fcc.charge_type
          and rct.set_of_books_id             = fcc.set_of_books_id
          and aicrl.org_id = cv_org_id
          group by aicrl.customer_trx_id, aicrl.payment_schedule_id;
Line: 122

        select customer_trx_id, aicr.amount amount, 'R' origin,
               cash_receipt_id, 0 cash_receipt_line_id, payment_schedule_id,
               0 sold_to_customer, ussgl_transaction_code
          from ar_interim_cash_receipts aicr
         where batch_id = cv_batch_id
           and customer_trx_id is not null
           and exists (select 'x' from fv_lockbox_ipa_temp f
                                 where f.invoice_id = aicr.customer_trx_id
                                   and f.batch_id = aicr.batch_id)
        union
        select customer_trx_id, aicrl.payment_amount amount, 'L' origin,
               cash_receipt_id, cash_receipt_line_id, payment_schedule_id,
               sold_to_customer, ussgl_transaction_code
          from ar_interim_cash_rcpt_lines_all aicrl
         where batch_id =  cv_batch_id
           and org_id = cv_org_id
           and customer_trx_id is not null
           and exists (select 'x' from fv_lockbox_ipa_temp f
                                 where f.invoice_id = aicrl.customer_trx_id
                                   and f.batch_id = aicrl.batch_id);
Line: 146

         select debit_memo_id, amount, priority, payment_schedule_id
           from fv_lockbox_ipa_temp
          where transmission_id = cv_trans_id
            and batch_id = cv_batch_id
            and invoice_id = cv_invoice_id
         order by priority;
Line: 169

   delete from fv_lockbox_ipa_temp
    where transmission_id = v_transmission_id;
Line: 200

               SELECT fv_lockbox_ipa_temp_s.nextval
                 INTO v_temp_id
                 FROM dual;
Line: 214

             insert into fv_lockbox_ipa_temp(temp_id,
			invoice_id,
			debit_memo_id,
			amount,
			priority,
			batch_id,
			payment_schedule_id,
                        transmission_id)
                values(v_temp_id,
                       v_invoice_id,
                       v_debit_memo_id,
                       nvl(v_amount,0),
                       v_priority,
		       v_batch_id,
                       v_payment_schedule_id,
                       v_transmission_id);
Line: 247

        update fv_lockbox_ipa_temp
           set amount = amount - nvl(c_receipt_dms_rec.amount,0)
         where debit_memo_id = c_receipt_dms_rec.customer_trx_id
           and batch_id = v_batch_id
           and transmission_id = v_transmission_id
	   and payment_schedule_id = c_receipt_dms_rec.payment_schedule_id;
Line: 376

            IF v_dm_amt >0 THEN  -- don't want to insert $0 receipts
               insert_cash_receipt(v_appl_dm_id, v_dm_pay_sch_id, v_dm_amt, null);
Line: 380

               update_lockbox_temp(v_dm_amt);
Line: 396

               insert_cash_receipt(v_appl_dm_id, v_dm_pay_sch_id,
                                     v_appl_amt_remain, null);
Line: 400

                 FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,'UPDATE AR_INTERIM_CASH_RECEIPTS TO MULTIPLE');
Line: 402

               update ar_interim_cash_receipts
                  set customer_trx_id = null,
                      payment_schedule_id = null,
                      special_type = 'MULTIPLE',
                      amount_applied = null,
                      last_updated_by = v_last_updated_by,
                      last_update_date = v_last_update_date
                where cash_receipt_id = v_cash_receipt_id;
Line: 416

                update_interim_table(v_origin, v_appl_amt_remain,
                               v_appl_dm_id,v_dm_pay_sch_id);
Line: 424

                update ar_interim_cash_rcpt_lines_all
                   set ussgl_transaction_code = null
                 where cash_receipt_id = v_cash_receipt_id
                   and cash_receipt_line_id = v_cash_receipt_line_id;
Line: 432

            update_lockbox_temp(v_appl_amt_remain);
Line: 458

               insert_cash_receipt(v_appl_inv_id, v_appl_inv_ps_id,
                  v_appl_amt_remain, v_transaction_code);
Line: 462

                 FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,'UPDATE AR_INTERIM_CASH_RECEIPTS TO MULTIPLE');
Line: 464

               update ar_interim_cash_receipts
                  set customer_trx_id = null,
                      payment_schedule_id = null,
                      special_type = 'MULTIPLE',
                      amount_applied = null,
                      last_updated_by = v_last_updated_by,
                      last_update_date = v_last_update_date
                where cash_receipt_id = v_cash_receipt_id;
Line: 477

             update_interim_table(v_origin, v_appl_amt_remain,
                           v_appl_inv_id, v_appl_inv_ps_id);
Line: 482

        update_lockbox_temp(v_appl_amt_remain);
Line: 509

 PROCEDURE insert_cash_receipt(v_cust_trx_id IN number,
                               v_pay_sch_id  IN number,
                                    v_amount IN number,
                               v_ussgl_tran_code IN varchar2) AS
  l_module_name VARCHAR2(200) := g_module_name || 'insert_cash_receipt';
Line: 520

         select max(cash_receipt_line_id)
           into v_cash_receipt_line_id_ctr
           from ar_interim_cash_rcpt_lines_all
          where batch_id = v_batch_id
            and cash_receipt_id = v_cash_receipt_id;
Line: 533

   insert into ar_interim_cash_rcpt_lines_all
    (cash_receipt_id,
     cash_receipt_line_id,
     last_updated_by,
     last_update_date,
     created_by,
     creation_date,
     sold_to_customer,
     payment_amount,
     payment_schedule_id,
     customer_trx_id,
     batch_id,
     ussgl_transaction_code)
   values
    (v_cash_receipt_id,
     v_cash_receipt_line_id_ctr,
     v_last_updated_by,
     v_last_update_date,
     v_created_by,
     v_creation_date,
     v_sold_to_customer,
     v_amount,
     v_pay_sch_id,  -- fin chrg debit memo or invoice_id payment_schedule_id
     v_cust_trx_id,     -- fin chrg debit memo or invoice_id customer_trx_id
     v_batch_id,
     v_ussgl_tran_code);
Line: 562

     FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,'INSERTED NEW CASH RECEIPT FOR CUSTOMER_TRX_ID '||
                    to_char(v_cust_trx_id));
Line: 570

     v_errbuf  := 'insert_cash_receipt '||sqlerrm;
Line: 571

     FV_UTILITY.LOG_MESG(FND_LOG.LEVEL_UNEXPECTED, l_module_name,'ERROR OCCURRED IN INSERT_CASH_RECEIPT - '||SQLERRM);
Line: 575

 END insert_cash_receipt;
Line: 585

 PROCEDURE update_lockbox_temp(v_decrease_dm_amount IN NUMBER) IS
  l_module_name VARCHAR2(200) := g_module_name || 'update_lockbox_temp';
Line: 590

    update fv_lockbox_ipa_temp
      set amount        = nvl(amount,0) - nvl(v_decrease_dm_amount,0)
    where debit_memo_id = v_appl_dm_id   -- current debit memo being processed
      and invoice_id    = v_appl_inv_id  -- current invoice being processed
      and batch_id      = v_batch_id;     -- curent batch being processed
Line: 597

     FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,'UPDATE TEMP TABLE DECREASING BY '
                                ||to_char(v_decrease_dm_amount));
Line: 603

     v_errbuf  := 'update_lockbox_temp '||sqlerrm;
Line: 604

     FV_UTILITY.LOG_MESG(FND_LOG.LEVEL_UNEXPECTED, l_module_name,'ERROR OCCURRED IN UPDATE_LOCKBOX_TEMP - '||SQLERRM);
Line: 608

 END update_lockbox_temp;
Line: 623

 PROCEDURE update_interim_table(v_table IN VARCHAR2,
                                v_decrease_appl_amt IN NUMBER,
                                v_upd_customer_trx_id IN NUMBER,
                                v_upd_pay_sch_id IN NUMBER) IS
  l_module_name VARCHAR2(200) := g_module_name || 'update_interim_table';
Line: 632

      update ar_interim_cash_rcpt_lines_all
         set payment_amount = nvl(v_decrease_appl_amt,0),
             customer_trx_id = v_upd_customer_trx_id,
             payment_schedule_id = v_upd_pay_sch_id,
             last_updated_by = v_last_updated_by,
             last_update_date = v_last_update_date
       where cash_receipt_id = v_cash_receipt_id
         and cash_receipt_line_id = v_cash_receipt_line_id;
Line: 642

     FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,'UPDATE INTERIM LINES TABLE SETTING AMOUNT = '
                         ||to_char(v_decrease_appl_amt)||' on cash_receipt_id '
                         ||to_char(v_cash_receipt_id));
Line: 651

     v_errbuf  := 'update_interim_table '||sqlerrm;
Line: 652

     FV_UTILITY.LOG_MESG(FND_LOG.LEVEL_UNEXPECTED, l_module_name,'ERROR OCCURRED IN UPDATE_INTERIM_TABLE - '||SQLERRM);
Line: 656

 END update_interim_table;