Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2167

Services may renew for paid invoices that are not necessarily for the renewal

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 4.1.1, 4.2.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      A service to renew currently occurs via Services::getAllPaidPending by checking that a service has a non-null last renew date, and an invoice that has been paid associated with the service since the last time the cron ran to renew services.

      This is not enough criteria to distinguish whether the paid invoice for the service is indeed for a renewal. The invoice could be for a service option, a term/package change, or something else.

      The proposed resolution is to specifically associate a renewal invoice with its service. Only when one of these invoices is paid would the service renew.

      When a service renewal date is bumped, an invoice is created for it. This is the invoice that should be saved as the renewal invoice. Once this invoice has been paid, the service should be renewed, and the associated record of the renewal invoice should be removed.

      New table:
      `service_invoices`
      `service_id`, `invoice_id`

      When the cron runs to create a service renewal invoice, add it to `service_invoices`.
      When the invoice is paid in full, the Services::getAllRenewablePaid method (or another method) called from the cron should check the `service_invoices` table to determine any of the invoices has been paid. For every paid invoice, renew the service, and remove the records from `service_invoices` table.

        Issue Links

          Activity

          Hide
          tyson Tyson Phillips (Inactive) added a comment -

          For backward compatibility, during upgrade, we may need to add all open invoices into `service_invoices` that contain a line item with a service ID. This would allow the current incorrect behavior to continue for existing invoices so that we do not miss renewing any services that should be renewed.

          Show
          tyson Tyson Phillips (Inactive) added a comment - For backward compatibility, during upgrade, we may need to add all open invoices into `service_invoices` that contain a line item with a service ID. This would allow the current incorrect behavior to continue for existing invoices so that we do not miss renewing any services that should be renewed.

            People

            • Assignee:
              jonathan Jonathan Reissmueller
              Reporter:
              tyson Tyson Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                27/Sep/17

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 56 minutes
                2h 56m

                  Agile