Site/Module setup work and auto_format fixes
This commit is contained in:
@@ -525,7 +525,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
Block::add(array(
|
||||
'title'=>_('Services to Invoice'),
|
||||
'body'=>Table::display(
|
||||
ORM::factory('service')->list_invoicesoon(),
|
||||
ORM::factory('service')->list_invoicesoon(ORM::factory('invoice')->config('GEN_SOON_DAYS')),
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>'user/service/view/'),
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user