Showing posts with label Finance. Show all posts
Showing posts with label Finance. Show all posts

 List of Receipts API in Oracle Receivables

Below is the list of some of the Receipt API’s in Oracle Receivables. Receipt APIs provide an extension to existing functionality for creating and manipulating receipts through standard AR Receipts forms and lockboxes.

AR_RECEIPT_API_PUB is the main package that has several procedures to perform different actions.

1] AR_RECEIPT_API_PUB.CREATE_CASH

Use this procedure to create a single cash receipt for payment received in the form of a check or cash.

2] AR_RECEIPT_API_PUB.APPLY & AR_RECEIPT_API_PUB.APPLY_IN_DETAIL

Use these procedures to apply the cash receipts from a customer to an invoice, debit memo, or other debit item.

3] AR_RECEIPT_API_PUB.UNAPPLY

Use this procedure to unapply a cash receipt application against a specified installment of a debit item or payment schedule ID.

4] AR_RECEIPT_API_PUB.CREATE_AND_APPLY 

Use this procedure  to create a cash receipt and apply it to a specified installment of a debit item.

5] AR_RECEIPT_API_PUB.REVERSE

Use this procedure to reverse cash and miscellaneous receipts.

6] AR_RECEIPT_API_PUB.APPLY_ON_ACCOUNT

Use this procedure to apply a cash receipt on account.

7] AR_RECEIPT_API_PUB.UNAPPLY_ON_ACCOUNT

Use this procedure to unapply an on-account application of a specified cash receipt.

8] AR_RECEIPT_API_PUB.ACTIVITY_APPLICATION

Use this procedure to create an activity application on a cash receipt, including Short Term  Debit (STD) and Receipt Write-off applications.

9] AR_RECEIPT_API_PUB. ACTIVITY_UNAPPLICATION

Use this procedure to create a reversal of an activity application on a cash receipt including Short Term Debt and Receipt write-off.

10] AR_RECEIPT_API_PUB.CREATE_MISC

Use this procedure to create a miscellaneous receipt.

11] AR_RECEIPT_API_PUB.APPLY_OPEN_RECEIPT

Use this procedure to apply a cash receipt to another open receipt. Open receipts include unapplied cash, on-account cash, and claim investigation applications.

12] AR_RECEIPT_API_PUB.UNAPPLY_OPEN_RECEIPT

Use this procedure to reverse a payment netting application on a  cash receipt.

SELECT
    *
FROM
    (
        SELECT
            'N' select_flag,
            'N' hide_show,
            xgl.name              ledger,
            xte.ledger_id,
            le.name               legal_entity,
            xte.legal_entity_id,
            xlk.meaning           event_status,
            xe.event_status_code,
            xe.process_status_code,
            xecl.name             event_class,
            xecl.event_class_code,
            xetl.name             event_type,
            xetl.event_type_code,
            xte.transaction_number,
            xe.creation_date      event_creation_date,
            xe.event_id,
            'N' retrieve_flag,
            NULL transaction_id1_prompt,
            NULL transaction_id1_value,
            NULL transaction_id2_prompt,
            NULL transaction_id2_value,
            NULL transaction_id3_prompt,
            NULL transaction_id3_value,
            NULL transaction_id4_prompt,
            NULL transaction_id4_value,
            NULL transaction_id5_prompt,
            NULL transaction_id5_value,
            NULL transaction_id6_prompt,
            NULL transaction_id6_value,
            NULL transaction_id7_prompt,
            NULL transaction_id7_value,
            NULL transaction_id8_prompt,
            NULL transaction_id8_value,
            NULL transaction_id9_prompt,
            NULL transaction_id9_value,
            NULL transaction_id10_prompt,
            NULL transaction_id10_value,
            xe.event_date         event_date,
            xe.event_number       event_number,
            xte.entity_code,
            DECODE(xe.event_status_code, 'U', DECODE(xe.process_status_code, 'E', 'Error', 'I', 'Error', 'NoError'), 'NoError') error_switch
            ,
            xte.source_id_int_1,
            xte.source_id_int_2,
            xte.source_id_int_3,
            xte.source_id_int_4,
            xte.source_id_char_1,
            xte.source_id_char_2,
            xte.source_id_char_3,
            xte.source_id_char_4,
            xte.security_id_int_1,
            xte.security_id_int_2,
            xte.security_id_int_3,
            xte.security_id_char_1,
            xte.security_id_char_2,
            xte.security_id_char_3,
            xte.valuation_method,
            xlk.lookup_code       display_status_code,
            xe.application_id,
            xe.on_hold_flag,
            xlk1.meaning          on_hold_status,
            xe.transaction_date,
            xe.transaction_date   transaction_date_from,
            xe.transaction_date   transaction_date_to
        FROM
            xla_events                 xe,
            xle_entity_profiles        le,
            xla_transaction_entities   xte,
            gl_ledgers                 xgl,
            xla_event_classes_tl       xecl,
            xla_event_types_tl         xetl,
            xla_lookups                xlk,
            xla_lookups                xlk1
        WHERE
            xe.entity_id = xte.entity_id
            AND xte.application_id = xe.application_id
            AND xte.ledger_id = xgl.ledger_id
            AND xte.legal_entity_id = le.legal_entity_id (+)
            AND xetl.application_id = xe.application_id
            AND xetl.event_type_code = xe.event_type_code
            AND xetl.language = userenv('LANG')
            AND xecl.application_id = xetl.application_id
            AND xecl.entity_code = xetl.entity_code
            AND xecl.event_class_code = xetl.event_class_code
            AND xecl.language = userenv('LANG')
            AND xlk.lookup_type = 'XLA_EVENT_DISPLAY_STATUS'
            AND xlk.lookup_code = DECODE(xe.event_status_code, 'I', 'I', 'N', 'N', 'P', 'A', DECODE(xe.process_status_code, 'U', 'U'
            , 'D', 'D', 'R', 'R', 'E'))
            AND xlk1.lookup_type = 'XLA_YES_NO'
            AND xlk1.lookup_code = xe.on_hold_flag
            AND xe.application_id = P_Application_Id 
            AND xgl.object_type_code = 'L'
            AND xgl.le_ledger_type_code = 'L'
            AND xgl.ledger_category_code IN (
                'NONE',
                'PRIMARY',
                P_Leder_Id
            )
    ) qrslt
