farrelan Posted January 26, 2012 Share Posted January 26, 2012 I have created a server module that I need to use to tie into our systems. In this module I have created the following function to use for testing. When the cron runs it does in fact update just as I expected it to. Now I have changed one of the test orders so that the next invoice was yesterday. I let the cron run and saw that a invoice was created but it didnt bill over any overage. I have looked over all my setting and made sure that it was setup to bill for overages and all seems to be correct. Am I jumping the gun on this? Am I not allowed to force it to run as a test? I hope I dont have to wait till the end of the month just to make sure this is setup correctly. function xdn_UsageUpdate($params) { $serverid = $params['serverid']; $serverhostname = $params['serverhostname']; $serverip = $params['serverip']; $serverusername = $params['serverusername']; $serverpassword = $params['serverpassword']; $serveraccesshash = $params['serveraccesshash']; $serversecure = $params['serversecure']; // Just update the table with some fake data until I see it bill. update_query("tblhosting",array( "bwusage"=>99348, "bwlimit"=>1000, "lastupdate"=>"now()", ),array("server"=>$serverid,"mapid"=>"1180")) } 0 Quote Link to comment Share on other sites More sharing options...
Sitepearl Posted January 26, 2012 Share Posted January 26, 2012 A cron job is a cron job, if you create a separate job for this single task, there is no harm in that. Though if you are creating invoices each time the thing runs, who's to say that if someone was over today that they won't be tomorrow? Nothing would tick me off more as a client than to have upwards of 30 invoices due at the end of the month 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 26, 2012 Share Posted January 26, 2012 The bandwidth and disk usage only runs once a month from the cron... generally the last day of the month. 0 Quote Link to comment Share on other sites More sharing options...
SilverNodashi Posted January 26, 2012 Share Posted January 26, 2012 The bandwidth and disk usage only runs once a month from the cron... generally the last day of the month. So, if the OP wants to test the bandwidth usage billing today, then he'll need to temporarily change the date on the server to the first day of next month 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 26, 2012 Share Posted January 26, 2012 So, if the OP wants to test the bandwidth usage billing today, then he'll need to temporarily change the date on the server to the first day of next month NO... the last day of this month 0 Quote Link to comment Share on other sites More sharing options...
SilverNodashi Posted January 26, 2012 Share Posted January 26, 2012 NO... the last day of this month Can you actually confirm that it runs on the last day of the month, or are you guessing? I'm just curious cause you come across very strongly about this......... My logic would tell me it would be on the first day of the next month, since servers actually still consume bandwidth upto the last minute of the last day, and if his cron runs at say 21:00, then he'll miss out on 3hours worth of bandwidth usage. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 26, 2012 Share Posted January 26, 2012 Go to setup->automation settings to look for yourself...to make sure you get the most of the data you would need to run your cron at 1 minuite to midnight. Overage Billing Charges Calculate & invoice on the last day of the month independantly from the related product Calculate on the last day of the month but include on the next invoice to generate for the client 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.