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

Queue service upgrades until invoice paid

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0-b2
    • Component/s: None
    • Labels:
      None

      Description

      Add a setting to only process upgrades after paid in full.
      Add a setting to cancel pending upgrades after X days past due (default to 7 days).

      When a client processes an upgrade the system will record the details of the upgrade and create an invoice. The reference to the invoice will be stored with the upgrade details (the invoice line item won't reference the service ID).

      If enabled, only when the invoice is paid in full will the upgrade details be processed to complete the upgrade. Otherwise the upgrade details are processed immediately.

      As soon as the upgrade is processed the original linked invoice should be updated with the service ID of the upgraded service. This ensures that the invoice maintains a link with the service.

      This requires a new database table and model to handle the upgrade data and track the invoice number used for the service being upgraded.

      A cron task will need to be created to process upgrades for pending upgrades with invoices that have been paid. As well as change the status of pending upgrades to canceled if the invoice for the pending upgrade has been removed or voided.

      Upgrades should be flagged with the date/time completed and status

      {pending, canceled, error, completed}

      (indexed).

      ----------
      Settings:

      • Only process pending upgrades after paid in full
      • Cancel pending upgrades X days after invoice is due (default to 7 days)

      Upgrading when the setting for pending upgrades is enabled:

      • Create an invoice for the upgrade cost for the service. Include line items for the package and all config options to be added and removed, as well as any discount
      • When the invoice is paid, the cron will attempt to perform the upgrade

      Expired pending upgrade X days after invoice is due:

      • Update the pending upgrade to status 'canceled' and set the date/time
      • Unapply any partial payments on the invoice, and void the invoice

      Successful upgrade:

      • Update the pending upgrade to status 'completed', and set the date/time
      • Update the paid invoice to associate each line item on the invoice with the service ID

      Failed upgrade:

      • Update the pending upgrade to status 'error' and set the date/time. The cron task should no longer attempt to process this upgrade
      • Leave the invoice and service alone

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/15

                Agile