WHERE
    ( entity_code = P_ENTITY_CODE
      AND ledger_id = P_ledger_id
      AND nvl(source_id_int_1, - 99) = P_source_id_int_1);
    

SELECT distinct 
    aia.invoice_id,
    aia.invoice_num,
    aia.invoice_date,
    aia.invoice_amount,
    aia.invoice_currency_code,
    aia.payment_currency_code,
    aia.gl_date,
    xah.period_name,
    aia.payment_method_code,
    xah.je_category_name,
    xev.event_id,
    xte.ENTITY_CODE
    ,xte.APPLICATION_ID
    ,xte.legal_entity_id
    ,source_id_int_1
    ,source_application_id
    ,source_id_int_2
    ,source_id_char_1
    ,gjh.status
FROM
    ap.ap_invoices_all             aia,
    xla.xla_transaction_entities   xte,
    xla.xla_events                 xev,
    xla.xla_ae_headers             xah,
    xla.xla_ae_lines               xal,
    gl_import_references           gir,
    gl_je_headers                  gjh,
    gl_je_lines                    gjl,
    gl_code_combinations           gcc
WHERE
    aia.invoice_id = xte.source_id_int_1
    AND xev.entity_id = xte.entity_id
    AND xah.entity_id = xte.entity_id
    AND xah.event_id = xev.event_id
    AND xah.ae_header_id = xal.ae_header_id
    AND xah.je_category_name = 'XX_CATEGORY_NAME'--Purchase Invoices
    AND xah.gl_transfer_status_code = 'Y'
    AND xal.gl_sl_link_id = gir.gl_sl_link_id
    AND gir.gl_sl_link_table = xal.gl_sl_link_table
    AND gjl.je_header_id = gjh.je_header_id
    AND gjh.je_header_id = gir.je_header_id
    AND gjl.je_header_id = gir.je_header_id
    AND gir.je_line_num = gjl.je_line_num
    and gjh.name='XX_JOURNAL_NAME'
    and aia.invoice_num='XX_INVOICE_NUM';
DECLARE
p_event_source_info xla_events_pub_pkg.t_event_source_info;

lv_valuation_method VARCHAR2(100) :=null;
lv_security_context xla_events_pub_pkg.t_security;
BEGIN

p_event_source_info.source_application_id := 200; --101 GL -- 602 XLE
p_event_source_info.application_id := 200; -- AR
p_event_source_info.legal_entity_id := 23273;
p_event_source_info.ledger_id := 2021;
p_event_source_info.entity_type_code := 'AP_INVOICES';
p_event_source_info.transaction_number := NULL;
p_event_source_info.source_id_int_1 := 138348; -- Customer Transaction ID;
p_event_source_info.source_id_int_2 := NULL;
p_event_source_info.source_id_int_3 := NULL;
p_event_source_info.source_id_int_4 := NULL;
p_event_source_info.source_id_char_1 := NULL;
p_event_source_info.source_id_char_2 := NULL;
p_event_source_info.source_id_char_3 := NULL;
p_event_source_info.source_id_char_4 := NULL;

xla_events_pub_pkg.delete_event
(p_event_source_info => p_event_source_info,
p_event_id => 154087, -- xla_events
p_valuation_method =>lv_valuation_method,
p_security_context => lv_security_context
);

DBMS_OUTPUT.put_line('Process completed');
commit;

exception when others then

DBMS_OUTPUT.put_line('Error:'||SQLERRM);
END;
/

** To Find Parameters used in API navigate to below page :