microsoft / microsoft/BCApps

page 10007 "Customer Credit Information" - OnCalculateAgingForPeriodBeforeDueDateFiltering

Open Beginner friendly
#11,365 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

missing-info Team: Finance
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Why do you need this change?

Hi AL-Team,
can you please add an event to page "Customer Credit Information", as it is required to set custom filters for an array of "Cust. Ledger Entry" Records.

Describe the request

Old version:

procedure CalculateAgingForPeriod(PeriodBeginDate: Date; PeriodEndDate: Date; Index: Integer)
var
CustLedgerEntry2: Record "Cust. Ledger Entry";
NumDaysToBegin: Integer;
NumDaysToEnd: Integer;
begin
// Calculate the Aged Balance for a particular Date Range
if PeriodEndDate = 0D then
CustLedgerEntry[Index].SetFilter("Due Date", '%1..', PeriodBeginDate)
else
CustLedgerEntry[Index].SetRange("Due Date", PeriodBeginDate, PeriodEndDate);
CustLedgerEntry2.Copy(CustLedgerEntry[Index]);
CustLedgerEntry[Index]."Remaining Amt. (LCY)" := 0;
if CustLedgerEntry2.Find('-') then
repeat
CustLedgerEntry2.CalcFields("Remaining Amt. (LCY)");
CustLedgerEntry[Index]."Remaining Amt. (LCY)" :=
CustLedgerEntry[Index]."Remaining Amt. (LCY)" + CustLedgerEntry2."Remaining Amt. (LCY)";
until CustLedgerEntry2.Next() = 0;


New version:

procedure CalculateAgingForPeriod(PeriodBeginDate: Date; PeriodEndDate: Date; Index: Integer)
var
CustLedgerEntry2: Record "Cust. Ledger Entry";
NumDaysToBegin: Integer;
NumDaysToEnd: Integer;
IsHandled: Boolean;
begin
OnCalculateAgingForPeriodBeforeDueDateFiltering(CustLedgerEntry, PeriodBeginDate, PeriodEndDate, Index, IsHandled);
// Calculate the Aged Balance for a particular Date Range
if not IsHandled then
if PeriodEndDate = 0D then
CustLedgerEntry[Index].SetFilter("Due Date", '%1..', PeriodBeginDate)
else
CustLedgerEntry[Index].SetRange("Due Date", PeriodBeginDate, PeriodEndDate);
CustLedgerEntry2.Copy(CustLedgerEntry[Index]);
CustLedgerEntry[Index]."Remaining Amt. (LCY)" := 0;
if CustLedgerEntry2.Find('-') then
repeat
CustLedgerEntry2.CalcFields("Remaining Amt. (LCY)");
CustLedgerEntry[Index]."Remaining Amt. (LCY)" :=
CustLedgerEntry[Index]."Remaining Amt. (LCY)" + CustLedgerEntry2."Remaining Amt. (LCY)";
until CustLedgerEntry2.Next() = 0;
...

------------//New Event
[IntegrationEvent(false, false)]
local procedure OnCalculateAgingForPeriodBeforeDueDateFiltering(var CustLedgerEntry: array[4] of Record "Cust. Ledger Entry";PeriodBeginDate: Date; PeriodEndDate: Date; Index: Integer; var IsHandled: Boolean)
begin
end;
------------//New Event

Provide an implementation (optional)
  • I will provide the implementation for this extensibility request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at page 10007, Customer Credit Information, and locate CalculateAgingForPeriod and its Cust. Ledger Entry array. Add the requested integration event before due-date filtering, then verify that subscribers can apply custom filters to the records before the aging calculation continues.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.