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

Creating a service may fail to create an associated invoice

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.0
    • Fix Version/s: 4.0.0-b4
    • Component/s: Staff Interface
    • Labels:
      None

      Description

      This occurs if the client's invoice method is not an acceptable delivery option.

      For example, if the client has their "Invoice Method" set to "Paper", and an admin updates the client's client group/company settings to disable "Paper" as a delivery method, an invoice could not be created. The invoice would attempt to be created with the "Paper" invoice delivery method, but that would fail due to the error of it not being a valid method (since it's disabled).

      A few options to resolve:

      1. When removing a delivery method, update all clients belonging to the client group/company for that change and default their "inv_method" setting to "email".
      2. Update AdminClients::createService to wrap service creation and invoice creation in a transaction. However, this would cause a nested transaction. The Record component would probably need to be updated to not start a new transaction if one already exists.
      3. Update Invoices::createFromServices to ensure that the selected delivery method for the client is valid before attempting to create an invoice with it. i.e. Make sure the client's "inv_method" is in the list of Invoices::getDeliveryMethods, otherwise default to "email".

      Additionally, if the client is set to an invoice method that is no longer valid, there is no option shown under "Invoice Method" on their profile page, so admins cannot change it.

        Activity

        Hide
        admin Paul Phillips added a comment -

        Option 1 & 3 sound good to me.

        Show
        admin Paul Phillips added a comment - Option 1 & 3 sound good to me.
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        This task is resolved via option #3

        Show
        tyson Tyson Phillips (Inactive) added a comment - This task is resolved via option #3

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              7/Dec/16

              Agile