Aging As Of Any Date
The Aged Accounts Receivable report has an innocent-looking option nobody thinks about until the auditors ask for it: "aged as of December 31". Printing today's open amounts is easy — reconstructing what was open ten months ago means unwinding every payment application posted since. An invoice that is fully closed today may have been wide open at the as-of date, and an invoice sitting in the ledger today may not have existed yet. That reconstruction is this task.
Requirements
The starter contains three tables — keep their fields and keys exactly as shipped; the grading tests seed the first two and read the third back:
"Aging Ledger Entry" — one row per posted sales invoice:
"Entry No."—Integer, the primary key"Customer No."—Code[20]"Posting Date"—Date, when the invoice was posted"Due Date"—Date"Original Amount"—Decimal, the amount the invoice was posted with"Remaining Amount"—Decimal, what is still open today, after every application ever postedOpen—Boolean, whether the invoice is still open today
"Aging Application" — one row per posted application of a payment to an invoice:
"Entry No."—Integer, the primary key"Invoice Entry No."—Integer, the"Entry No."of the applied invoice"Amount Applied"—Decimal"Application Date"—Date, when the application was posted
"Aging Bucket" — the result, primary key ("Customer No.", "Bucket No."):
"Customer No."—Code[20]"Bucket No."—Integer,0to4Amount—Decimal
Create a codeunit named "Retro Aging" with one public procedure:
procedure ComputeAging(var AgingLedgerEntry: Record "Aging Ledger Entry"; var AgingApplication: Record "Aging Application"; AsOfDate: Date; var AgingBucket: Record "Aging Bucket")Solve it with Pro
You’re reading the opening of the statement. Pro unlocks the whole problem:
- The full statement
- Starter code in the browser editor
- 11 grading tests, run on Business Central 28.5
- 3 hints
- The reference solution
Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.
Already on Pro? Sign in