Jump to content

Set client group if invoice is unpaid or overdue


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated