Jump to content

Is this a bug when the user pays for unused time becsuse modukle "create" did not run


paperweight

Recommended Posts

The module "Create" command will not run unless a user pays successfully. But if there is a delay from the time a user first attempts to pay and they day they pay, they will be paying for unused time, right?

 

For example, if on Monday the user tries to buy hosting but they fail to complete the payment processing at Paypal, we will send them an overdue payment invoice. Then if they finally pay on Friday, they will be paying for the tiem from Monday-Friday without ever having the benefit of using the service since the module Create did not run yet.

 

Is there a way to have the invoice/payment start on the day they finally pay?

Edited by paperweight
ahhh... I clicked "Return" befofre editing the HEADLINE of this.... too late!
Link to comment
Share on other sites

Thanks John:

If that is the way it works now, I understand. But is there a way to make an adjustment on this for future iterations? I mean can it be adjusted to start on the day payment is made and/or the module is created? I use 2 well-known WHMCS companies to help with modifying my WHMCS installation and both state this has been a pain for them in the past and they have no real advice on what to do either unless it is a core change. So it seems like this is an issue for other clients -- it has actually been an issue for me for 1+ year and I finally got the courage to ask for advice on this ;)

Link to comment
Share on other sites

I've noticed this as well and never thought it to be very consumer friendly. Here is a hook script that will adjust the next due date based on when the create module was ran successfully.

 

Create this as a php file in includes/hooks (PHP 5.3+ required) and set the time zone correctly in the function.

 

<?php

function update_next_due_date_after_create($vars) {

 // Set this to the time zone of your server.
 date_default_timezone_set('America/Los_Angeles');

 $service_id = $vars['params']['serviceid'];  
 $results = select_query("tblhosting","regdate,nextduedate", array("id" => $service_id));
 $service_details = mysql_fetch_array($results);

 $todays_date = toMySQLDate(getTodaysDate());

 // If the registration date is not today, update the next due day.

 if ($service_details['regdate'] != $todays_date ) {

     $regdate = new DateTime($service_details['regdate']);
     $today = new DateTime($todays_date);
     $next_due_date = new DateTime($service_details['nextduedate']);

     // Calulate the difference
     $interval = $regdate->diff($today);

     // Add the difference to the next due date
     $next_due_date->add($interval);

     // update nextduedate and nextinvoicedate
     update_query("tblhosting", array("nextduedate" => $next_due_date->format('Y-m-d'), "nextinvoicedate" => $next_due_date->format('Y-m-d')), array("id" => $service_id));

 }



}


add_hook("AfterModuleCreate",1,"update_next_due_date_after_create");


?>

Link to comment
Share on other sites

  • 5 months later...
I've noticed this as well and never thought it to be very consumer friendly.

 

Yikes! Sorry for my loooong delay -- I must have missed this response in my email. I had a developer create something similar to your hook above, and I will have him look at it and see if there is anything we missed. So far in the past few months things are better with the hook.

 

Again, I understand this is how WHMCS is supposed to work, since this is how it works ;) But I have seen and talked to many others who see this as an annoying bug. So hopefully maybe in a future update we will see a radiobutton choice to turn this on or off built into WHMCS.

Link to comment
Share on other sites

I've noticed this as well and never thought it to be very consumer friendly.

 

Yikes! Sorry for my loooong delay -- I must have missed this response in my email. I had a developer create something similar to your hook above, and I will have him look at it and see if there is anything we missed. So far in the past few months things are better with the hook.

 

Again, I understand this is how WHMCS is supposed to work, since this is how it works ;) But I have seen and talked to many others who see this as an annoying bug. So hopefully maybe in a future update we will see a radiobutton choice to turn this on or off built into WHMCS.

Link to comment
Share on other sites

Can you add it to the Requests page please? I just tried adding and then it asks me to get a new username/password and register, so I just stopped -- too troublesome and pain in the butt since I already have usernames for the WHMCS Client area and another one for the Forum... why should I now get one for the Requests? So can you please help and add it to there?

Link to comment
Share on other sites

screw it. I wrote a long request, then clicked the SSO and was brought to the Foums page where I was already logged in. When I clicked the Back button, my whole response was deleted. Again, too troublesome. Obviously dozens of other people have mastered this and are smarter than I am, as they appear able to post.

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