2010-11-29 22:41:08 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class provides invoice capabilities.
|
|
|
|
*
|
|
|
|
* @package OSB
|
|
|
|
* @subpackage Invoice
|
|
|
|
* @category Controllers/Admin
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 Open Source Billing
|
|
|
|
* @license http://dev.osbill.net/license.html
|
|
|
|
*/
|
2011-08-26 01:16:48 +00:00
|
|
|
class Controller_Admin_Invoice extends Controller_TemplateDefault_Admin {
|
2011-08-27 06:33:46 +00:00
|
|
|
protected $secure_actions = array(
|
|
|
|
'list'=>TRUE,
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show a list of invoices
|
|
|
|
*/
|
|
|
|
public function action_list() {
|
|
|
|
$io = ORM::factory('invoice');
|
|
|
|
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('System Customer Invoices'),
|
|
|
|
'body'=>Table::display(
|
|
|
|
$io->find_all(),
|
|
|
|
25,
|
|
|
|
array(
|
|
|
|
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
|
|
|
|
'date_orig'=>array('label'=>'Date'),
|
|
|
|
'total_amt'=>array('label'=>'Total','class'=>'right'),
|
|
|
|
'credit_amt'=>array('label'=>'Credits','class'=>'right'),
|
|
|
|
'billed_amt'=>array('label'=>'Payments','class'=>'right'),
|
|
|
|
'due(TRUE)'=>array('label'=>'Still Due','class'=>'right'),
|
|
|
|
'account->accnum()'=>array('label'=>'Cust ID'),
|
|
|
|
'account->name()'=>array('label'=>'Customer'),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'page'=>TRUE,
|
|
|
|
'type'=>'select',
|
|
|
|
'form'=>'user/invoice/view',
|
|
|
|
)),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2010-11-29 22:41:08 +00:00
|
|
|
public function action_convert() {
|
|
|
|
if (Config::sitemode() != KOHANA::DEVELOPMENT)
|
|
|
|
throw new Kohana_Exception(__METHOD__.' can only be run in development');
|
|
|
|
else
|
|
|
|
throw new Kohana_Exception(__METHOD__.' can be run in development');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|