Thursday, August 13, 2015

Oracle AR Outstanding Amount (Aging Report)

Customer outstanding amount.

The table ar_payment_Schedules_all gives you the outstanding information as on date. For eg. if the system date is 13th April and if you query the ar_payment_schedules_all table, the amount_due_remaining column will give you the open amount as on that date.
However if you want the oustanding as on some previous date, lets say as on 31st March, in that case you have to rollback all the applications that would have occured from 1st april to 13th april.

Find below the script that I used to get the oustanding as on any previous date. Pls. note that I am using a temp table here to populate the details.

CREATE TABLE ZXC_AGING_CUST1
(
   CUSTOMER_ID                NUMBER,
   INVOICE_NUMBER             VARCHAR2 (20),
   INVOICE_DATE               DATE,
   GL_DATE                    DATE,
   INVOICE_AMOUNT             NUMBER,
   TAX_AMOUNT                 NUMBER,
   ACCTD_OUTSTANDING_AMOUNT   NUMBER,
   DUE_DATE                   DATE,
   DAYS_OUTSTANDING           NUMBER,
   INSTALLMENT_NUMBER         NUMBER,
   DAYS_LATE_AS_OF            NUMBER,
   CURRENT_OS_AMT             NUMBER,
   CASH_RECEIPT_AMT           NUMBER,
   ADJ_AMT                    NUMBER,
   CREDIT_MEMO_AMT            NUMBER,
   CREDIT_MEMO_AMT_1          NUMBER
);

CREATE TABLE ZXC_AGING_CUST2
(
   CUSTOMER_ID                NUMBER,
   INVOICE_NUMBER             VARCHAR2 (20),
   TRX_TYPE                   VARCHAR2 (100),
   ACCTD_OUTSTANDING_AMOUNT   NUMBER,
   GL_DATE                    DATE
);


DECLARE
   v_cash_receipt              NUMBER;
   v_adjustment                NUMBER;
   v_credit_memo               NUMBER;
   v_as_of_outstanding         NUMBER;
   v_cash_receipt_acctd        NUMBER;
   v_adjustment_acctd          NUMBER;
   v_credit_memo_acctd         NUMBER;
   v_credit_memo_acctd_1       NUMBER;
   v_as_of_outstanding_acctd   NUMBER;
   p_as_of_date                DATE;


   CURSOR cs_get_trx (
      p_as_of_date1 IN DATE)
   IS
      SELECT ps.customer_id CUST_ACCOUNT_ID,
             trx.creation_date INV_CREATION_DATE,
             ps.trx_number INVOICE_NUMBER,
             trx.trx_date INVOICE_DATE,
             ps.gl_date GL_DATE,
             NVL (ps.amount_due_original, 0) INVOICE_AMOUNT,
             NVL (ps.tax_original, 0) TAX_AMOUNT,
             NVL (ps.acctd_amount_due_remaining, 0) ACCTD_OUTSTANDING_AMOUNT,
             ps.due_date,
             CEIL (SYSDATE - ps.due_date) DAYS_OUTSTANDING,
             ps.payment_schedule_id,
             ps.number_of_due_dates INSTALLMENT_NUMBER,
             trx.customer_trx_id,
             CEIL (p_as_of_date1 - ps.due_date) DAYS_LATE_AS_OF
        FROM ra_customer_trx TRX, ar_payment_schedules PS
       WHERE     trx.customer_trx_id = ps.customer_trx_id
             AND ps.gl_date <= p_as_of_date1
             AND ps.gl_date_closed > p_as_of_date1;


   CURSOR cs_get_receipt (
      p_as_of_date2 IN DATE)
   IS
        SELECT ps.customer_id CUST_ACCOUNT_ID,
               ps.payment_schedule_id,
               CEIL (p_as_of_date - ps.GL_DATE) days_late_as_of_r,
               ps.gl_date,
               cr.receipt_number,
               app.cash_receipt_id,
               SUM (app.acctd_amount_applied_from) ACCTD_AMOUNT_APPLIED
          FROM ar_receivable_applications app,
               ar_cash_receipts cr,
               ar_payment_schedules ps
         WHERE     app.cash_receipt_id = cr.cash_receipt_id
               AND app.payment_schedule_id = ps.payment_schedule_id
               AND app.status IN ('ACC', 'UNAPP', 'UNID', 'OTHER ACC')
               AND NVL (app.confirmed_flag, 'Y') = 'Y'
               AND app.gl_date <= p_as_of_date2
               AND ps.gl_date <= p_as_of_date2
               AND ps.gl_date_closed > p_as_of_date2
               AND (   (    app.reversal_gl_date IS NOT NULL
                        AND ps.gl_date <= p_as_of_date2)
                    OR app.reversal_gl_date IS NULL)
      GROUP BY ps.customer_id,
               cr.receipt_number,
               app.cash_receipt_id,
               ps.payment_schedule_id,
               ps.gl_date
        HAVING SUM (app.acctd_amount_applied_from) <> 0;
