hanstavo Posted October 21, 2018 Share Posted October 21, 2018 Is there a hook that can set the client group id to 0 (none) while he/she has an unpaid or overdue invoice, but sets it back to client group id 1 when he/she pays the invoice, however doesn't set the client group until the product has been accepted. so the conditions for when and when not: set it to 1 if the product is accepted, and no unpaid/overdue invoices. set it to 0 when the product has an unpaid/overdue, and is not approved. 2 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 22, 2018 Share Posted October 22, 2018 19 hours ago, hanstavo said: Is there a hook that can set the client group id to 0 (none) while he/she has an unpaid or overdue invoice, but sets it back to client group id 1 when he/she pays the invoice, however doesn't set the client group until the product has been accepted. Accept Order can be used when you accept an order - inside the hook, you could either run a SQL database update query or use the UpdateClient API to change the group value... you could also do a query to check if that client has unpaid/overdue invoices for your conditionality. 19 hours ago, hanstavo said: so the conditions for when and when not: set it to 1 if the product is accepted, and no unpaid/overdue invoices. set it to 0 when the product has an unpaid/overdue, and is not approved. InvoicePaid can be used after an invoice is marked as paid. 3 Quote Link to comment Share on other sites More sharing options...
hanstavo Posted October 22, 2018 Author Share Posted October 22, 2018 12 minutes ago, brian! said: Accept Order can be used when you accept an order - inside the hook, you could either run a SQL database update query or use the UpdateClient API to change the group value... you could also do a query to check if that client has unpaid/overdue invoices for your conditionality. InvoicePaid can be used after an invoice is marked as paid. Can it be done if its not manualy marked as paid but automatically is set to paid? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 23, 2018 Share Posted October 23, 2018 23 hours ago, hanstavo said: Can it be done if its not manually marked as paid but automatically is set to paid? yes. 0 Quote Link to comment Share on other sites More sharing options...
hanstavo Posted October 24, 2018 Author Share Posted October 24, 2018 9 hours ago, brian! said: yes. So If I use the hook you said, it will work even if I don't manualy marke invoice as paid but only do if I manually (or automatically) approved the order? Because currently it only is working when I manualy mark invoice as paid. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.