Generate Invoices
Learning Objectives
After completing this unit, you’ll be able to:
- Describe how to bill customers.
- Explain Invoice Management set up.
The Billing Workflow
The customer billing journey starts with the activation of their order. Order activation initiates the creation of billing schedule groups and billing schedules, which are key to managing invoicing.
Providing the following critical details, billing schedules form the foundation of the workflow by defining when and how to invoice a product:
- The total amount, start and end dates for each product
- For subscription products, the start and end dates and the next billing date
- The billing treatment, billing term unit, bill day of the month, and other relevant information
These details are grouped into Billing Schedule Groups, which consolidate one or more billing schedules. Together, they serve as the basis for generating invoices.
Invoices are created automatically using billing schedules marked as ‘ready for invoicing.’ This process is driven by Invoice Schedulers, which you configure with key parameters like start and end dates, frequency, and whether invoices should be directly posted to customers.
Taxes also play a crucial role in invoices. Tax calculations rely on an external tax engine, which applies tax policies and treatments associated with each billing schedule. Once the invoice is approved and posted, the appropriate tax treatment ensures accurate tax calculations.
So, how do all these components come together? In this unit, you explore each step of the invoice-generation process to discover how the various pieces fit into the bigger picture.
Billing Settings
For invoice generation to work correctly, you must select the appropriate billing treatment and tax treatment, and optionally, the legal entity and the Data Processing Engine in the org-wide Billing Settings in Setup.
Let’s explore each setting that impacts invoice generation.
Billing Default Setting |
Description |
---|---|
Legal Entity |
A legal entity defines how your organization is structured. You create multiple legal entities for customers in different locations to handle the differences in tax treatments and finance periods. Legal entities billing and tax information for products. |
Billing Treatment |
Billing treatments are a set of rules that determine how an order item is billed. These billing treatments, in turn, are used to create billing policies for each product. In this setting, you select the default billing treatment that is used to determine how products are billed when there’s no billing treatment for a product. |
Tax Treatment |
Taxes for orders are calculated using an external tax engine based on the tax policy and tax treatment defined. Tax treatment definition includes the information about the tax engine and the related tax policy. Set a default tax treatment when there’s no tax policy on the product. |
DPE Definition to Close Legal Entity Accounting Period |
A data processing engine (DPE) definition processes and closes the legal entity accounting period when you initiate its closure. |
In Billing Settings, you can also enable settings related to credits and corporate currency.
This table explains the importance of each setting.
Setting |
Description |
---|---|
Convert Negative Invoice Lines to Credit Memo Lines |
Enable this setting if you want negative invoice values to be converted into credit memos. Negative invoice values arise mostly from order cancellations or amendments. |
Credit Application Level |
Select how to apply the credits memo—whether to each invoice line in the invoice separately or to the entire invoice. If applied to each invoice line, the credit memo amount is distributed to each line item in the invoice. |
Apply Credits to Posted Invoices |
Enable this setting, if you want to automatically apply credit memos to invoices that are posted. |
Store Transaction Amount in Corporate Currency |
Convert the amounts of the Invoice, Invoice Line, Credit Memo, and Credit Memo Line records to your corporate currency. Store the converted amounts in corporate currency-specific amount fields. |
You already learned that the process of generating invoices starts when the order is activated. At this point, an invocable action is triggered that creates billing schedules for all the order items by calling the appropriate APIs. The Invoice Management component accesses the order data through the BillingContext context definition to create billing schedules.
Context Definition
The image shows the BillingContext context definition structure.
The BillingContext context definition has two nodes—one mapped to the Billing Transaction details and another mapped to the Billing Schedule details. The definition enables the creation of Billing Schedules and Billing Schedule Groups using the information from the Billing Transaction or the Orders as input. This input includes information about the products ordered and can be used to generate invoices.
Further, you can see that there are two context mappings defined within this context definition—the OrderEntitiesMapping context mapping that maps the billing transaction nodes with order entities and the BSGEntitiesMapping context mapping that maps the billing schedule nodes with billing schedule entities.
These are the default context definition and mapping.
To use a different context definition and context mapping, select them here.
Invoice Schedulers
You know that Invoice Schedulers automatically generate invoices when the status of billing schedules is set to ‘ready for invoicing’.
Here’s how to define an invoice scheduler.
When you define an invoice scheduler, you select the frequency for the invoice run, specify whether or not to post the invoices, and select the billing batch that the Invoice Scheduler should pick up. A billing batch is a group of invoices processed together. Invoice run uses the Data Processing Engine to handle large volumes of invoices.
Billing Schedule
You’ve already learned that activating an order creates the billing schedule groups and the billing schedules for the products in the order. This is triggered by a flow that is cloned from the out-of-the-box Salesforce Flow Order to Billing Schedule.
This flow takes the list of ordered items as input and creates a billing schedule for each order item, whether it’s a new sale or an amendment, cancellation, or renewal.
Wrap Up
Throughout this module, you examined the workings of the various components of Revenue Cloud. The components use context definitions to retrieve data from Salesforce objects and provide it to qualification procedures, pricing procedures, order processing, and billing schedules. Business rule outcomes, such as discount calculations and the decomposition of commercial products into technical products for order fulfillment use decision tables. Process automations in Revenue Cloud, for example, initiating order fulfillment, use Salesforce flows.
Great job! Equipped with all this newfound know-how, you're ready to start building the product catalog and browsing experience for your unique business and customers. They’ll love the super smooth cash-to-product journey.