Saturday, 31 August 2024

API To Generate GST TAX_INVOICE_NUM in AR for India Localization in APPS R12

 /*API To Generate GST TAX_INVOICE_NUM in AR*/

DECLARE
    v_process_status  VARCHAR2(30);
    v_process_message VARCHAR2(2000);
    CURSOR c IS
      SELECT a.entity_code,
             a.event_class_code,
             a.event_type_code,
             a.tax_event_class_code,
             a.tax_event_type_code,
             a.trx_id,
             SYSDATE TAX_INVOICE_DATE
      FROM   jai_tax_det_factors A,
             jai_tax_lines X
      WHERE  A.det_factor_id = X.det_factor_id
             AND A.trx_id = 3151442 --CUSTOMER_TRX_ID
             AND A.application_id = 222
             AND A.entity_code = 'TRANSACTIONS'
      HAVING Max(X.tax_invoice_num) IS NULL
      GROUP  BY A.entity_code,
                A.event_class_code,
                A.event_type_code,
                A.tax_event_class_code,
                A.tax_event_type_code,
                A.trx_id;
BEGIN
    FOR c1 IN c LOOP
        jai_inv_num_gen_pkg.Process_generation(pn_application_id => 222,
        pv_entity_code => c1.entity_code,
        pv_event_class_code => c1.event_class_code,
        pv_event_type_code => c1.event_type_code,
        pv_tax_event_class_code => c1.tax_event_class_code,
        pv_tax_event_type_code => c1.tax_event_type_code,
        pv_interface_flag => NULL,
        pn_trx_id => c1.trx_id,
        pn_delivery_id => c1.trx_id, pd_invoice_date => c1.tax_invoice_date,
        pv_process_status => v_process_status,
        pv_process_message => v_process_message);

        dbms_output.Put_line('Status=>'
                             ||v_process_status
                             ||':'
                             ||v_process_message);

        --FND_FILE.PUT_LINE(FND_FILE.LOG,'Status=>'||v_process_status||':'||v_process_message);    
        COMMIT;
    END LOOP;
END; 

Metalink Reference:- DATAFIX: GST Tax Invoice Number Not Generated For AR Transactions (Doc ID 2556466.1)

No comments:

Post a Comment