Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions business-central/SRB/billing-automation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: Billing automation
description: Automate recurring billing up to a configured degree.
author: TobiSIT
ms.author: bholtorf
ms.reviewer: bholtorf
ms.topic: concept-article
ms.search.keywords:
ms.search.form: 8067_Primary,
ms.date: 12/04/2025
ms.service: dynamics-365-business-central
ms.custom: bap-template
---

# Billing Automation Overview

Automated invoicing streamlines the billing process by enabling the automatic creation, posting, and management of invoices and credit memos for customer contracts. The degree of automation is configurable, allowing organizations to tailor the process to their operational needs and compliance requirements.

## Overview

Automated invoicing helps internal sales management and finance teams increase efficiency by reducing manual effort in contract billing. Depending on contract complexity, the process can be fully automated, partially automated, or manual, with clear controls and error handling to ensure accuracy and compliance.

## Prerequisites

- Access to the Subscription Billing module.
- Appropriate user permissions for automated contract invoicing (see User Setup).
- Configured billing templates for relevant contract types.

## Automation Scenarios

Contracts can be categorized as follows:

- **Fully Automated:** The same invoice is posted every month; the process can be entirely automated.
- **Partially Automated:** Invoices may change; automation is used to create invoices, but manual review is required before posting.
- **Manual:** Contracts require adjustments each period; automation is limited to creating billing proposals.

> **Note:** Vendor contract invoicing is not automated.

## How Automated Invoicing Works

### 1. Billing Templates

Billing templates define how and when invoices are generated. Key fields include:

- **Posting Date Formula:** Determines the posting date for invoices (e.g., first of next month).
- **Document Date Formula:** Sets the document date for invoices and credit memos.
- **Document per:** Specifies how billing lines are grouped (by contract, contract partner, or invoice recipient).
- **Automation:** Controls the automation level (e.g., create proposal and documents, post documents).

> **Note:** Automation for posting documents can be set up entirely in the job queue.

Templates can filter contracts by contract type and can be scheduled for automation via job queue entries.

### 2. Job Queue Automation

- Automated templates are processed by a dedicated job queue entry (Codeunit 8014, "Auto Contract Billing").
- The job queue creates billing proposals and documents based on template settings.
- Invoices can be posted separately with a second job queue entry (Report 297, "Batch Post Sales Invoices").

### 3. User Permissions

To set up billing automation, first make sure users can edit billing templates and then additionally activate the "Auto Contract Billing" option in User Setup.

### 4. Error Logging and Handling

- All errors during automation are logged for user review.
- If a document line causes an error, the entire document is discarded to prevent incorrect postings.
- The process is designed to continue running efficiently, skipping only problematic lines or documents.

#### Error Log Fields

- **Billing Template:** Template code processed.
- **Error Text:** Detailed error message.
- **Subscription/Line, Contract No./Line, Contract Type, Assigned User, Salesperson, Timestamp:** Contextual details for troubleshooting.

A dedicated error log page ("Contract Billing Error Log") is available via the “Tell Me” search (Alt+Q).

### 5. Technical Details

#### Relevant Fields

- **Billing Templates:** Posting Date Formula, Document Date Formula, Customer Document per, Automation.
- **User Setup:** Auto Contract Billing (Boolean).
- **Sales Header (Invoices/Credit Memos):** Auto Contract Billing (Boolean, system-controlled).

#### Date Formula Logic

- If date fields are empty, “today” (work date) is used by default.
- Date formulas like “+0D” can be used for dynamic scheduling.

#### Job Queue Setup, part 1: Create Documents

- A job queue entry is created for automated contract invoicing, with retry and delay settings for reliability (Codeunit 8014, "Auto Contract Billing"). The billing template's description is taken over for the job queue entry.
- The automation object processes the corresponding billing template (determined by job id).

#### Job Queue Setup, part 2: Batch Posting

- Create a separate job queue entry for posting sales invoices using Report 297 ("Batch Post Sales Invoices").
- To avoid posting all invoices, apply filters on the report request page before running the batch.
- Use the "Recurring Billing" and "Auto Contract Billing" fields as filters when performing batch posting.

### 6. Error Handling in Automation Steps

- If a billing line cannot be created, the related document is not generated, and all affected lines are logged.
- If a document cannot be created, it is skipped, and the error is logged.
- The automation excludes any subscriptions or documents with errors from further processing.

> **Note:** The order of processing is determined by the job queue entry, ensuring consistent results even with overlapping templates.

## Best Practices

