Table of Contents

Automatic Billing / Invoice Rules

The date on which a forwarding charge can be invoiced may depend on operational progress. For example, a customer agreement may require a particular milestone to be reached before billing. Maintaining these dates manually on every charge makes it difficult to apply the same agreement consistently.

Invoice rules connect operational event and milestone dates with the billing dates on cost and revenue lines. Instead of assigning dates manually on each line, derive the Posting Date and Earliest Invoice Date from an event or milestone, with an optional date formula. The rules determine the dates used by the invoicing process; they do not replace that process.

For example, a rule can base the Earliest Invoice Date on the actual date of a configured milestone. Rules can target a service or service group and can be restricted by business unit, customer country, area, validity dates and document-header filters.

Configuration hints

  1. Open Invoice Rules List (Fms) and choose whether the rule applies to costs, revenues or both.
  2. Set the service scope and any filters needed to distinguish the rule from other rules.
  3. Select the event/milestone source and date type for the Posting Date and Earliest Invoice Date. Add date formulas and the required time where needed.
  4. Add Apply Invoice Rules (Fms) to the relevant cost/revenue-line status workflow.
Note

Applying a rule sets billing dates; it does not by itself create or post an invoice. Keep invoice creation in your configured invoicing process.

Create or cancel invoicing entries through a status function

An invoicing entry connects a revenue line to central invoicing. It is a preparation stage, not a posted customer invoice. Use the revenue-line status workflow to create the entry when a charge becomes ready for invoicing, or cancel its pending entry when the charge needs to be withdrawn.

On the status template for the FMS cost/revenue-line table, add Post central invoice entries from 3PL FMS Status Func. Finance (function 9). Configure ACTION for the intended transition:

  • 0 = Create posts an invoicing entry for the line. Central invoicing must be enabled and the line must pass its invoicing checks. A newly submitted line with a blank invoice status becomes Pending.
  • 1 = Cancel cancels the line's pending invoicing entry, if one exists. It does not reverse a posted financial invoice; use the credit-invoicing process for an already posted charge.

For example, configure the transition to your Invoice Ready status to create the entry, and the transition used to withdraw a charge to cancel it. The status code and transitions are part of your setup, not fixed names required by the function.

Test both transitions and inspect the invoicing entry and revenue line before enabling unattended processing. Invoice creation and financial posting remain separate steps; see Invoicing.

Automatically change revenue lines to Invoice Ready

The job queue function CHANGESTATUSREVLINE in 3PL FMS Job Queue Functions prepares revenue lines and changes them to the configured status. This can connect operational milestones to the status function above: the job updates the billing dates, moves eligible lines to Invoice Ready, and the status workflow creates their invoicing entries.

Configure a recurring job with this function and a limited selection first. It selects revenue lines with a service number and a blank invoice status. For each selected document, it updates the posting date and applicable currency exchange rate, applies invoice rules and checks eligibility before attempting the status change.

Selection and billing parameters

  • TABLEFILTER restricts the revenue lines to process. Use it to limit the document types, current line statuses or other criteria.
  • HDR STATUS FILTER restricts the source document's header status.
  • POSTINGDATEFILTER limits selection to posting dates on or after the date calculated relative to today. It is a selection filter, not the formula that sets a new posting date.
  • DATE selects the posting-date source: 0 = Departure (ETD) or 1 = Arrival (ETA). DATEFORMULA optionally adjusts that date. Invoice rules are applied afterwards and can determine the resulting billing dates.
  • NEWSTATUS is the revenue-line status to request, for example your configured Invoice Ready status. Without a value, this function does not request a status change.
  • CHECKPOSTINGGROUPS, default True, requires the general business/product and VAT business/product posting groups before changing status.
  • CHECKCUSTOMERBU enables the additional customer business-unit relation check.

The Earliest Invoice Date must be filled and its date must be today or earlier. This job checks the date part, not the time of day. Where currency conversion is needed, the currency factor date must match the posting date. Lines that fail these eligibility checks do not advance to the requested status.

Processing and monitoring parameters

  • TASK CODE groups worker tasks and processing progress; its default is CHANGESTATUSREVLINE.
  • PARALLEL TASKS limits simultaneous workers; default 8.
  • YIELD AFTER limits the monitor's processing duration; default 120s. MONITOR INTERVAL controls how often workers are checked; default 5s.
  • DAILYDOCPROCLIMIT limits completed processing runs per document, task code and day; default 1. Set a positive limit appropriate to the schedule.
  • GETLATESTPROGRESS resumes selection from the saved document progress when nonblank.

Review the shipment's Document Processing records and the job queue results, as well as the resulting revenue-line status and invoicing entry. Test a due line, a future-dated line and a line missing posting groups. A completed worker does not mean every line was eligible or that a customer invoice was posted.

Note

SETSTATUSCOSTREVLINE is a separate, simpler job queue function. Its parameters are NEWSTATUS, TABLEFILTER, LINETYPE (1 = Cost, 2 = Revenue, 3 = RevenueAll-in; blank = no type restriction) and INCL. CURRENT STATUS. It requests status changes directly; it does not perform the date preparation and eligibility checks described for CHANGESTATUSREVLINE.

See also