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-10-14 05:44:12 +00:00
|
|
|
*
|
|
|
|
* Column Definitions:
|
|
|
|
* + price_type: 0=One Time, 1=Recurring, 2=Trial, 3=Extra Item
|
|
|
|
* + item_type: 0=MAIN Service Item,2=?,3=?,4=Connection/Setup,5=Excess Service Item,6=Change Service,126=Payment Fee,127=Late Fee
|
2010-11-29 22:41:08 +00:00
|
|
|
*/
|
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,
|
2012-01-02 01:35:47 +00:00
|
|
|
'setup'=>TRUE,
|
2011-08-27 06:33:46 +00:00
|
|
|
);
|
|
|
|
|
2012-01-02 01:35:47 +00:00
|
|
|
public function action_setup() {
|
|
|
|
$this->setup(array(
|
2012-01-11 23:23:35 +00:00
|
|
|
'EMAIL_INV_MAX'=>_('Email this many invoices in a run (0=no limit)'),
|
2012-01-02 01:35:47 +00:00
|
|
|
'GEN_DAYS'=>_('Generate Invoices this many days in advance of the due date'),
|
2012-01-11 23:23:35 +00:00
|
|
|
'GEN_INV_MAX'=>_('Generate this many invoices in a run (0=no limit)'),
|
2012-01-02 01:35:47 +00:00
|
|
|
'GEN_SOON_DAYS'=>_('Days before GEN_DAYS to list invoices that will be generated'),
|
2012-01-11 23:23:35 +00:00
|
|
|
'DUE_DAYS_MIN'=>_('When invoices are generated, the minimum days in advance the due date should be set to'),
|
|
|
|
'REMIND_DUE'=>_('Days before an invoice due to sent out a reminder'),
|
|
|
|
'REMIND_OVERDUE_1'=>_('Days after an invoice is due to send first reminder'),
|
|
|
|
'REMIND_OVERDUE_2'=>_('Days after an invoice is due to send second reminder'),
|
|
|
|
'REMIND_OVERDUE_3'=>_('Days after an invoice is due to send third and final reminder'),
|
2012-01-02 01:35:47 +00:00
|
|
|
'TAX_ID'=>_('TAX ID shown on invoices'),
|
|
|
|
'TAX_ID_NAME'=>_('TAX ID name shown on invoices'),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2011-08-27 06:33:46 +00:00
|
|
|
/**
|
|
|
|
* Show a list of invoices
|
|
|
|
*/
|
|
|
|
public function action_list() {
|
|
|
|
Block::add(array(
|
|
|
|
'title'=>_('System Customer Invoices'),
|
|
|
|
'body'=>Table::display(
|
2012-11-09 23:13:57 +00:00
|
|
|
ORM::factory('Invoice')->find_all(),
|
2011-08-27 06:33:46 +00:00
|
|
|
25,
|
|
|
|
array(
|
|
|
|
'id'=>array('label'=>'ID','url'=>'user/invoice/view/'),
|
|
|
|
'date_orig'=>array('label'=>'Date'),
|
2011-10-12 22:20:08 +00:00
|
|
|
'total(TRUE)'=>array('label'=>'Total','class'=>'right'),
|
2011-08-27 06:33:46 +00:00
|
|
|
'credit_amt'=>array('label'=>'Credits','class'=>'right'),
|
2011-10-12 22:20:08 +00:00
|
|
|
'payments_total(TRUE)'=>array('label'=>'Payments','class'=>'right'),
|
2011-08-27 06:33:46 +00:00
|
|
|
'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
|
|
|
}
|
|
|
|
?>
|