This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Deon George 130a87aa9a Major work to domain and hosting
Minor updates for ADSL services
Updates to Sort::MAsort()
Move core OSB items under application/
Moved ACCOUNT functions under application
Minor updates to task
2012-01-12 19:53:55 +11:00

110 lines
3.1 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB Admin Main home page
*
* @package OSB
* @subpackage Page/Home
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_Admin_Welcome extends Controller_TemplateDefault {
protected $auth_required = TRUE;
public $secure_actions = array(
'index'=>TRUE,
);
public function action_index() {
$ao = ORM::factory('account',Auth::instance()->get_user()->id);
$t = time();
// Show outstanding invoices
$o = ORM::factory('invoice');
Block_Sub::add(array(
'title'=>'Invoices Overdue - No Auto Billing',
'body'=>Table::display(
$o->list_overdue_billing($t),
25,
array(
'due_date'=>array('label'=>'Due Date'),
'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
'total_amt'=>array('label'=>'Total','class'=>'right'),
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
),
array('page'=>TRUE)),
'position'=>1,
'order'=>1,
));
Block_Sub::add(array(
'title'=>'Invoices Overdue - Auto Billing',
'body'=>Table::display(
$o->list_overdue_billing($t,TRUE),
25,
array(
'due_date'=>array('label'=>'Due Date'),
'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
'total_amt'=>array('label'=>'Total','class'=>'right'),
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
),
array('page'=>TRUE)),
'position'=>2,
'order'=>1,
));
Block_Sub::add(array(
'title'=>'Invoices Due',
'body'=>Table::display(
$o->list_due(),
25,
array(
'due_date'=>array('label'=>'Due Date'),
'account->name()'=>array('label'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
'total_amt'=>array('label'=>'Total','class'=>'right'),
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
),
array('show_other'=>'due()')),
'position'=>3,
'order'=>1,
));
// Show un-applied payments
$o = ORM::factory('payment');
Block_Sub::add(array(
'title'=>'Unapplied Payments',
'body'=>Table::display(
$o->list_unapplied(),
25,
array(
'date_payment'=>array('label'=>'Pay Date'),
'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>'user/payment/view/'),
'total_amt'=>array('label'=>'Total','class'=>'right'),
'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'),
),
array('show_other'=>'balance()')),
'position'=>1,
'order'=>2,
));
Block::add(array(
'title'=>sprintf('%s: %s %s',$ao->accnum(),$ao->first_name,$ao->last_name),
'subtitle'=>_('Administrator Overview'),
'body'=>(string)Block_Sub::factory(),
));
}
}
?>