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:
- 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".
- 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.
- 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.