Jump to content

prevent automatic account cancellation if client still has outstanding invoices


easyhosting

Recommended Posts

Hi All

 

I would like to know is their a way to stop an automatic account cancellation request being carried out if a client has outstanding invoices on his account.

Offhand, the only option I can think of for that would be to uncheck Setup -> Automation Settings -> Miscellaneous -> Cancellation Requests. However, that's a global option which would affect all cancellations.

Link to comment
Share on other sites

  • 1 month later...

You could modify the clientareaproductdetails.tpl template to disable the cancellation button if balance is due.

 

We change the following code:

 

    {if $showcancelbutton && ($status eq $LANG.clientareaactive OR $status eq $LANG.clientareasuspended)}<td align="center">
     <input type="button" value="{$LANG.clientareacancelrequestbutton}" onclick="window.location='clientarea.php?action=cancel&id={$id}'" class="button" />
     </td>{/if}

 

to:

 

    {if $showcancelbutton && ($status eq $LANG.clientareaactive OR $status eq $LANG.clientareasuspended)}
       {if $clientsstats.numdueinvoices > 0}
               <td align="center"><input type="button" value="{$LANG.clientareacancelrequestbutton} - Due Invoices" onclick="window.location='clientarea.php?action=cancel&id={$id}'" class="button" disabled /></td>
       {else}
               <td align="center"><input type="button" value="{$LANG.clientareacancelrequestbutton}" onclick="window.location='clientarea.php?action=cancel&id={$id}'" class="button" /></td>
       {/if}
   {/if}

Edited by marshalm
typo in code
Link to comment
Share on other sites

You could modify the clientareaproductdetails.tpl template to disable the cancellation button if balance is due.

 

We change the following code:

 

    {if $showcancelbutton && ($status eq $LANG.clientareaactive OR $status eq $LANG.clientareasuspended)}<td align="center">
     <input type="button" value="{$LANG.clientareacancelrequestbutton}" onclick="window.location='clientarea.php?action=cancel&id={$id}'" class="button" />
     </td>{/if}

 

to:

 

    {if $showcancelbutton && ($status eq $LANG.clientareaactive OR $status eq $LANG.clientareasuspended)}
       {if $clientsstats.numdueinvoices > 0}
               <td align="center"><input type="button" value="{$LANG.clientareacancelrequestbutton} - Due Invoices" onclick="window.location='clientarea.php?action=cancel&id={$id}'" class="button" disabled /></td>
       {else}
               <td align="center"><input type="button" value="{$LANG.clientareacancelrequestbutton}" onclick="window.location='clientarea.php?action=cancel&id={$id}'" class="button" /></td>
       {/if}
   {/if}

 

The problem with that is that it could easily be bypassed by a client who is familiar with how WHMCS works. A proper solution would be a setting in WHMCS itself that says something like "Prevent cancellation of accounts that have outstanding invoices".

Link to comment
Share on other sites

  • 1 month later...

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