The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Insert_Ae_Lines(p_ae_line_tbl IN ae_line_tbl_type);
select 'N'
into l_create_acct
from dual
where exists (select 'X'
from ar_distributions dist
where dist.source_id = p_ae_doc_rec.source_id
and dist.source_table = p_ae_doc_rec.source_table);
| Insert Accounting Entry Lines into AEL table |
+------------------------------------------------------*/
IF l_ae_created THEN
Insert_Ae_Lines(l_ae_line_tbl);
SELECT cash_receipt_id from ar_cash_receipts
where request_id = p_request_id;
SELECT receivable_application_id,
status
FROM ar_receivable_applications
where cash_Receipt_id = p_cash_receipt_id;
select rec.customer_trx_id customer_trx_id,
rec.receivable_application_id rec_app_id
from AR_RECEIVABLE_APPLICATIONS rec,
RA_CUSTOMER_TRX trx
where trx.customer_trx_id = rec.customer_trx_id
and trx.request_id = p_request_id;
SELECT adjustment_id, code_combination_id
FROM ar_adjustments
WHERE request_id = p_request_id;
| PUBLIC PROCEDURE Delete_Acct_Entry
|
| DESCRIPTION
| Delete accounting entries for a document
| ----------------------------------------
| This procedure is the standard delete routine which calls packages
| for Receipts, Credit Memos and Adjustments to delete the accounting
| associated with the document for a source id
|
| PARAMETERS
| p_mode IN Document or Accounting Event mode
| p_ae_doc_rec IN Document Record
| p_ae_event_rec IN Event Record
*=======================================================================*/
PROCEDURE Delete_Acct_Entry(
p_mode IN VARCHAR2, -- DOCUMENT or ACCT_EVENT
p_ae_doc_rec IN OUT NOCOPY ae_doc_rec_type,
p_ae_event_rec IN ae_event_rec_type
) IS
l_ae_deleted BOOLEAN := FALSE;
arp_standard.debug( 'ARP_ACCT_MAIN.Delete_Acct_Entry()+');
arp_standard.debug( 'Delete_Acct_Entry - Processing Accounting Method ' || l_accounting_method);
| Delete Accounting for Document |
+------------------------------------------------------*/
IF ( p_ae_doc_rec.document_type = 'RECEIPT' ) OR
(p_ae_doc_rec.document_type = 'CREDIT_MEMO') THEN
ARP_RECEIPTS_MAIN.Delete_Acct( p_mode,
p_ae_doc_rec,
p_ae_event_rec,
l_ae_deleted
);
ARP_ADJUSTMENTS_MAIN.Delete_Acct( p_mode,
p_ae_doc_rec,
p_ae_event_rec,
l_ae_deleted
);
ARP_BILLS_RECEIVABLE_MAIN.Delete_Acct( p_mode,
p_ae_doc_rec,
p_ae_event_rec,
l_ae_deleted
);
arp_standard.debug( 'ARP_ACCT_MAIN.Delete_Acct_Entry()-');
arp_standard.debug( 'EXCEPTION: ARP_ACCT_MAIN.Delete_Acct_Entry');
END Delete_Acct_Entry;
| PUBLIC PROCEDURE Delete_Acct_Entry
|
| DESCRIPTION
| Delete accounting entries for a document
| ----------------------------------------
| This is an overloaded procedure which calls packages associated
| with a Receipt, Credit Memo or Adjustment document to delete the
| accounting for a source id.
|
| PARAMETERS
| p_ae_doc_rec IN Document Record
*=======================================================================*/
PROCEDURE Delete_Acct_Entry(
p_ae_doc_rec IN OUT NOCOPY ae_doc_rec_type
) IS
l_mode VARCHAR2(1);
arp_standard.debug( 'Overloaded ARP_ACCT_MAIN.Delete_Acct_Entry()+');
Delete_Acct_Entry(l_mode, p_ae_doc_rec, l_ae_event_rec);
arp_standard.debug( 'Overloaded ARP_ACCT_MAIN.Delete_Acct_Entry()-');
arp_standard.debug( 'EXCEPTION: Overloaded ARP_ACCT_MAIN.Delete_Acct_Entry');
END Delete_Acct_Entry;
| PUBLIC PROCEDURE Delete_Acct_Entry
|
| DESCRIPTION
| Delete accounting entries for a document
| ----------------------------------------
| This is an overloaded procedure which calls packages associated
| with a Receipt, Credit Memo or Adjustment document to delete the
| accounting for a source id. Required for C code delete calls.
|
| PARAMETERS
| p_ae_doc_rec IN Document Record
*=======================================================================*/
PROCEDURE Delete_Acct_Entry(
p_document_type IN VARCHAR2,
p_document_id IN NUMBER ,
p_accounting_entity_level IN VARCHAR2,
p_source_table IN VARCHAR2,
p_source_id IN NUMBER ,
p_source_id_old IN OUT NOCOPY NUMBER ,
p_other_flag IN VARCHAR2
) IS
l_mode VARCHAR2(1);
arp_standard.debug( 'Overloaded ARP_ACCT_MAIN.Delete_Acct_Entry()+');
Delete_Acct_Entry(l_mode, l_ae_doc_rec, l_ae_event_rec);
arp_standard.debug( 'Overloaded ARP_ACCT_MAIN.Delete_Acct_Entry()-');
arp_standard.debug( 'EXCEPTION: Overloaded ARP_ACCT_MAIN.Delete_Acct_Entry');
END Delete_Acct_Entry;
| PRIVATE PROCEDURE Insert_Ae_Lines
|
| DESCRIPTION
| Inserts into AR_DISTRIBUTIONS accounting lines
| ----------------------------------------------
| Calls the table handler for AR_DISTRIBUTIONS to insert accounting
| for a given document into the underlying table.
|
| PARAMETERS
| p_ae_line_tbl IN Accounting lines table
*=======================================================================*/
PROCEDURE Insert_Ae_Lines(p_ae_line_tbl IN ae_line_tbl_type) IS
l_ae_line_rec ar_distributions%ROWTYPE;
arp_standard.debug( 'ARP_ACCT_MAIN.Insert_Ae_Lines()+');
arp_distributions_pkg.insert_p(l_ae_line_rec, l_dummy);
arp_standard.debug( 'ARP_ACCT_MAIN.Insert_Ae_Lines()-');
arp_standard.debug('EXCEPTION: ARP_ACCT_MAIN.Insert_Ae_Lines');
END Insert_Ae_Lines;
SELECT sob.set_of_books_id,
sob.chart_of_accounts_id,
sob.currency_code,
c.precision,
c.minimum_accountable_unit,
sysp.code_combination_id_gain,
sysp.code_combination_id_loss,
sysp.code_combination_id_round,
sysp.accounting_method
INTO ae_sys_rec.set_of_books_id,
ae_sys_rec.coa_id,
ae_sys_rec.base_currency,
ae_sys_rec.base_precision,
ae_sys_rec.base_min_acc_unit,
ae_sys_rec.gain_cc_id,
ae_sys_rec.loss_cc_id,
ae_sys_rec.round_cc_id,
p_accounting_method
FROM ar_system_parameters sysp,
gl_sets_of_books sob,
fnd_currencies c
WHERE sob.set_of_books_id = sysp.set_of_books_id --would be the row returned from multi org view
AND sob.currency_code = c.currency_code;