Configure a monthly's sale subscription in advance

I’m trying to configure (with no success) a sale subscription with a monthly’s recursion set in advance.
As an example, I want to create a new subscription that creates consumption of March on 29th of February; and create invoice for this consumption on 29th of February as well.

In that way, I was thinking could be interesting for users to see in the subscription the computation of next invoice date and/or next consumption date in order to know if it is configured correctly.

Could you explain what you tried and why it did not work?

I tried many subscription configurations, imho the most consistent is the following.

  • Start date: 01/03/2020
  • Start invoice date: 29/02/2020
  • Invoice Recurrence: monthly
    • interval: 1
    • day of month: -1
  • Line (1):
    • same recurrence
    • start date: 01/03/2020
  • Dates obtained:
    • next invoice date: 31/03/2020
    • next consumption date delayed: 31/03/202

Indeed I get it working with following configuration:

  • Start date: 01/02/2020
  • Start invoice date: 29/02/2020
  • Invoice Recurrence: monthly
    • interval: 1
    • day of month: -1
  • Line (1):
    • same recurrence
    • start date: 01/02/2020
  • Dates obtained:
    • next invoice date: 29/02/2020
    • next consumption date delayed: 29/02/202

But IMHO it is not completely correct due to subscription starts on March not in February (starts on March but it is invoiced the last day of February).

Have you tried using different recurrences for invoices and for consumptions?
For what you explain I understand that they are different as one uses the last day of the month but the other the first day of the next month.

In addition to having a different consumption recurrence as @pokoli said. I think we should fix compute_next_invoice_date because it does not take into account the possibility of an invoice date before the start date (I think date should be: self.next_invoice_date or start_date). So for me, the first example has the correct meta data exception for consumption recurrence because it should create the consumption one month in advance.

Yes I tried this configuration that works for consumption date but not for invoice date:

  • Start date: 01/03/2020
  • Start invoice date: 29/02/2020
  • Invoice Recurrence: monthly
    • interval: 1
    • day of month: -1
  • Line (1):
    • recurrence: monthly
      * interval 1
      * day of month: 1
    • delayed: -1d
    • start date: 01/03/2020
  • Dates obtained:
    • next invoice date: 31/03/2020 (not OK)
    • next consumption date delayed: 29/02/202 (OK!)

That sounds good to me.

I added the review 258741002 to fix it.

But does it solve the problem? If yes could you mark it as solution.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.