Standardisation work, changed accnum() to refnum()
This commit is contained in:
@@ -10,5 +10,6 @@
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Controller_Invoice extends Controller_TemplateDefault {
|
||||
protected $icon = 'fa fa-pencil-square-o';
|
||||
}
|
||||
?>
|
||||
|
@@ -15,28 +15,12 @@ class Controller_Reseller_Invoice extends Controller_Invoice {
|
||||
);
|
||||
|
||||
public function action_list() {
|
||||
$this->meta->title = 'Customer Invoice List';
|
||||
$this->meta->title = 'R|Customer Invoice List';
|
||||
|
||||
Block::factory()
|
||||
->title('Customer Invoices')
|
||||
->title_icon('fa fa-edit')
|
||||
->body(Table::factory()
|
||||
->jssort('invoices')
|
||||
->data(ORM::factory('Invoice')->where_authorised($this->ao)->where_active()->find_all())
|
||||
->page_items(25)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_orig'=>'Date Created',
|
||||
'due_date'=>'Date Due',
|
||||
'total(TRUE)'=>'Total',
|
||||
'due(TRUE)'=>'Due',
|
||||
'account->accnum()'=>'Cust ID',
|
||||
'account->name()'=>'Customer',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
))
|
||||
);
|
||||
->title_icon($this->icon)
|
||||
->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->where_authorised($this->ao)->where_active()->find_all()));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -76,24 +76,9 @@ class Controller_User_Invoice extends Controller_Invoice {
|
||||
$this->meta->title = 'Invoice List';
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf('Invoices for Account: %s',$this->ao->accnum()))
|
||||
->title_icon('fa fa-list')
|
||||
->body(Table::factory()
|
||||
->jssort('invoices')
|
||||
->data($this->ao->invoice->find_all())
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_orig'=>'Date Issued',
|
||||
'due_date'=>'Date Due',
|
||||
'total(TRUE)'=>'Total',
|
||||
'total_credits(TRUE)'=>'Credits',
|
||||
'payments_total(TRUE)'=>'Payments',
|
||||
'due(TRUE)'=>'Still Due',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
))
|
||||
);
|
||||
->title(sprintf('Invoices for Account: %s',$this->ao->refnum()))
|
||||
->title_icon($this->icon)
|
||||
->body(View::factory('invoice/user/list')->set('o',$this->ao->invoice->find_all()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -80,7 +80,7 @@ class Invoice_TCPDF_Default extends Invoice_Tcpdf {
|
||||
$this->SetFont('helvetica','',10);
|
||||
$this->SetXY($x,$y); $this->Cell(0,0,_('Account Number'));
|
||||
$this->SetFont('helvetica','B',11);
|
||||
$this->SetXY($x,$y); $this->Cell(0,0,$this->io->account->accnum(),0,0,'R');
|
||||
$this->SetXY($x,$y); $this->Cell(0,0,$this->io->account->refnum(),0,0,'R');
|
||||
|
||||
// Invoice number
|
||||
$y = 210;
|
||||
|
@@ -52,7 +52,16 @@ class Model_Invoice extends ORM_OSB implements Cartable {
|
||||
|
||||
private $_render = array();
|
||||
|
||||
// Our required Interface Methods
|
||||
/** REQUIRED ABSTRACT METHODS **/
|
||||
/**
|
||||
* Display the Invoice Reference Number
|
||||
*/
|
||||
public function refnum($short=FALSE) {
|
||||
return ($short ? '' : $this->account->refnum(FALSE).'-').sprintf('%06s',$this->id);
|
||||
}
|
||||
|
||||
|
||||
/** REQUIRED INTERFACE METHODS **/
|
||||
|
||||
public function cart_item() {
|
||||
return new Cart_Item(1,sprintf('Invoice: %s',$this->refnum()),$this->due());
|
||||
@@ -221,13 +230,6 @@ class Model_Invoice extends ORM_OSB implements Cartable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the Invoice Reference Number
|
||||
*/
|
||||
public function refnum() {
|
||||
return sprintf('%s-%06s',$this->account->accnum(),$this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the reminder value
|
||||
*/
|
||||
|
16
modules/invoice/views/invoice/list.php
Normal file
16
modules/invoice/views/invoice/list.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<!-- o = Array of Model_Invoice -->
|
||||
<?php echo Table::factory()
|
||||
->data($o)
|
||||
->page_items(25)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'due_date'=>'Due',
|
||||
'account->refnum()'=>'Num',
|
||||
'account->name()'=>'Account',
|
||||
'total(TRUE)'=>'Total',
|
||||
'due(TRUE)'=>'Due',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
));
|
||||
?>
|
17
modules/invoice/views/invoice/user/list.php
Normal file
17
modules/invoice/views/invoice/user/list.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<!-- o = Array of Model_Invoice -->
|
||||
<?php echo Table::factory()
|
||||
->page_items(25)
|
||||
->data($o)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_orig'=>'Date Issued',
|
||||
'due_date'=>'Date Due',
|
||||
'total(TRUE)'=>'Total',
|
||||
'total_credits(TRUE)'=>'Credits',
|
||||
'payments_total(TRUE)'=>'Payments',
|
||||
'due(TRUE)'=>'Still Due',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
));
|
||||
?>
|
@@ -1,18 +1,13 @@
|
||||
<!-- o = Model Account -->
|
||||
<?php echo Block::factory()
|
||||
->title(sprintf('Invoices Due Account: %s (%s)',$o->accnum(),$o->invoice->list_due_total(TRUE)))
|
||||
->title_icon('fa fa-money')
|
||||
->span(6)
|
||||
->body(Table::factory()
|
||||
->data($o->invoice->list_due())
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'due_date'=>'Date Due',
|
||||
'total(TRUE)'=>'Invoice Total',
|
||||
'due(TRUE)'=>'Amount Due',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
))
|
||||
);
|
||||
<!-- o = Array of Model_Invoice -->
|
||||
<?php echo Table::factory()
|
||||
->data($o)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'due_date'=>'Date Due',
|
||||
'total(TRUE)'=>'Invoice Total',
|
||||
'due(TRUE)'=>'Amount Due',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
));
|
||||
?>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
$i->add_service($io);
|
||||
|
||||
echo Block::factory()
|
||||
->title(sprintf('Next Invoice Items for Account: %s',$o->accnum()))
|
||||
->title(sprintf('Next Invoice Items for Account: %s',$o->refnum()))
|
||||
->title_icon('fa fa-shopping-cart')
|
||||
->span(6)
|
||||
->body($i->render('html','body',array('noid'=>TRUE)));
|
||||
|
Reference in New Issue
Block a user