How to invoice subscriptions periodically, instead of sending invoices to customers when subscriptions are ordered.
Overview
Number of invoicing periods in a month can be defined, as well as date for next invoice. At the set invoicing date all subscriptions from the previous period are invoiced on one invoice.
Before you start
Create overrides in the following locations.
- AdminPanel
- Atomia.Web.Plugin.BillingAdminPanel.General.dll.config as <pluginSetting>.
- Billing API
- Web.config as an attributes in <atomiaBilling>.
However, we do not recommend overriding of custom attributes, unless it is absolutely necessary. See list of custom attributes below.
- PeriodicInvoicingAttributeName, default name: PeriodicInvoicing
- PeriodicInvoicingPeriodInMonthsAttributeName, default name: PeriodicInvoicingPeriodInMonths
- NextPeriodicInvoiceAttributeName, default name: NextPeriodicInvoice
- LastPeriodicInvoicingAttributeName, default name: LastPeriodicInvoicing
Setting up periodic invoicing
- Go to Admin Panel > Customer card (of selected customer) and select Edit.
- To turn on periodic invoicing, check the checkbox Turn periodic invoicing on and off.
- When selecting this option, the fields Invoicing period in months and Next periodic invoice on are displayed. These fields are mandatory. Fill in number of invoicing periods per month, and date of next invoice.
- Select Save.
How periodic invoicing works
When turning on periodic invoicing, the system will mark the selected customer for periodic invoicing with custom attributes for account details.
- Name: PeriodicInvoicing
Value: true - Name: PeriodicInvoicingPeriodInMonths
Value: value from input field, default:1
- Name: NextPeriodicInvoice
Value: value from input field, default: current date plus one month
In the background, the scheduled task Atomia.Billing.Plugins.GenericWorkflowPlugin.ScheduledTasks.PeriodicInvoicingScheduledEventHandler is extended. It picks up customers for invoicing according to the set next invoice date, and schedules and executes the customer’s invoicing tasks.
Turning off periodic invoicing
If periodic invoicing is turned off and the customer goes back to regular invoicing, the system will mark that customer for one last periodic invoicing iteration. This makes sure all subscriptions are invoiced. This is done by removing PeriodicInvoicing attribute and setting the following values.
- Name: LastPeriodicInvoicing
- Value: true