Improvements to invoice display and other misc items
This commit is contained in:
@@ -173,10 +173,12 @@ class Model_Account extends Model_Auth_UserDefault {
|
||||
list($fn,$ln) = explode(' ',$term,2);
|
||||
|
||||
$this->where_open()
|
||||
->where_open()
|
||||
->where('first_name','like','%'.$fn.'%')
|
||||
->and_where('last_name','like','%'.$ln.'%')
|
||||
->where_close()
|
||||
->or_where('company','like','%'.$term.'%');
|
||||
->or_where('company','like','%'.$term.'%')
|
||||
->where_close();
|
||||
|
||||
} elseif (is_numeric($term)) {
|
||||
$this->where('id','like','%'.$term.'%');
|
||||
|
@@ -42,7 +42,10 @@ class Model_Module extends ORM_OSB {
|
||||
* @param $id PK of Model
|
||||
*/
|
||||
public function instance($id=NULL) {
|
||||
return ORM::factory(ucwords($this->name),$id);
|
||||
if (! $this->loaded())
|
||||
throw new Kohana_Exception('Cant call an instance of a model when it is not loaded');
|
||||
|
||||
return ORM::factory(Kohana::classname($this->name),$id);
|
||||
}
|
||||
|
||||
public function list_external() {
|
||||
|
Reference in New Issue
Block a user