Work on invoice

This commit is contained in:
Deon George
2013-02-08 22:41:29 +11:00
parent 69645c4eea
commit 96a13548f1
5 changed files with 140 additions and 47 deletions

View File

@@ -37,6 +37,10 @@ abstract class ORM_OSB extends ORM {
);
}
/**
* Auto process some data as it comes from the database
* @see parent::__get()
*/
public function __get($column) {
if (array_key_exists($column,$this->_table_columns)) {
// If the column is a blob, we'll decode it automatically
@@ -216,14 +220,17 @@ abstract class ORM_OSB extends ORM {
return parent::save($validation);
}
/**
* Function help to find records that are active
*/
public function list_active() {
return $this->_where_active()->find_all();
}
public function list_count($active=TRUE) {
$a=($active ? $this->_where_active() : $this);
$x=($active ? $this->_where_active() : $this);
return $a->find_all()->count();
return $x->find_all()->count();
}
}
?>