- Use automation for contracts with predictable, recurring billing.
- Regularly review error logs to address setup or data issues.
- Limit permissions for automated template management to prevent accidental changes.
- Test automation with a subset of contracts before full deployment.

## Related Topics

- [Recurring Billing](#)
- [Job Queue Management](#)
- [Error Log Review](#)
- [User Permissions and Security](#)
44 changes: 22 additions & 22 deletions business-central/SRB/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ The most important terms can be looked up in this glossary.

## A

* **Additional Service Commitments** <br/> Service commitments that can be selected in addition to the standard service commitments.
* **Additional Subscription Packages** <br/> Subscription packages that can be selected in addition to the standard Subscription packages.
* **Amount** <br/> Indicates the amount of a subscription line minus the discount granted.

## B

* **Billing Base Period** <br/> The period of time to which the Service Amount applies. For example, enter 1M here if the amount refers to one month or 12M if the amount refers to one year.
* **Billing Date** <br/> The cut-off date by which service commitments to be billed are considered.
* **Billing Date** <br/> The cut-off date by which subscription lines to be billed are considered.
* **Billing line** <br/> Shows the history of billing contract lines. When you post recurring bills, they're created from the billing proposal lines.
* **Billing Proposal** <br/> The billing lines created using one or more billing templates become a billing proposal. The proposal is the basis for creating the contract invoices.
* **Billing Proposal Lines** <br/> Proposal lines are a preview of the billing lines. Lines for the same contract line and different billing periods are combined in the invoice.
* **Billing Rhythm** <br/> Specifies the rhythm at which the service commitments are billed. A Dateformula can be used to set the rhythm to, for example, monthly, quarterly or annual calculation.
* **Billing Template** <br/> The Default name used to determine the service commitments to be billed.
* **Billing Rhythm** <br/> Specifies the rhythm at which a subscription line is billed. A Dateformula can be used to set the rhythm to, for example, monthly, quarterly or annual calculation.
* **Billing Template** <br/> The default used to determine the subscription lines to be billed.

## C

Expand All @@ -41,32 +42,32 @@ The most important terms can be looked up in this glossary.
* **Contract Type** <br/> Indicates the classification of the contract.
* **Contractor** <br/> Customer or supplier for whom the contract is created.
* **Credit Memo Preview** <br/> Function for creating a print preview for an unposted credit memo.
* **Customer Subscription Contract** <br/> Customer subscription contracts can be used to retrieve and process customer-side service commitments before you bill customers.
* **Customer Subscription Contract** <br/> Customer subscription contracts can be used to retrieve and process customer-side subscription lines before before creating customer posting documents.

## D

* **Detail Overview** <br/> Specifies whether the billing details for the contract are automatically output with invoices and credit memos.

## E

* **End User** <br/> The end user is the customer to whom the service commitments were sold. You specify end users for subscriptions.
* **End User** <br/> The end user is the customer to whom a subscription was sold. You specify end users for subscriptions.

## I

* **Initial Term** <br/> The Dateformula used to calculate the minimum term of subscription line. If the **Initial Term** is specified but you don't enter a **Subsequent Term**, the **Service End Date** is set to the end of the **Initial Term**.
* **Invoice Preview** <br/> Action to create a print preview for an unposted invoice.
* **Invoicing Item** <br/> An item so identified is used to bill extra service commitments sold for another item.
* **Invoicing Item** <br/> An item so identified is used to bill extra subscription lines sold for another item.
* **Invoicing Item No.** <br/> Indicates which item in the contract invoice is used to bill for the periodic service in a subscription package line.
* **Invoicing via** <br/> Indicates whether the service is billed via a contract or sales document in a subscription package line.

## N

* **Next Billing Date** <br/> Indicates the date of the next possible billing in service commitments and contract lines.
* **Next Billing Date** <br/> Indicates the date of the next possible billing in subscription lines and contract lines.

## P

* **Posting document** <br/> These documents are invoices or credit notes that aren't posted.
* **Price Group** <br/> Specifies the customer price group (for example, in the subscription package) that is considered in pricing the service commitments.
* **Price Group** <br/> Specifies the customer price group (for example, in the subscription package) that is considered in pricing the subscription lines.

## R

Expand All @@ -75,27 +76,26 @@ The most important terms can be looked up in this glossary.

## S

* **Sales subscription lines** <br/> Services that are part of a line in the quote or order.
* **Service Amount** <br/> Indicates the amount of a subscription line minus the discount granted.
* **Service Commitment** <br/> Service commitments represent obligations to customers and vendors.
* **Service Commitment Item** <br/> Can be used in sales documents, but are charged exclusively through contracts.
* **Service Commitment Option** <br/> Indicates whether a service commitment can be deposited for an item or whether it's an item for billing services.
* **Sales Subscription Lines** <br/> Services that are part of a line in the quote or order.
* **Subscription Item** <br/> Can be used in sales documents, but are charged exclusively through contracts.
* **Subscription Line End Date** <br/> Indicates the date until which the subscription line is valid.
* **Subscription Line Start Date** <br/> The date from which the subscription lines are valid and charged.
* **Subscription Line Start Formula** <br/> Specifies the date from which a subscription line is valid using a formula. By using this Dateformula, the validity can be automatically set to, for example, the first of the following month. If the field remains empty, the subscription line is valid from delivery.
* **Subscription Lines** <br/> Subscription lines represent obligations to customers and vendors.
* **Subscription Option** <br/> Indicates whether a subscription package can be deposited for an item or whether it's an item for billing services.
* **Subscription Package** <br/> Use to bundle subscription package lines and manage price groups. Assign subscription packages to items.
* **Subscription Package Line** <br/> Specifications for service commitments are defined using the subscription package line. When the item is entered in a quote or order, the specifications from the subscription package line are applied to the service.
* **Service Commitment Start Formula** <br/> Specifies the date from which a service commitment is valid using a formula. By using this Dateformula, the validity can be automatically set to, for example, the first of the following month. If the field remains empty, the service commitment is valid from delivery.
* **Subscription package line template** <br/> Serves as the default for a service commitment and can be selected in the subscription package line.
* **Service End Date** <br/> Indicates the date until which the service commitment is valid.
* **Subscription** <br/> Subscriptions represent a history of products sold to a customer. Service commitments are created in subscriptions.
* **Service Start Date** <br/> The date from which the service commitments are valid and charged.
* **Subscription Package Line** <br/> Specifications for subscription packages are defined using the subscription package line. When the item is entered in a quote or order, the specifications from the subscription package line are applied.
* **Subscription Package Line Template** <br/> Serves as the default for a subscription line and can be selected in the subscription package line.
* **Subscription** <br/> Subscriptions represent a history of products sold to a customer. Subscription lines are created in subscriptions.
* **Subsequent Term** <br/> Specifies a Dateformula for automatic renewal after the Initial Term and the rate at which "Cancellation Possible Until" and "Term Until" are updated. If the field is blank and either the Initial Term or the Notice Period is set at the same time, the Service End Date is automatically set to the expiration date of the Initial Term or the Notice Period.

## U

* **Update Service Dates** <br/> This action updates the cancellation dates.
* **Update Subscription Line Dates** <br/> This action updates the cancellation dates.

## V

* **Vendor Subscription Contract** <br/> Vendor subscription contracts can be used to retrieve and process vendor-side service commitments before creating vendor posting documents.
* **Vendor Subscription Contract** <br/> Vendor subscription contracts can be used to retrieve and process vendor-side subscription lines before creating vendor posting documents.

## Related information

Expand Down
4 changes: 2 additions & 2 deletions business-central/SRB/posting-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ ms.custom: bap-template

Posting documents are invoices and credit memos because these documents can be posted. When creating these documents using the [Recurring billing](recurring-billing.md) page, [!INCLUDE [prod_short](../includes/prod_short.md)] recognizes whether to create an invoice or a credit memo based on the amounts to settle. If the total amount over all lines to be billed is positive, an invoice is created, otherwise a credit memo is created. This applies to both customer subscription contracts and vendor subscription contracts.

The posting documents are available on the respective contract under **Related**. There are different ways to open documents that are or aren't posted. Sales documents are created from customer subscription contracts and purchasing documents from vendor subscription contracts. The documents can also be opened using the following methods:
The posting documents are available on the respective contract under **Navigate**. There are different ways to open documents that are or aren't posted. Sales documents are created from customer subscription contracts and purchasing documents from vendor subscription contracts. The documents can also be opened using the following methods:

* **Sales Invoices**

A **Recurring Billing** filter is available in the page, which displays only the documents that belong to a contract.
* **Sales Credit Memos**

A **Recurring Billing** is available in the page, which displays only the documents that belong to a contract.
A **Recurring Billing** filter is available in the page, which displays only the documents that belong to a contract.
* **Posted Sales Invoices**

A **Recurring Billing** filter is available in the page, which displays only the documents that belong to a contract.
Expand Down
Loading