BEGIN
   BEGIN
      mo_global.set_policy_context ('S', '69');
   END;

   DELETE zxc_aging_cust1;

   p_as_of_date := TO_DATE ('&Enter_as_of_date', 'DD-MON-RRRR');

   FOR invoice IN cs_get_trx (p_as_of_date)
   LOOP
      /* cash applied after p_as_of_date */

      SELECT NVL (
                SUM (
                     NVL (acctd_amount_applied_to, 0.0)
                   + NVL (acctd_earned_discount_taken, 0.0)
                   + NVL (acctd_unearned_discount_taken, 0.0)),
                0.0)
        INTO v_cash_receipt_acctd
        FROM ar_receivable_applications
       WHERE     TRUNC (gl_date) > p_as_of_date
             AND status || '' = 'APP'
             AND NVL (confirmed_flag, 'Y') = 'Y'
             AND applied_payment_schedule_id = invoice.payment_schedule_id
             AND application_type LIKE 'CASH%';


      /* adjustments applied after p_as_of_date */

      SELECT NVL (SUM (ar_adjustments.acctd_amount), 0.0)
        INTO v_adjustment_acctd
        FROM ar_adjustments
       WHERE     TRUNC (gl_date) > p_as_of_date
             AND status = 'A'
             AND payment_schedule_id = invoice.payment_schedule_id;


      /* invoice credited after p_as_of_date */

      SELECT NVL (SUM (NVL (acctd_amount_applied_to, 0.0)), 0.0)
        INTO v_credit_memo_acctd
        FROM ar_receivable_applications
       WHERE     applied_payment_schedule_id = invoice.payment_schedule_id
             AND NVL (confirmed_flag, 'Y') = 'Y'
             AND status || '' = 'APP'
             AND TRUNC (gl_date) > p_as_of_date
             AND application_type LIKE 'CM%';

      /* credit memo applied after p_as_of_date */
      SELECT NVL (SUM (NVL (acctd_amount_applied_to, 0.0)), 0.0)
        INTO v_credit_memo_acctd_1
        FROM ar_receivable_applications
       WHERE     payment_schedule_id = invoice.payment_schedule_id
             AND NVL (confirmed_flag, 'Y') = 'Y'
             AND status || '' = 'APP'
             AND TRUNC (gl_date) > p_as_of_date
             AND application_type LIKE 'CM%';


      /* calculate actual outstanding amount */

      v_as_of_outstanding_acctd :=
           invoice.acctd_outstanding_amount
         + v_cash_receipt_acctd
         - v_adjustment_acctd
         + v_credit_memo_acctd
         - v_credit_memo_acctd_1;



      INSERT INTO zxc_aging_cust1 (customer_id,
                                   invoice_number,
                                   invoice_date,
                                   gl_date,
                                   invoice_amount,
                                   tax_amount,
                                   acctd_outstanding_amount,
                                   due_date,
                                   days_outstanding,
                                   installment_number,
                                   days_late_as_of,
                                   current_os_amt,
                                   cash_receipt_amt,
                                   adj_amt,
                                   credit_memo_amt,
                                   credit_memo_amt_1)
           VALUES (invoice.cust_account_id,
                   invoice.invoice_number,
                   invoice.invoice_date,
                   invoice.gl_date,
                   invoice.invoice_amount,
                   invoice.tax_amount,
                   v_as_of_outstanding_acctd,
                   invoice.due_date,
                   invoice.days_outstanding,
                   invoice.installment_number,
                   invoice.days_late_as_of,
                   invoice.acctd_outstanding_amount,
                   v_cash_receipt_acctd,
                   v_adjustment_acctd,
                   v_credit_memo_acctd,
                   v_credit_memo_acctd_1);
   END LOOP;

   COMMIT;

   FOR receipt IN cs_get_receipt (p_as_of_date)
   LOOP
      INSERT INTO zxc_aging_cust2 (customer_id,
                                   invoice_number,
                                   trx_type,
                                   acctd_outstanding_amount,
                                   gl_date)
           VALUES (receipt.cust_account_id,
                   receipt.receipt_number,
                   'RECEIPT',
                   -1 * receipt.acctd_amount_applied,
                   receipt.gl_date);
   END LOOP;

   COMMIT;
