Fixes from live website

This commit is contained in:
Deon George
2013-04-20 11:40:44 +10:00
parent 13982be9f6
commit 79c76995b9
22 changed files with 283 additions and 55 deletions

View File

@@ -105,6 +105,7 @@ class Controller_Admin_Welcome extends Controller_Welcome {
));
// We are a site administrator
$output = '';
if ($this->ao->rtm_id == NULL) {
$rtmo = ORM::factory('RTM',array('account_id','=',$this->ao->id))->find();
@@ -116,7 +117,7 @@ class Controller_Admin_Welcome extends Controller_Welcome {
->set('o',$rtmo);
} else {
$rtmo = ORM::factory('RTM',$this->ao->rmt_id);
$rtmo = ORM::factory('RTM',$this->ao->rtm_id);
}
if ($output)

View File

@@ -10,14 +10,5 @@
* @license http://dev.osbill.net/license.html
*/
class Controller_TemplateDefault_User extends Controller_TemplateDefault {
public function after() {
SystemMessage::add(array(
'title'=>'Retire this class extension',
'type'=>'info',
'body'=>__METHOD__,
));
return parent::after();
}
}
?>

View File

@@ -36,7 +36,7 @@ class Model_RTM extends ORM_OSB {
}
public function customers_direct() {
return $this->customer->where_active()->find_all();
return $this->customer->find_all();
}
}
?>

View File

@@ -0,0 +1,33 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Mark all accounts that have no outstanding invoices and active services as disabled.
*
* @package Account
* @category Tasks
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_Account_Complete extends Task {
protected function _execute(array $params) {
$c = 0;
$o = ORM::factory('Account')
->where_active();
foreach ($o->find_all() as $ao) {
if (count($ao->invoice->where_unprocessed()->find_all()) == 0 AND count($ao->service->where_active()->find_all()) == 0)
// @todo Cant update status=0, problem with sessions in CLI
echo $ao->id.',';
$ao->save();
if ($ao->saved())
$c++;
}
printf('%s services updated',$c);
}
}
?>