Site/Module setup work and auto_format fixes

This commit is contained in:
Deon George
2012-01-02 12:35:47 +11:00
parent 407eed04c9
commit a464d73f9a
19 changed files with 138 additions and 26 deletions

View File

@@ -147,14 +147,13 @@ class Model_Service extends ORMOSB {
/**
* List services that need to be billed.
*
* @param $days int Additional number of days to add to the query, above the module config.
*/
public function list_invoicesoon() {
// @todo This needs to be configurable
$days = 35;
public function list_invoicesoon($days=0) {
return $this->_list_active()
->where_open()->where('suspend_billing','IS',NULL)->or_where('suspend_billing','=','0')->where_close()
->where('date_next_invoice','<',time()+$days*86400)
->where('date_next_invoice','<',time()+(ORM::factory('invoice')->config('GEN_DAYS')+$days)*86400)
->find_all();
}