Billing Builder
The Billing Builder component is designed to consolidate multiple Billing Items against an account into a single Billing to aid in invoicing that account for multiple placements or jobs. This component can be placed in the following locations:
- Any SObject Lightning Record page
- Lightning Home Page
- Custom Lightning App Page
Builder component
The Billing Builder allows the selection of Billing Items related to a specific Account, which is chosen through a lookup in the top right of the component.
If the Billing Builder is placed on the Account record page, it will automatically display Billing Items related to that Account, and the lookup will not be present.
Once an Account has been selected, any Billing Item which has been flagged as being ready, via their Available in Consolidation Component (seven20__Available_in_Consolidation_Component__c) field being set to True, will be displayed in the table. The table displays the following details about the Billing Items:
| Column Name | Field API Name | Description |
|---|---|---|
| Description | seven20__Description__c | The external description for the Billing Item, e.g. the invoice line description |
| Amount | seven20__Amount__c | The amount of the Billing Item, e.g. the line item amount on an invoice |
| Date | seven20__Date__c | The date of the Billing Item, e.g. the line item date on an invoice |
| Address | N/A | The seven20__Title__c field on the relevant address (see address validation for more information). Only visible when address validation is active |
| Related Records | N/A | Displays links to records related to this Billing Item, these links can also have popovers assigned to them, see below |
Billing creation screens
Clicking the Create Billing button on the top right of the component will open up a modal which allows the selection of Billing Items related to the Account. After selecting some Billing Items and clicking Next, the user will be taken to a screen where they can amend the details of the items and set some key details about the Billing itself.
In all screens, the fields shown for the Billing Items match those shown on the main component, except address wont be shown when on the final screen.
The fields displayed here are fully customisable, being controlled via field sets on the Billing object and a Seven20 Configuration setting record with the developer name Billing_Creation_Fieldset. Several fields will have special behaviour, having their default values set based on the context of the Billing Items or Account, these are as follows:
- seven20__Payment_Terms__c - will be populated based on the Account.seven20__Payment_Terms__c field
- seven20__Invoice_Date__c - If there is only one billing item, its date will be used. If there are multiple billing items and all have the same date, that date will be used. Otherwise, this field will not be populated
- seven20__Address__c - will be taken from the validated address, see address validation
Any field in the Billing field set a user doesn't have permissions for will be skipped. This also applies for the defaulting of values.
When the user presses Save, a new Billing record is created, related to the Account. Any selected Billing Items will have their Billing (seven20__Billing__c) field updated with the new Billing record, and will no longer be selectable in the Billing Builder.
Address validation
The Billing Builder has several design time attributes for controlling the address validation behaviour of the component. When the Validate selected line address matches? attribute is set to True, the address validation functionality is enabled, requiring all Billing Items to have the same address. The Address column is only displayed in the table when validation is enabled.
Billing Items themselves do not have a related address, instead it is expected that the address would be validated based on a record which the Billing Item looks up to, e.g. the Placement's address. We provide a design time attribute called Address relationship path for validation, which is an automatically generated picklist based on the lookups found on the Billing Item.
There is also the option to ignore blank addresses for the purpose of validation, by toggling the Treat blank addresses as equal for validation? design time attribute to True. When true, any blank address will be considered to be the same as any other selected address.
Related record cell
The links to the related records are controlled based on the user's access to the lookup fields on the Billing Item, any custom lookup (i.e. ends with __c) that the user has permissions to view will be displayed.
Popovers can be configured for each individual record link through the use of the record type customisation metadata, by utilising the customisation name Billing Consolidation Popover.