Invoicing subscriptions periodically

Tags: 130 views 0

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.

  1. AdminPanel
    • Atomia.Web.Plugin.BillingAdminPanel.General.dll.config as <pluginSetting>.
  2. 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

    1. Go to Admin Panel > Customer card (of selected customer) and select Edit.
    2. To turn on periodic invoicing, check the checkbox Turn periodic invoicing on and off.
    3. 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.
    4. Select Save.

    Turning on customer periodic invoicing

    Image: Turning on customer periodic invoicing.

    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.

    Keep in mind

    If plugin configuration for periodic invoicing scheduled task contains AutoApprove set to false, in order for invoices to be created, the administrator should approve created tasks on Scheduled Task page in Admin Panel.

    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

Was this helpful?