END;

Wednesday, August 5, 2015

Oracle Report Manager Release Notes, Release 12.0.6 (Note 741767.1)
This document provides delta ination from Release Update Pack 4 (.ATG_PF.A.DELTA.4) to Oracle Report Manager Release Update Pack 6 (R12.ATG_PF.A.DELTA.6). 


General Ledger Setup:

·        749971.1 : R12: How To Remove Balancing Segment Value Assignments From A Ledger
·        744962.1 : R12: How To Generate Reporting Sequence?
·        756230.1 : R12: Define Security Rules For Segment Company
·        753574.1 : How To Find Flex Structures Which Use The Same Flex_value_sets Twice
·        753232.1 : Cannot assign ledgers to multiple ledger sets - APP-FND-01206 error
·        752682.1 : After Upgrade To R12 Upgraded Translation Rate Types Cannot Be Updated
·        752013.1 : Impact of Chart of Accounts Segments On Performance
·        736255.1 : What Subledgers Are Supported For Third Party Control Accounts ?
·        746556.1 : R12: How To Map Accounts For Manual Journals To The Secondary Ledger
·        744196.1 : R12:Unable To Configure Additional Intercompany Rules

General Ledger Journals/Posting/Journal Import: 

·        736299.1 : How Are Users Restricted From Posting Journals Across Ledgers?
·        752978.1 : Enter Journal In GL Is Failing At Category With Error: ORA-06512 : in ''.GL_AUTOREVERSE_OPTIONS_PKG''.
·         752178.1 : What patch provides the posted_by column enhancement to the GL_JE_BATCHES table?
·         752016.1 : EA01 - You do not have read and write access to all of the journals in the batch
·        752012.1 : Unable To View Journal From Journal Approval Notification-ORA-10402 No Data Found
·        751679.1 : Is it Possible to Correct a Journal via the Journal Import Correct Screen Without Unfreezing the Source?
·        751841.1 : Recurring Journals (GLPRJE) Errors out with PRJE0008
·        750129.1 : Income Statement Closing Journals Dont Close All Rev/Exp Accounts
·        751816.1 : Imported Journals Error With EC08, EC03 From Journal Wizard With Currency In Lower Case
·        729256.1 : R12: PPOS0002: Posting Error, COA Mapping Invalid or Disabled Error
·        749239.1 : R12 Journal Wizard: Budget LOV Returns No Values For Budget Journal
·        728303.1 : R12: Oracle Error 20001 In Fdpstp When Running Journal Autocopy
·        729312.1 : Unable to Edit Journal From Correct Journal Import Form, When Source is Not Frozen
·        747594.1 : R12: Journal Amount ($) Not Displaying On Journal Approval Email Notifications
·        735347.1 : Autocopy Journal Results in Two Copies of the Reporting Currency Journal Being Created
·        747501.1 : R12: Journal Wizard Throws ''This Application Function Is Not Configured To Any Integrator''

      1. Confirm the correct settings for this profile option, logged in as sysadmin: GL : Default Desktop Viewer - this needs to point to your correct excel version

