Lawrence Posted September 17, 2009 Share Posted September 17, 2009 Hi guys, I know someone else posted a similar addon here not long ago, but I decided to cook up my own and release it. Just a few notes: - It currently only cancels invoices that have either just a hosting product, or a hosting product with a late fee. An invoice with any other services is left untouched. - All you need to do is unzip the attached file, and upload the .php file to the includes/hooks folder to get it working. Works only with v4. 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted September 17, 2009 Share Posted September 17, 2009 How does it work if say the invoice has two items, one of which is the one you want to cancel and the other is one you want to invoice? Will it just remove the cancelled product line and adjust rather than cancel the whole invoice? 0 Quote Link to comment Share on other sites More sharing options...
Operator Posted September 17, 2009 Share Posted September 17, 2009 Hi guys, I know someone else posted a similar addon here not long ago, but I decided to cook up my own and release it. Just a few notes: - It currently only cancels invoices that have either just a hosting product, or a hosting product with a late fee. An invoice with any other services is left untouched. - All you need to do is unzip the attached file, and upload the .php file to the includes/hooks folder to get it working. Works only with v4. whats the difference to mine? 0 Quote Link to comment Share on other sites More sharing options...
Operator Posted September 17, 2009 Share Posted September 17, 2009 -cannot edit above post- Besides taking my idea and changing it ever so slightly just enough so you can put your own up. Your good at this aren't you Lar? First Sparkys comparison mod and now mine good thing I encode my modules the most you can steal is the idea! In my case it was a free module but it still does not give you the right to steal someones idea. You could have contacted me first about your suggestion or contacted me checking if I was ok for you to create your own mod using my idea, before just stealing it with no reference at all. You are the first to complain when someone encodes a module and its people like you that cause programmers like me to encrypt our work. Lar's previous attempt at stealing someones idea: http://forum.whmcs.com/showthread.php?t=21116 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted September 17, 2009 Share Posted September 17, 2009 OK then I'll report my above question to Rob who sounds like he works in an ethical way unlike Lars How does it work if say the invoice has two items, one of which is the one you want to cancel and the other is one you want to invoice? Will it just remove the cancelled product line and adjust rather than cancel the whole invoice? 0 Quote Link to comment Share on other sites More sharing options...
Operator Posted September 17, 2009 Share Posted September 17, 2009 Hi Phill, If you are using my mod then if there are 2 items on the one bill it wont automatically cancel it. Instead it will list this as an error in the cron report letting you know that you will need to correct it manually (ie adjusting the invoice amount yourself to remove the cancelled product). 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted September 17, 2009 Share Posted September 17, 2009 Sounds good. Is it possible to tweak it so it adjusts instead? I'll be installing yours either way I think 0 Quote Link to comment Share on other sites More sharing options...
Operator Posted September 17, 2009 Share Posted September 17, 2009 Hi Yea I hope to include that function in a future update. Currently it just notifies you by email for ones that require attention. 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted September 19, 2009 Author Share Posted September 19, 2009 lol I am unethical because I made open code that does the same thing as yours? Give me a break. If that's the case, then OpenOffice is unethical because MS Office does the same thing (but slightly differently). Linux is unethical because it is an OS, and Windows and Mac already exist. As for copying Sparky's mod, our 2 mods both work differently. They achieve a similar result, but have entirely different guts. In both cases, I had the idea well before either mod was released. If anything, we both copied WHMCS (who have had this feature on their Dev Tracker for ages). I simply do not like dealing with encoded addons from untrusted sources. At least with my mod, it can be updated to work with new WHMCS versions if need be. With yours, the user is at your mercy and screwed if it is not updated to work with a new version of WHMCS if needed. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted September 21, 2009 Share Posted September 21, 2009 Besides taking my idea Hardly a unique idea though, we've been doing this for domains 30 days after expiry (setting them to cancelled, voiding the invoice) hosting after termination and on client cancellation, and 7 days after ssl expiry for ~18 months ... 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted September 21, 2009 Author Share Posted September 21, 2009 Hardly a unique idea though, we've been doing this for domains 30 days after expiry (setting them to cancelled, voiding the invoice) hosting after termination and on client cancellation, and 7 days after ssl expiry for ~18 months ... Exactly, and this "idea" has been on the WHMCS Dev Tracker since before either of us made an addon for it, so it's hardly my idea or Operator's. 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted October 21, 2009 Author Share Posted October 21, 2009 Here is a bug fix release. It takes care of a condition where an invoice with 2 hosting accounts would be marked as Canceled if only one was actually being canceled. I also added admin e-mail notifications of Successful and Failed attempts to automatically cancel an invoice. Thanks to the WHMCS guys for pointing me to the correct function to use to do this. Cheers! 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted December 16, 2009 Share Posted December 16, 2009 Sometimes is necessary to terminate/create account from a customer, to clean up account for example. What happen if you perform this action? 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted December 17, 2009 Author Share Posted December 17, 2009 Sometimes is necessary to terminate/create account from a customer, to clean up account for example. What happen if you perform this action? Unfortunately, there is no way for the addon to know what your intentions are. In your case, I would simply do the work outside of WHMCS. 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted December 17, 2009 Share Posted December 17, 2009 That is right. But, when running via crontab or auto-terminate accounts I think that _SESSION['admin'] is not available, so this can be used as variable to identify automatic actions or not and can fix this issue. 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted December 17, 2009 Author Share Posted December 17, 2009 That is right. But, when running via crontab or auto-terminate accounts I think that _SESSION['admin'] is not available, so this can be used as variable to identify automatic actions or not and can fix this issue. Except it cannot rely on this variable. This addon is designed to work WITH the automatic termination functionality in WHMCS, which is handled by the daily cron job and doesn't have a $_SESSION variable. It is intended to work with the "Terminate" button as well, to make hosts lives easier when removing accounts. If you are terminating and recreating an account from within WHMCS, simply check to see if there is an Unpaid invoice for it, set it to Canceled. When you recreate the account, you can set the invoice back to Unpaid. This will cause the addon to leave it alone (as it looks only at invoices set to Unpaid). I hope this helps! 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted December 17, 2009 Share Posted December 17, 2009 This is easy to perform when you are the only person to operate whmcs... But instruct other I really think that someone will forget to do this.. Hehehe... ;-) I will try to think a way to only cancel invoice when terminate action come called from cron. 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted December 17, 2009 Share Posted December 17, 2009 Ahh... Thank you for share. I'm looking for this from a LONG TIME. I have requested this as FEATURE in WHMCS CORE CODE many times... This is a very important contribution. 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted December 17, 2009 Author Share Posted December 17, 2009 (edited) This is easy to perform when you are the only person to operate whmcs... But instruct other I really think that someone will forget to do this.. Hehehe... ;-) I will try to think a way to only cancel invoice when terminate action come called from cron. If you want to hack it to do this, it is possible. Simply replace this: TerminateAccountInvoice_MarkCancelled($myinvoiceid, $TerminateAccountNote); sendAdminNotification("system","Auto Invoice Cancellation - Success","Invoice $myinvoiceid was cancelled automatically. Nothing needs to be done with it."); with this: if($_SESSION['adminloggedinstatus'] != 'true'){ TerminateAccountInvoice_MarkCancelled($myinvoiceid, $TerminateAccountNote); sendAdminNotification("system","Auto Invoice Cancellation - Success","Invoice $myinvoiceid was cancelled automatically. Nothing needs to be done with it."); } The code above SHOULD work, but I have not tested it (so no promises). Also, I cannot provide any support once you do this change. Edited December 17, 2009 by Lawrence edited to fix 2nd bit of code 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted December 17, 2009 Share Posted December 17, 2009 This is exactly what I would try. There is no problem, man! I will test it for you and keep you updated. Thank you for your readiness. 0 Quote Link to comment Share on other sites More sharing options...
Dedigeeks-Sean Posted December 22, 2009 Share Posted December 22, 2009 So we just upload and that is it? I am not an expert on these hook, So we do not need to make changes or anything? Thanks Sean 0 Quote Link to comment Share on other sites More sharing options...
Lawrence Posted December 22, 2009 Author Share Posted December 22, 2009 So we just upload and that is it? I am not an expert on these hook, So we do not need to make changes or anything? Thanks Sean You upload, configure the settings in the Admin area and are done 0 Quote Link to comment Share on other sites More sharing options...
equipc Posted January 17, 2010 Share Posted January 17, 2010 Hi, I installed your script in include/hooks/ folder but it looks like it doesn't work Does I have to do something ? Thanks for your help, 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted January 17, 2010 Share Posted January 17, 2010 You need to fix variables when the hook is called, because variables is inside array. 0 Quote Link to comment Share on other sites More sharing options...
equipc Posted January 18, 2010 Share Posted January 18, 2010 You need to fix variables when the hook is called, because variables is inside array. Hi jozeph, Sorry but I don't understand what I have to change. Can you give me more informations ? Do you have a working script ? Thanks, 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.