General tidying up
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Controller_Admin_Invoice extends Controller_TemplateDefault {
|
||||
class Controller_Admin_Invoice extends Controller_TemplateDefault_Admin {
|
||||
public function action_convert() {
|
||||
if (Config::sitemode() != KOHANA::DEVELOPMENT)
|
||||
throw new Kohana_Exception(__METHOD__.' can only be run in development');
|
||||
|
@@ -10,8 +10,8 @@
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Controller_User_Invoice extends Controller_TemplateDefault {
|
||||
public $secure_actions = array(
|
||||
class Controller_User_Invoice extends Controller_TemplateDefault_User {
|
||||
protected $secure_actions = array(
|
||||
'download'=>TRUE,
|
||||
'list'=>TRUE,
|
||||
'view'=>TRUE,
|
||||
@@ -21,16 +21,10 @@ class Controller_User_Invoice extends Controller_TemplateDefault {
|
||||
* Show a product
|
||||
*/
|
||||
public function action_list() {
|
||||
$id = Auth::instance()->get_user()->id;
|
||||
$ao = ORM::factory('account',$id);
|
||||
|
||||
if (! $ao->loaded())
|
||||
throw new Kohana_Exception('Account doesnt exist :account ?',array(':account'=>$id));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s: %s - %s',_('Invoices For'),$ao->accnum(),$ao->name(TRUE)),
|
||||
'title'=>sprintf('%s: %s - %s',_('Invoices For'),$this->ao->accnum(),$this->ao->name(TRUE)),
|
||||
'body'=>View::factory('invoice/user/list')
|
||||
->set('invoices',$ao->invoice->find_all()),
|
||||
->set('invoices',$this->ao->invoice->find_all()),
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -125,7 +125,7 @@ SELECT i.id AS iid,i.due_date AS due FROM ab_invoice i,ab_invoice_item ii WHERE
|
||||
$pdf->drawRemittenceStub();
|
||||
$pdf->drawPaymentMethods();
|
||||
|
||||
if ($this->io->billing_status !=1 && $this->io->suspend_billing != 1 && $this->io->due_date <= time())
|
||||
if ($this->io->billing_status !=1 && $this->io->due_date <= time())
|
||||
$pdf->drawInvoiceDueNotice();
|
||||
elseif($this->io->billing_status == 1)
|
||||
$pdf->drawInvoicePaidNotice();
|
||||
|
Reference in New Issue
Block a user