Group sales lines in posted invoice messages
Outbound posted sales invoice and credit memo messages can use the same sales-line grouping settings as Document Reporting. This lets you send a compact electronic invoice that follows the combination codes or all-in pricing used for the customer's invoice presentation, instead of exporting every underlying FMS charge separately.
Grouping changes the outgoing message, not the posted sales lines or financial entries. It is separate from invoice grouping, which determines which charges are collected on the same invoice.
Supported messages
This functionality applies to FMS lines in the Send Posted Sales Invoice and Send Posted Credit Invoice processing functions.
The invoice flow is also referred to as SND-POSTED-SALES-INV. The standard initialized message type codes are SND-POSTSALESINVOICE and SND-POSTEDCREDITINV. Your company's message type codes can differ; check the processing function rather than relying only on the code.
Note
Use this functionality for documents containing FMS service lines. It is not a general grouping option for WMS, TMS, item or G/L account lines. Test invoices and credit memos separately, especially if your documents contain mixed line types.
Prerequisites
- Configure the outbound message type and the receiving integration. See Message Types.
- Make a Document Report available on the posted invoice or credit memo. Its Report Id must match the report selected for message grouping.
- Configure the report definition's SalesLine data item with the required grouping code and combination rules. See Document Report Data Grouping and Configuring Document Reports.
- For all-in pricing, configure the service and revenue lines before invoicing. See All-in pricing.
The message uses the selected report's sales-line buffer, including its grouping settings and table filters. Selecting a report does not automatically create combination rules or guarantee the same presentation as a different PDF report.
Set up message grouping
- Open Data Integration Message Type List and select the message type that uses Send Posted Sales Invoice.
- Open its parameters and set
GROUPLINEStoYES. - Set
GROUPREPORTIDto the numeric Report Id of the Document Report whose sales-line settings you want to use. - Check that this Document Report exists on the posted invoice and that its report definition has the intended SalesLine grouping.
- Generate a test message and compare its lines and totals with the posted invoice and the corresponding report.
- Repeat the setup and test for the message type that uses Send Posted Credit Invoice, using the report configured for posted credit memos.
Parameters
GROUPLINES: Enables grouped FMS line output. UseYESto enable it orNOto retain individual FMS line output.GROUPREPORTID: Selects the report whose sales-line settings are used when grouping is active. Enter the numeric Report Id, not a report definition code, layout name or grouping code.
Important
When grouped processing is used, a zero or missing GROUPREPORTID causes the error Report Id parameter is missing for grouped lines processing. A matching Document Report must also exist for the specific posted invoice or credit memo. Do not assume that setting a report number on the message type creates that report on existing documents.
Combination codes and all-in pricing
For combination-code grouping, define which lines belong together and how each output field is calculated. For example, sum amounts while keeping different VAT treatments or currencies separate. Configure descriptions, quantities and prices deliberately; enabling GROUPLINES alone does not define those rules.
For all-in pricing, the FMS sales-line builder uses the related all-in revenue line to present its quantity, price and amount. The outgoing presentation can therefore reflect an all-in charge instead of exposing its underlying components separately. Validate this with both an invoice and its credit memo before enabling the flow in production.
Example: combine two charges
Assume two eligible FMS lines have the same combination code and VAT treatment:
- Freight: quantity 1, amount USD 800.
- Fuel surcharge: quantity 1, amount USD 200.
Configure the report grouping to combine these lines, sum the amount, use quantity 1 and produce a suitable description and unit price. The intended grouped output is one line for USD 1,000. With GROUPLINES=NO, the FMS message contains the two individual lines instead.
This example describes the intended result of that grouping configuration, not a fixed rule applied to every message. Check the actual Quantity, UnitPrice, LineAmount, Amount and AmountIncludingVAT values in the generated XML.
Validate before sending
- Test a posted invoice with several lines that should combine and another line that must remain separate.
- Compare message amounts, discounts and VAT with the posted document. Check that report filters have not excluded required lines.
- Check descriptions, service mappings, units of measure and references expected by the receiver. Grouped lines do not necessarily have a one-to-one relationship with posted line numbers.
- Test an all-in invoice and a corresponding posted credit memo if these are used in your workflow.
- Have the receiving system validate the changed line structure before activating the setup for live messages.
If grouping is not applied, check GROUPLINES, the document's line types, the matching Document Report and its SalesLine grouping settings. If a report cannot be found, check GROUPREPORTID and the reports available on that specific posted document.