In this article (8 sections)
The context
Step: the due date on the invoice, in Revenue Cloud Billing. The customers on this project don’t pay “net 30”. They pay on the next 1st, 11th or 21st after the invoice date, and that date has to be right on the invoice and in the books.
The problem
A standard payment term is a duration: a number of days added to the invoice date. This rule is a calendar: the number of days depends on the day the invoice goes out. An invoice dated the 2nd is due on the 11th, nine days later; one dated the 10th is due the next day. No single number of days gives both.
So any approximation is off by up to ten days on some invoices. The invoice itself still looks fine. The error shows up later, because aging reports and dunning both read the due date.
The solution
The payment term stays the carrier of the rule. The date itself is computed at invoice time, through a billing extension point, and written to the due date.
Flow
Every box on the top row is a prerequisite that produces no error when it is missing: the schedules simply never appear. The order line is the other silent failure: it needs period boundary and billing frequency fields that are not surfaced as required, so a data import passes cleanly and nothing ever bills.
- Prerequisites — Billing context (extended + activated), Billing settings (context mapping), Billing defaults (entity, treatments)
- Source — OrderItem (with period fields)
- Engine — ScheduleGroup (BSGEntitiesMapping), BillingSchedule (never created by hand)
- Output — Invoice (draft, then posted), InvoiceLine (TaxCode stays empty), Ledger rule (insert-only criteria)
How to set it up
The three fixed days are stored as data, not as code branches, so finance can change them without a deployment. The logic starts from the invoice date, finds the next fixed day and writes it to the due date.
Alternatives
Computing the date at invoice time gets every invoice right and leaves finance in charge of the fixed days. Two simpler options were ruled out. A fixed number of days is off by up to ten days per invoice. Fixing dates by hand works with a small customer base, not with many invoices.
In practice
- Store the fixed days as data, so finance can change them without a deployment.
- Set the payment term on the order, not on the billing profile.
- Before go-live, check the due date on a real invoice for each of the three fixed days.
- Do not approximate with a number of days: aging and dunning both read that date.