Open Source Billing
This commit is contained in:
72
modules/invoice/classes/Controller/Admin/Invoice.php
Normal file
72
modules/invoice/classes/Controller/Admin/Invoice.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides invoice capabilities.
|
||||
*
|
||||
* @package Invoice
|
||||
* @category Controllers/Admin
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
class Controller_Admin_Invoice extends Controller_TemplateDefault_Admin {
|
||||
protected $secure_actions = array(
|
||||
'list'=>TRUE,
|
||||
'setup'=>TRUE,
|
||||
);
|
||||
|
||||
public function action_setup() {
|
||||
$this->setup(array(
|
||||
'EMAIL_INV_MAX'=>_('Email this many invoices in a run (0=no limit)'),
|
||||
'GEN_DAYS'=>_('Generate Invoices this many days in advance of the due date'),
|
||||
'GEN_INV_MAX'=>_('Generate this many invoices in a run (0=no limit)'),
|
||||
'GEN_SOON_DAYS'=>_('Days before GEN_DAYS to list invoices that will be generated'),
|
||||
'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'),
|
||||
'TAX_ID'=>_('TAX ID shown on invoices'),
|
||||
'TAX_ID_NAME'=>_('TAX ID name shown on invoices'),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a list of invoices
|
||||
*/
|
||||
public function action_list() {
|
||||
$id = $this->request->param('id');
|
||||
|
||||
$invs = ORM::factory('Invoice');
|
||||
|
||||
if ($id)
|
||||
$invs->where('account_id','=',$id);
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('System Customer Invoices'),
|
||||
'body'=>Table::display(
|
||||
$invs->find_all(),
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>URL::link('user','invoice/view/')),
|
||||
'date_orig'=>array('label'=>'Date'),
|
||||
'total(TRUE)'=>array('label'=>'Total','class'=>'right'),
|
||||
'total_credits(TRUE)'=>array('label'=>'Credits','class'=>'right'),
|
||||
'payments_total(TRUE)'=>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'=>URL::link('user','invoice/view'),
|
||||
)),
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user