2. If this works for some responsibilities but does not work for some others, please compare them as explained below: 
2.1. For the responsibility for which this is working, query the Menu from sysadmin--application--menu
2.2. Check the function name defined for the journal wizard (Launch Journal Wizard)
2.3. Go to sysadmin--application--function and query the same function name, take screenshots of the various tabs - Description, Properties, Form and Web HTML
2.4. Now for the responsibility for which this is not working, again query the menu from sysadmin.
2.5. Check the function name defined for the journal wizard
Note- if the problematic responsibilities use customized menus, make sure you added the correct function and not a similar one for Journal Wizard (eg. GL_ADI_JOURNAL_WIZARD_LAUNCH against GL_ADI_JOURNAL_WIZARD_LAUNCH_G)
2.6. Query the function name defined and check that the values in the Description, Properties, Form and Web HTML tabs are the same as that in the function for the working responsibility.
2.7. If the correct function is not added, add it and retest the issue. 

3. If this does not work for any responsibility and it never did, again follow the steps above and add the Launch Journal Wizard function manually.
Make sure you have attached GL_SUPERUSER menu to the responsibility (seeded) or if a custom menu is involved, follow the steps above and add the missing function by comparing to the seeded GL_SUPERUSER menu. 

4. Make sure you did not add GL_SUPERUSER_G menu instead of GL_SUPERUSER without intending so.
If you are not a Public Sector customer, you might reconsider and use the seeded GL_SUPERUSER.
If you need to use GL_SUPERUSER_G menu please check Note 453557.1 'Menu "GL_SUPERUSER" has ASM feature, but "GL_SUPERUSER_G" menu does not.' as you might have run into BUG 6207483 ' R12 SIP THE DIFFERENCE BETWEEN WITH _G MENUS AND WITHOUT _G MENUS'.

·        746560.1 : GLPPOSS Hanging On INSERT INTO GL_ACCOUNT_HIERARCHIES
·        552209.1 : R12: ''Journal Import Created'' Shown On Journal Description Line Instead Of Detailed Subledger Information
·        744405.1 : R12 How Can Budget Journal Records Be Removed From GL_BC_PACKETS ? 
·        742727.1 : R12: Posting Errors With ORA-01400: cannot insert NULL into ''GL''.''GL_BC_PACKETS_HISTS'' 
·        727434.1 : R12-Generating Error FRM-41017 When Reviewing Budget Journals
·        743516.1 : R12: Posting Intracompany Journal throws ''PPOS0261: The following journals post to balancing segment values which are not mapped to legal entities''
·        742891.1 : R12:Intercompany Segment Not ally Populated By Intercompany Balancing Rules 
·        742383.1 : R12: Sequencing/Document Numbering Not Working for SLA Create Accounting Process Created Journals
·        742170.1 : Journal Reversal Criteria Is Not Working For Imported Journals
·          741946.1 : R12 Cannot Change Period On Unposted Reversal Journals

