The following lines contain the word 'select', 'insert', 'update' or 'delete':
| Procedure Name : insert_full_merge_event |
| Description : Create THIRD_PARTY_MERGE entity if it do not exists. |
| Create FULL_MERGE events for the customer sites merged. |
+--------------------------------------------------------------------------+
| History : |
| 12-JUL-2010 Sachin Dixit Created for bug 9338111 |
+--------------------------------------------------------------------------+
| |
| Details : |
| 1) p_third_party_type : values can be 'C' (Customer) or 'S' (Supplier) |
| |
| 2) p_type_of_third_party_merge : Can be FULL or PARTIAL |
| |
| 3) p_execution_mode : values can be SYNC, ASYNC_NOREQ and ASYNC_REQ |
| 3.1) In 'SYNC' mode code will call API to create accounting |
| 3.2) In 'ASYNC_REQ' mode code will submit the concurrent program - |
| Create Third Party Merge Accounting |
| 3.3) In 'ASYNC_NOREQ' code will keep the events in unprocessed status |
| |
| 4) p_accounting_mode : Values can be 'D' (Draft) or 'F' (Final) |
| |
+-------------------------------------------------------------------------*/
Procedure insert_full_merge_event (req_id NUMBER, set_num NUMBER, process_mode VARCHAR2) IS
x_errbuf VARCHAR2(1000);
Cursor select_merge_cust (req_id NUMBER , set_num NUMBER ) IS
SELECT * FROM ra_customer_merges
WHERE process_flag = 'N'
AND request_id = req_id
AND set_number = set_num ;
arp_message.set_line( 'ARP_CMERGE.INSERT_FULL_MERGE_EVENT()+');
INSERT INTO xla_events_gt
(application_id
,ledger_id
,entity_code
,source_id_int_1
,valuation_method)
VALUES
(222
,arp_global.set_of_books_id
,'THIRD_PARTY_MERGE'
,NULL
,NULL);
SELECT ACCOUNTING_MODE_CODE, SUBMIT_TRANSFER_TO_GL_FLAG, SUBMIT_GL_POST_FLAG
INTO p_accounting_mode, p_transfer_to_gl_flag, p_post_in_gl_flag
FROM XLA_SUBLEDGER_OPTIONS_V
WHERE APPLICATION_ID = 222
AND LEDGER_ID = arp_global.set_of_books_id;
For C1 IN select_merge_cust(req_id , set_num) LOOP
IF PG_DEBUG in ('Y', 'C') THEN
arp_message.set_line ('Calling xla_third_party_merge_pub.third_party_merge');
arp_message.set_line( 'ARP_CMERGE.INSERT_FULL_MERGE_EVENT()-');
arp_message.set_line( 'default_gl_date Error in insert_full_merge_event ' || sqlerrm);
arp_message.set_line( 'Others Error in insert_full_merge_event '|| sqlerrm);
END insert_full_merge_event ;
SELECT 1
FROM ra_customer_merges m
WHERE m.request_id = req_id
AND m.set_number = set_num
AND EXISTS
(
SELECT 1
FROM ar_cons_inv ci
WHERE ci.site_use_id IN (m.customer_site_id, m.duplicate_site_id)
AND ci.status = 'DRAFT'
);
insert_full_merge_event(req_id, set_num, process_mode);