Added invoice reminder details and other misc fixes
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user