General Ledger Miscellaneous:
·        756311.1 R12 Budget Mass allocations for Multiple Periods Completes with Error: ORA-00904: SV0 CHILD_FLEX_VALUE Invalid Identifier
·        756160.1 Upgrading From R11 to R12 Fails Glrstinc.Sql - ORA-00001 GL_SUMMARY_HIERARCHIES_U1 Violated
·        755680.1 GLRXVCJ Journals - Voucher: OPP states: Extension function error: Error invoking ''regroup''
·        755116.1 Autocopy Should Not Copy The Reporting Currency Journal - It Results In Duplicate Journals In Reporting Ledger
·        754354.1 R12 General Ledger Account Balances Across Ledgers Report (GLRGCBGT) Errors with REP-0069, REP-57054, ORA-06512: at APPS.GL_ACCESS_SETS_PKG
·        753562.1 GLAVAL Validate MassAllocations Terminated With Signal 11
·        558518.1 What is the latest General Ledger performance patch for the summarization programs for 11i?
·        751698.1 Daily Rates Import And Calculation Process Errors with Duplicate Row or Overlapping Date Range Found
·        746311.1 R12: GLCRVL Revaluation Throws ''CRVL0005: Unable to create unrealized gain/loss accounts''
·        742025.1 Performance Issue With Translation Program After Upgrading To 10G Database
·        752173.1 R12: The Upload option in the Budget Integrator menu disappears
·        751714.1 Translated Subsidiary Balance Does Not Match Consolidated Balance -Why?
·        751072.1 How To Find Whether A Message Is From A Security Rule Or A Cross Validation Rule
·        750917.1 R12: GLOOAP: OOAP0017: Please Define The Ledger Initial Period
·        750339.1 R12: Running Account Inquiry When Data Access Set is Defined as Read Only Causes Unexpected Error
·        731221.1 R12: Unable to Drill Down from Ledger to Subledger Payables with Legal Entity Security Rule
·        748624.1 Funds Transfer Makes Funds Available Before Approval
·        747901.1 GLCheckSetup DIAG - UNABLE TO CONVERT PERIOD START OR END DATE TO DATE FORMAT
·        747460.1 Mass Allocation Is Creating Large Amount Under Rounding Adjustment
·        746347.1 AUTOMATIC RECONCILIATION NOT WORKING WHEN SUM DEBIT SUM CREDIT = 0
·        746221.1 What Is The Impact In The Period Closing If Multiple Operating Units Share Same Ledger
·        744646.1 In Release 12 What Are The Budgetary Control Funds Checking STATUS_CODE Values ?
·        744147.1 Journal Reconciliation form (GLXRCENT) Does Not Open Review Journal When Pressing The Button 
·        741050.1 GLXACSDW Account Analysis Subledger Details Errors For One Account With REP-1401 
·        744147.1 Journal Reconciliation form (GLXRCENT) Does Not Open Review Journal When Pressing The Button

General Ledger FSG:
·        550281.1 R12: FSG with CPOI Token Always Shows First Calendar Period Defined for the Ledger in the Report Output
·        752756.1 FSG Report Fails With Error Message Name: RG_COMP_NONEXISTANT
·        751675.1 FSG DOESN''T DISPLAY LEDGER CURRENCY AMOUNTS
·        750417.1 R12: FSG Variance And Variance% Amounts Are Not Calculated
·        735024.1 R12: How To Restrict Access to FSG Parameters Using Definition Access Set?
·        747546.1 Clicking the Run Report button on the Define Report form(RGXGDREP) fails due to Ora-01403: No Data Found Frm-40735: When-Button-Pressed Trigger Raised
·        742667.1 R12 When Run FSG Using Ledger Set Report Errors With RG_RARG0005 But Report Runs Ok If Run For A Ledger
·        745550.1 FSG: PTD-Variance Incorrect Report with Multiple Currencies and Sets of Books
·        744514.1 Are XBRL Taxonomies Provided and Are Any Patches Required for XBRL for R12? 
·        742420.1 Message Not Found. Application: Sqlgl, Message Name: Gl_fsg_drl_err_error
·        740460.1 Generating Report For Xml Output Using Report manager Returns Signal 11
·        738834.1 FSG report run with The Output Type Set To - Get A Signal 11 Error

