Saturday 8 September 2012

AR Receipts Creation APIs in Oracle Apps

To create a header.


BEGIN
               ar_receipt_api_pub.create_cash
                  (p_api_version                => 1.0,
                   p_init_msg_list              => fnd_api.g_true,
                   p_commit                     => l_commit,
                   p_validation_level           => fnd_api.g_valid_level_full,
                   x_return_status              => l1_return_status,
                   x_msg_count                  => l_msg_count,
                   x_msg_data                   => l1_msg_data,
                   p_currency_code              => l_currency_code_idr,
                   p_exchange_rate_type         => 'User',
                   p_exchange_rate              => curec_ar_load_recpts.ted_ccy_rate,
                   p_exchange_rate_date         => curec_ar_load_recpts.ted_date,
                   p_amount                     => curec_ar_load_recpts.ted_adjusted_amount,
                   p_receipt_number             => g_prefix1||curec_ar_load_recpts.ted_voucher_number,
                   p_receipt_date               => curec_ar_load_recpts.ted_date,
                   p_customer_id                => l_cust_account_id,
                   p_receipt_method_id          => g_rec_method_id,
                   p_attribute_rec              => l_attribute_rec,
                   -- ******* Global Flexfield parameters *******
                   p_global_attribute_rec       => l_global_attribute_rec,
                   p_comments                   =>    'The Total Batch Amount is '|| l_total_amount,
                   --*****  Notes Receivable Additional Information ****
                   p_issuer_name                => l_issuer_name,
                   p_issue_date                 => l_issue_date,
                   p_issuer_bank_branch_id      => l_issuer_bank_branch_id,
                   ---** OUT NOCOPY variables
                   p_cr_id                      => l_cr_id
                  );
END;

Then Applying the Receipt to On Account.


BEGIN              
                  AR_RECEIPT_API_PUB.APPLY_ON_ACCOUNT
                     (
                      -- Standard API parameters.
                      p_api_version                       => 1.0,
                      p_init_msg_list                     => fnd_api.g_true,
                      p_commit                            => l_commit,
                      p_validation_level                  => fnd_api.g_valid_level_full,
                      x_return_status                     => l2_return_status,
                      x_msg_count                         => l_msg_count,
                      x_msg_data                          => l2_msg_data,
                      --  Receipt application parameters.
                      p_cash_receipt_id                   => l_cr_id,
                      p_amount_applied                    => l_apply_on_account_amount,
                      p_apply_date                        => curec_ar_load_recpts.ted_date,
                      p_apply_gl_date                     => SYSDATE,
                      p_ussgl_transaction_code            => l_ussgl_transaction_code,
                      p_attribute_rec                     => l_attribute_rec,
                      -- ******* Global Flexfield parameters *******
                      p_global_attribute_rec              => l_global_attribute_rec,
                      p_comments                          => l_comments,
                      p_application_ref_num               => l_application_ref_num,
                      p_secondary_application_ref_id      => l_secondary_application_ref_id,
                      p_customer_reference                => l_customer_reference,
                      p_called_from                       => l_called_from,
                      p_customer_reason                   => l_customer_reason,
                      p_secondary_app_ref_type            => l_secondary_app_ref_type,
                      p_secondary_app_ref_num             => l_secondary_app_ref_num
                     );
END;
Then Applying the Invoice to Receipt.

BEGIN
                              ar_receipt_api_pub.APPLY
                                 (p_api_version                      => 1.0,
                                  p_init_msg_list                    => fnd_api.g_true,
                                  p_commit                           => l_commit,
                                  p_validation_level                 => fnd_api.g_valid_level_full,
                                  x_return_status                    => l3_return_status,
                                  x_msg_count                        => l_msg_count,
                                  x_msg_data                         => l3_msg_data,
                                  p_cash_receipt_id                  => l_cr_id,
                                  p_customer_trx_id                  => l_customer_trx_id,
                                  p_applied_payment_schedule_id      => l_payment_schedule_id,
                                  p_show_closed_invoices             => 'N',
                                  p_amount_applied                   => r_cur_lns.ted_adjusted_amount,
                                  p_amount_applied_from              => curec_ar_load_recpts.ted_amount,
                                  p_apply_date                       => r_cur_lns.ted_date,
                                  p_apply_gl_date                    => SYSDATE
                                 );           
END;
 
For some of receipts treated as UNIDENTIFIED receipts.( When we dont have customer details we will treat them as Unidentified. 
We can use same API ar_receipt_api_pub.create_cash where we dont pass customer Info.



No comments:

Post a Comment