Customer Entry Statistics

TomasTomas Member Posts: 420
Avg. Collection Period is calculated incorrectly on this scenario:
When we post credit memo and apply it to invoice, Avg. Collection Period is recalculated. Which means, that if we apply credit memo to invoice on the same day, AvgDaysToPay will be increased by zero, but invoice numbers will be increased by 1 and while calculating Avg. Collection Period we will get distorted numbers (smaller than we would get by calculating only times between payment application to invoice).

I would expect, navision not to include invoices (for which credit memos were raised) in Avg. Collection Period calculation, as client will not be paying for these invoices.

Any ideas? :bug: ?

Tested on NAV4.3 GB, NAV 4.3 W1 versions.

Comments

  • SavatageSavatage Member Posts: 7,142
    here's a post & report - you can try to see if it calcs the same way.

    If not this report can be very useful to you.
    http://www.mibuso.com/forum/viewtopic.php?t=24351
  • TomasTomas Member Posts: 420
    Yes, report is calculating the same way. This part of code is incorrect:
    // Optimized Approximation 
              IF (CustLedgEntry2."Document Type" = CustLedgEntry2."Document Type"::Invoice) AND 
                 NOT CustLedgEntry2.Open 
              THEN 
                IF CustLedgEntry2."Closed at Date" > CustLedgEntry2."Posting Date" THEN 
                  UpdateDaysToPay(CustLedgEntry2."Closed at Date" - CustLedgEntry2."Posting Date",DaysToPay,NoOfInv) 
                ELSE 
                  IF CustLedgEntry2."Closed by Entry No." <> 0 THEN BEGIN 
                    IF CustLedgEntry3.GET(CustLedgEntry2."Closed by Entry No.") THEN 
                      UpdateDaysToPay(CustLedgEntry3."Posting Date" - CustLedgEntry2."Posting Date",DaysToPay,NoOfInv); 
                  END ELSE BEGIN 
                    CustLedgEntry3.SETCURRENTKEY("Closed by Entry No."); 
                    CustLedgEntry3.SETRANGE("Closed by Entry No.",CustLedgEntry2."Entry No."); 
                    IF CustLedgEntry3.FIND('+') THEN 
                      UpdateDaysToPay(CustLedgEntry3."Posting Date" - CustLedgEntry2."Posting Date",DaysToPay,NoOfInv); 
                 END; 
            UNTIL CustLedgEntry2.NEXT(-1) = 0;
    

    As for Avg. Collection days we need to look ONLY at Invoices and Payments applied to invoices (all other entries, like credit memos should not be even looked at), the fix probably would be instead of the code above use this one:

    IF (CustLedgEntry2."Document Type" = CustLedgEntry2."Document Type"::Invoice) AND
             NOT CustLedgEntry2.Open
          THEN BEGIN
            CustLedgEntry3.SETCURRENTKEY("Entry No.");
            IF CustLedgEntry3.GET(CustLedgEntry2."Closed by Entry No.") THEN
               IF CustLedgEntry3."Document Type" = CustLedgEntry3."Document Type"::Payment THEN
                  UpdateDaysToPay(CustLedgEntry3."Posting Date" - CustLedgEntry2."Posting Date");
          END;
    
Sign In or Register to comment.