Oracle Internal Controls Manager:
·        736876.1 : We Are Not Able To Run And Review Violations For Concurrent Program Constraints
·        374461.1 : OICM: Where Do You Assign Process Owner To a Process?
·        567768.1 : Need to Link Latest Revision of Control to the Audit Procedure
·        382833.1 : How To Remove Processes from the Risk Library?
·        417515.1 : Cannot Access Findings And Remediation Tab Pages
·        362224.1 : OICM: Where are Constraints Sets Defined For Oracle Internal Controls Manager? 
·        752022.1 : Segregation Of Duties Creation (Preventative) Problem
·        747034.1 : Check For Constraint Violations Check Permissions Assigned To Roles?
·        745263.1 : Child Process Risk and Control Count Not updated on Risk Library when the Parent Process is Approved
·        745159.1 : Role And Responsibility Not Appearing On Sod Constraint Report
·        736876.1 : We Are Not Able To Run And Review Violations For Concurrent Program Constraints
·        726317.1 : Not Able to View Constraint Violations Report as PDF - Not a Supported File Type error
·        742662.1 : R12: Changes in Configurations Not Being Reflected In The ITA Module
·        742224.1 : Organization Sub-Process Removal From Parent Process Not Working
·        735551.1 : No Button Available To Assign Roles To Organizations 
·        734226.1 : OICM: Update Opinion Button Not Activated After Clicking Update Button

ADI/ADI/Report Manager: 
·        726958.1 : List of Patches Released in Report Manager for Releases 11i and 12 
·        726989.1 : List of Patches in Web Applications Desktop Integrator (Web ADI) for Releases 11i and 12
·        751948.1 : Unable To View Published Large FSG Reports - It Times Out
·        744855.1 : R12 While Opening The Large Fsg Report receive error: You have encountered an unexpected error
·        745061.1 : Unable To View Large FSG FRM Opens Blank Excel
·        746541.1 : R12: Is It Possible To Merge Report Manager One-Off Patches
·        749653.1 : Report manager - Drilldown in Excel hangs; works in HTML and PDF
·        750134.1 : System Errors When Creating A Menu Item From Reports Repository
·        751166.1 : FRM:Template Editor Does Not Generate Properly when Line Number have Decimals
·        739398.1 : Unable To Publish A Report In Excel With Report Manager
·        731281.1 : R12:Publishing FSG Report In Excel Results In 'You Have Insufficient Privileges'
·        740822.1 : R12: Calculation By Using Formulas Are Not Working On Web ADI Integrators
·        742740.1 : Exception During Parsing Of Upload Document-Budget Upload
·        556465.1 : Connection To The Server Error Msg When Using Web Adi journal upload
·        742740.1 : Exception During Parsing Of Upload Document-Budget Upload
·        751676.1 : How Can A User Refresh Data In A Previously Submitted Fsg?
·        751121.1 : Can a Custom Viewer Be Used With Report Manager?
·        747105.1 : Report Manager Does Not Drill Down From Excel, Multiple Tabs, When Expansion Value = All
·        746204.1 :  R12 Error Generated Excel Output Due To Use Of Double Underline In Row Set
·        733140.1 : FSG Drilldown Throws GL_FSG_DRL_IT_CONCISE_MSG And Shows A Different Account Than The One Selected For Drill
·        564264.1 Implementing WEBADI Budget Wizard Solution for 11i
·        735943.1 R12: Unable To Insert Rows On WebADI Budget Template-Spreadsheet Unprotected
Advanced Global Intercompany System:
·        726980.1 R12: How to Prevent Users From Entering AGIS Transactions in Closed GL Periods
·        752004.1 Import Intercompany Transactions Missing Transaction Type
·        749620.1 Is there a way to delete the data that exists in the FUN_INTERFACE_BATCHES tables?
·        749150.1 R12 AGIS: Reject Inbound: Error Message: Complete The Accounting Distribution For The Recipient.
·        747537.1 GLXIEENT Receiver Unable To Query Intercompany Transaction
·        743904.1 AGIS Unable To Create Outbound Transactions due to ''unknown runtime error occurred'' from Javascript
·        742701.1 AGIS Transaction Import fails with Invalid Balancing Segment Value