A/R Days Past Due column RPT 121 Customer Balance to Date

emulsified
emulsified Member Posts: 139
Hello everyone.

I am trying to add a "Days Past Due" column to REPORT 121 Customer Balance to Date for each each document displayed.

In other words I would like a column that shows the # of days past due for any given lines in this document. If a customer has an invoice that is 37 days past due I want it to show 37 in the "Days Past Due" column.

:-k I'm not sure what type of calculation I need and where to put it and also what fields to use to get what I need.

Any help is greatly appreciated.
Half-empy or half-full how do you view your database?

Thanks.

Comments

  • Savatage
    Savatage Member Posts: 7,142
    Create A Variable "DaysPastDue" Type Integer
    OnAfterGetRecord
    DaysPastDue := WORKDATE - Tabelyourusing."Due Date";

    Add textvox to report - pur DaysPastDue as sourceexp.

    I don't have a report 121 so I don't know what table it uses - I assume custlegder entries.
  • emulsified
    emulsified Member Posts: 139
    :D Worked perfectly. This report MODIFIED is much more useful.

    Added the following code to OnAfterGetRecord in DataItem "Cust. Ledger Entry" after creating the appropriate text boxes in the sections I needed and the Global Variables for DueDate and DaysPastDue.
    // 2007-11-02 added by TPL, displays Days Past Due and Due Date
    // If no days past due then show zero
    // If document type is a credit memo then show zero
    
    // Get the Due Date
         DueDate := "Due Date";
    
    // Find elapsed days since Due Date
         DaysPastDue := WORKDATE - "Due Date";
    
    // Don't display negative values
         IF DaysPastDue < 1 THEN DaysPastDue := 0;
    
    // Always display a ZERO value for Credit Memos
         IF "Document Type" = 3 THEN DaysPastDue := 0;
    
    

    :D Thanks for your help.
    Half-empy or half-full how do you view your database?

    Thanks.