Subscriptions: Invoice at start of invoice period

Creating a separate topic from

Invoices shall be created at the beginning of the consumption period, covering all consumption to be expected with int the invoice period.

Any hints how to achieve this?


I did not manage, having both monthly and 6-monthly to be invoiced at the beginning of the period.
For what I want:

  • for monthly invoicing: one payment each month, covering that month (easy)
  • for 6-monthly invoicing: one payment in the first month, covering all six montsh (easy)

Any hints?

Here is what I tried:

  1. This will create the invoice for the 6-month subscription in the last run only.

    for month in (1,2,3,4,5,6):  # consume and invoice each month
       create-consumptions(month)
       create-invoice(month)
    
  2. This will create an invoice for the “monthly” payment n month 1 (covering all 6 month consumptions) and for the “half-year” in month 6.

    create-consumptions(6)  # consume 6 month
    for month in (1,2,3,4,5,6):
       create-invoice(month)
    
  3. This wIll create one invoice for each in month 6.(obvious, jsut for completnes)

    create-consumptions(6)  # consume 6 month
    create-invoice(6)  # invoice 6 month
    
  4. This wIll create one invoice for each in month 6.(obvious, jsut for completnes)

    for month in (1,2,3,4,5,6):
       create-consumptions(month)
    create-invoice(6)
    

You just need to use the same recurrence for consumption and invoice and leave the invoice_date of the subscription blank.

This will create an invoice for the same day as the consumption.