Sometimes you need to perform a manual action right after the client pays a certain invoice.
With this Custom Hook this is easily done.
Upload the file invoice_todo.php into the /includes/hooks folder
Make sure you have the CreateToDo API installed otherwise this hook will not work
Create a ToDo when the invoice gets paid
To simplify the process we added a tab in the invoice page. If the invoice hasn’t been paid yet you will see a new tab with the name “Create ToDo When Paid”
Once you click on that tab you will be redirected on the client’s note page, and a prompt will ask you to add a text for you ToDo. Once you click “Ok” the text will be added in the textarea, you will be able to check it and save the note.
Set the ToDo from the notes page
After you create the invoice, get its id. Go on the client profile (if you are on the invoice screen just click on his name) and click on notes. You can get the id of the invoice from the invoice url (in this case the id is 4)
To add a note all you have to do is to click on the button below the note textarea. Two prompts will appear. The first one will ask you to insert the invoice id, the second one will ask you to insert the text for the todo. This text will be used as the ToDo description.
Once you added all the requested data the note will be added and saved automatically.
It’s done. When the invoice will be marked as paid the hook will create the todo with your text
Delete the note after creating the ToDo
By default this module do not delete the client note you created form the client notes.
If you want to delete the client notes you will need to use our free Custom module to manage hooks settings. You will need to create a setting with the name of “whmcstricks_invoice_todo_delete_note” and a value of true. If this setting is specified the client note will be deleted once the todo has been created.
Got questions or problems? Contact us or comment, we’ll be happy to help.