Added invoice reminder details and other misc fixes
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Task_Adsl_Trafficcharge extends Task_Adsl_Trafficget {
|
||||
protected $_options = array(
|
||||
'verbose'=>FALSE,
|
||||
);
|
||||
|
||||
protected function _execute(array $params) {
|
||||
foreach ($this->_traffic_suppliers(TRUE) as $aso) {
|
||||
if ($params['verbose'])
|
||||
|
@@ -26,5 +26,9 @@ class Model_Email_Template extends ORM_OSB {
|
||||
array('StaticList_YesNo::get',array(':value')),
|
||||
),
|
||||
);
|
||||
|
||||
public function name() {
|
||||
return ! is_null($this->description) ? $this->description : $this->name;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -121,6 +121,27 @@ class Model_Invoice extends ORM_OSB implements Cartable {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array of Email Template Objects
|
||||
*/
|
||||
public function reminders($key=NULL,$format=FALSE) {
|
||||
$prefix = 'task_invoice_';
|
||||
|
||||
if (is_null($key)) {
|
||||
$result = array();
|
||||
|
||||
foreach ($this->reminders as $k=>$v)
|
||||
array_push($result,ORM::factory('Email_Template',array('name'=>$prefix.$k)));
|
||||
|
||||
return $result;
|
||||
|
||||
} else {
|
||||
$key = preg_replace("/^$prefix/",'',$key);
|
||||
|
||||
return isset($this->reminders[$key]) ? ($format ? Config::date($this->reminders[$key]) : $this->reminders[$key]) : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the service items on an invoice relating to an invoice_item
|
||||
* IE: item_type == 0
|
||||
|
@@ -53,6 +53,15 @@
|
||||
<div class="row">
|
||||
<div class="span11">
|
||||
<div class="span5">
|
||||
<div class="row">
|
||||
<h5>Reminder Details</h5>
|
||||
<div class="dl-horizontal pull-left">
|
||||
<?php foreach ($o->reminders() as $eto) : ?>
|
||||
<dt><?php echo $o->reminders($eto->name,TRUE); ?></dt>
|
||||
<dd><?php echo $eto->name(); ?></dd>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /span -->
|
||||
|
||||
<div class="span5">
|
||||
|
Reference in New Issue
Block a user