Customer Card - Statistics Fast Tab, how does Average Collection Period (Days) and Average Late Payments (Days) calculate.
Customer Card - Statistics Fast Tab, how does Average Collection Period (Days) and Average Late Payments (Days) calculate.
Hi,
As Mohana mentioned :-
For Average Collection Period (Days) - it is under codeunit 1302 "Customer Mgt."
For Average Late Payments (Days) - it is under codeunit 32 "Customer Card Calculations"
Regards,
Tanya Kharbanda
Don't forget to help the community by verifying the answer if your question has been answered. It will let others know that the topic has a verified answer.
do you have a simplified calculation or formula like:
Average Collection Period = (Accounts Receivable / Total Credit Sales) x Number of Days in the Period
Yup, the values calculated based on the above code. a bit hard to explain..
Hello guys,
I am referring to the below fields highlighted in Yellow on the Customer Card - Statistics Fast Tab.
It is in Codeunit 1302
procedure AvgDaysToPay(CustNo: Code[20]): Decimal
var
CustLedgEntry: Record "Cust. Ledger Entry";
CustLedgEntry2: Record "Cust. Ledger Entry";
AvgDaysToPay: Decimal;
TotalDaysToPay: Decimal;
TotalNoOfInv: Integer;
begin
with CustLedgEntry do begin
AvgDaysToPay := 0;
SetCurrentKey("Customer No.", "Posting Date");
SetFilterForPostedDocs(CustLedgEntry, CustNo, "Document Type"::Invoice);
SetRange(Open, false);
if FindSet() then
repeat
case true of
"Closed at Date" > "Posting Date":
UpdateDaysToPay("Closed at Date" - "Posting Date", TotalDaysToPay, TotalNoOfInv);
"Closed by Entry No." <> 0:
if CustLedgEntry2.Get("Closed by Entry No.") then
UpdateDaysToPay(CustLedgEntry2."Posting Date" - "Posting Date", TotalDaysToPay, TotalNoOfInv);
else begin
CustLedgEntry2.SetCurrentKey("Closed by Entry No.");
CustLedgEntry2.SetRange("Closed by Entry No.", "Entry No.");
if CustLedgEntry2.FindFirst() then
UpdateDaysToPay(CustLedgEntry2."Posting Date" - "Posting Date", TotalDaysToPay, TotalNoOfInv);
end;
end;
until Next() = 0;
end;
if TotalNoOfInv <> 0 then
AvgDaysToPay := TotalDaysToPay / TotalNoOfInv;
exit(AvgDaysToPay);
end;
procedure InvoicePaymentDaysAverage(CustomerNo: Code[20]): Decimal
begin
exit(Round(CalcInvPmtDaysAverage(CustomerNo), 1));
end;
local procedure CalcInvPmtDaysAverage(CustomerNo: Code[20]): Decimal
var
CustLedgEntry: Record "Cust. Ledger Entry";
DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry";
PaymentDays: Integer;
InvoiceCount: Integer;
begin
CustLedgEntry.SetCurrentKey("Document Type", "Customer No.", Open);
if CustomerNo <> '' then
CustLedgEntry.SetRange("Customer No.", CustomerNo);
CustLedgEntry.SetRange("Document Type", CustLedgEntry."Document Type"::Invoice);
CustLedgEntry.SetRange(Open, false);
CustLedgEntry.SetFilter("Due Date", '<>%1', 0D);
if not CustLedgEntry.FindSet() then
exit(0);
repeat
DetailedCustLedgEntry.SetCurrentKey("Cust. Ledger Entry No.");
DetailedCustLedgEntry.SetRange("Cust. Ledger Entry No.", CustLedgEntry."Entry No.");
DetailedCustLedgEntry.SetRange("Document Type", DetailedCustLedgEntry."Document Type"::Payment);
if DetailedCustLedgEntry.FindLast() then begin
PaymentDays += DetailedCustLedgEntry."Posting Date" - CustLedgEntry."Due Date";
InvoiceCount += 1;
end;
until CustLedgEntry.Next() = 0;
if InvoiceCount = 0 then
exit(0);
exit(PaymentDays / InvoiceCount);
end;
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156