Friday, August 24, 2012

AR Invoice Printing Update


API to update AR Invoice Printing Details in R12 AR_INVOICE_SQL_FUNC_PUB


This API can be used to update the below details of an AR Transaction. I hope this is the only public api available for updating the AR Transaction.

SELECT printing_pending,
       printing_count,
       printing_last_printed,
       printing_original_date,
       last_printed_sequence_num
  FROM ra_customer_trx;


API USED: AR_INVOICE_SQL_FUNC_PUB.UPDATE_CUSTOMER_TRX


SCRIPT:

SET SERVEROUTPUT ON;
DECLARE
   p_choice                   VARCHAR2 (200);
   p_customer_trx_id          NUMBER;
   p_trx_type                 VARCHAR2 (200);
   p_term_count               NUMBER;
   p_term_sequence_number     NUMBER;
   p_printing_count           NUMBER;
   p_printing_original_date   DATE;
   l_print_pend               CHAR (1);
   l_print_last_printed       DATE;
BEGIN
   p_choice                 := 'PRI';
   p_customer_trx_id        := 3001;
   p_trx_type               := NULL;
   p_term_count             := NULL;
   p_term_sequence_number   := NULL;
   p_printing_count         := 1;
   p_printing_original_date := NULL;
  
   AR_INVOICE_SQL_FUNC_PUB.UPDATE_CUSTOMER_TRX
          (p_choice                      => p_choice,
           p_customer_trx_id             => p_customer_trx_id,
           p_trx_type                    => p_trx_type,
           p_term_count                  => p_term_count,
           p_term_sequence_number        => p_term_sequence_number,
           p_printing_count              => p_printing_count,
           p_printing_original_date      => p_printing_original_date
          );

   SELECT printing_pending, printing_last_printed
     INTO l_print_pend, l_print_last_printed
     FROM ra_customer_trx_all rctl
    WHERE rctl.customer_trx_id = p_customer_trx_id;

   DBMS_OUTPUT.put_line ('printing_pending := ' || l_print_pend);
   DBMS_OUTPUT.put_line ('printing_last_printed := ' || l_print_last_printed);
END;

No comments:

Post a Comment