Jump to content

Cancelled Product? Cancel Invoice!


Operator

Recommended Posts

Hey

 

Ever had a client cancel a product only to discover that they had put in the cancellation request after you had already invoiced them for the upcoming renewal? Well my action hook will automatically cancel the invoice once the product has had its status changed to cancelled (ie it will only cancel the invoice once the product has actually been cancelled depending on whether the client chooses immediate or at the end of the period)

 

-My action hook gets executed after the cron job

-It will email you a separate cron report (currently no way to add it to the WHMCS cron report)

-It only sends the cron report to admins that receive system emails.

-It logs itself as having been run in the activity log (like WHMCS cron)

-The invoice that gets cancelled has a note added that it was cancelled by the script so you can tell what has been cancelled by it and what hasnt.

 

To install:

Just upload the file to the includes/hooks folder of your whmcs installation

Thats it your done.

 

Download:

http://robertscode.com/projects/whmcs/cancel_request_invoices/cancelrequestinvoices.zip

Edited by Operator
Link to comment
Share on other sites

Just thinking ...

 

Shouldn't this run before the cron job to ensure we don't send an overdue notice to the client when the product is already cancelled? Or am I missing something?

 

Great mod, thanks, although would also love to be able to buy the source, whatever state it's in!

Link to comment
Share on other sites

Just thinking ...

Shouldn't this run before the cron job to ensure we don't send an overdue notice to the client when the product is already cancelled? Or am I missing something?

 

Hi Brian

 

Yea i thought about that but the problem is the cancellation requests get processed last in the cron job and the invoices get processed first in the same cron job so if i did it before the cron ran anyone that was to get cancelled that day would have there product cancelled and still emailed an overdue notice after the whmcs cron ran.

 

Cheers

Link to comment
Share on other sites

I don't understand why anyone would encode a free script. It's not like it contains anything proprietary. Honestly, I (like many others) mistrust anyone who feels the need to obfuscate something that is free.

 

I would think there are only 2 possible reasons to do this:

 

1) The author plans to make it a paid script at some point

2) There is code in there that opens a backdoor or reveals some information to the author.

 

I have never encoded any of my free addons and will never do so, as there is absolutely no need to.

Link to comment
Share on other sites

I don't understand why anyone would encode a free script. It's not like it contains anything proprietary. Honestly, I (like many others) mistrust anyone who feels the need to obfuscate something that is free.

 

I would think there are only 2 possible reasons to do this:

 

1) The author plans to make it a paid script at some point

2) There is code in there that opens a backdoor or reveals some information to the author.

 

I have never encoded any of my free addons and will never do so, as there is absolutely no need to.

 

You choose not to encode yours, other programmers choose the opposite, neither are right or wrong. The topic has been done to death on here, lets not bring it up again :)

 

As for the MOD, thanks for creating it, I'm sure it will turn out to be a huge time saver!

Link to comment
Share on other sites

You choose not to encode yours, other programmers choose the opposite, neither are right or wrong. The topic has been done to death on here, lets not bring it up again :)

 

As for the MOD, thanks for creating it, I'm sure it will turn out to be a huge time saver!

 

Indeed. I will not mention it again.

 

Looking over the mod, it seems to just outright cancel an invoice associated with the product. I see one major problem there:

 

An invoice can contain services that are not related. For instance, another hosting account could be invoiced as it is due on the same day. If you just cancel the invoice, you mess up the other account as well.

 

Please advise.

Link to comment
Share on other sites

Hey

 

Version 1.1 is now released:

 

Changes:

  • Invoice notes are now appended (won't overwrite existing notes)
  • Now compares hosting amount to invoice amount and if they don't match will say this in the cron report advising you to edit the invoice manually.

 

Same download link as above:

http://robertscode.com/projects/whmcs/cancel_request_invoices/cancelrequestinvoices.zip

Link to comment
Share on other sites

Hey

 

Version 1.1 is now released:

 

Changes:

  • Invoice notes are now appended (won't overwrite existing notes)
  • Now compares hosting amount to invoice amount and if they don't match will say this in the cron report advising you to edit the invoice manually.

 

Same download link as above:

http://robertscode.com/projects/whmcs/cancel_request_invoices/cancelrequestinvoices.zip

 

What about if the invoice has a late fee applied? Then the invoice amount won't match the hosting amount.

 

The less-than-ideal solution would be to move the hosting product to a new invoice, set it's due date to the same as the old due date, and then mark it as canceled. Then, recalculate the Late Fee on the old invoice (if applicable).

 

That would be the safest way to make it completely automated.

 

Feel free to steal my idea and implement it ;)

Link to comment
Share on other sites

What about if the invoice has a late fee applied? Then the invoice amount won't match the hosting amount.

 

The less-than-ideal solution would be to move the hosting product to a new invoice, set it's due date to the same as the old due date, and then mark it as canceled. Then, recalculate the Late Fee on the old invoice (if applicable).

 

That would be the safest way to make it completely automated.

 

Feel free to steal my idea and implement it ;)

 

Hi it matches the invoice subtotal before taxes credits and other such fees are applied.

 

Good suggestion. Maybe something i will add next release.

Edited by Operator
Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
Something nice that might be good for the script is, automatic invoice reversal after a package has been terminated for longer than xxx days. This way I don't have to go in manually removing invoices from clients that didn't pay.

 

This addon can do that if you set the Enable Termination under Automation Settings in the admin and configure it properly.

Link to comment
Share on other sites

  • 4 weeks later...

Could you add an option to disable purging the invoice if it is already past due? I'm sure many of us here have a "cancellation policy" in place that requires a customer to "cancel" by a certain time in the renewal cycle (such as x days before the due date) to avoid at least a next monthly renewal. Your mod is great except (if I'm seeing things correctly; please correct me if I am wrong) it can purge invoices that are already past their due date when the customer initiates the cancellation.

Link to comment
Share on other sites

Many providers will likely have a "cancellation policy" requiring a cancellation to be made XX days before the renewal date (or even just the renewal date). It appears your mod will actually allow a customer to cancel a package after their due date has come and gone and then purge invoices that should still be paid. How about an option to not purge the invoice if it is within XX (configurable) before the due date (or on/after the due date)?

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

I am getting an error when I run this job.

PHP Fatal error: Call to undefined function add_hook() in /usr/local/www/npsis. com/npsiscom/public_html/clients/includes/hooks/cancelrequestinvoices.php on lin e 45

 

I am on WHMCS Version 4.1.2

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