Optimised Company() Setup() Config() and changed method_directory into URL

This commit is contained in:
Deon George
2013-02-12 22:14:59 +11:00
parent 97d894d472
commit 288d974cfa
63 changed files with 422 additions and 346 deletions

View File

@@ -46,7 +46,7 @@ class Model_Account extends Model_Auth_UserDefault {
}
public function accnum() {
return sprintf('%s-%04s',Config::siteid(TRUE),$this->id);
return sprintf('%s-%04s',Company::instance()->site(TRUE),$this->id);
}
public function sortkey($withcompany=FALSE) {
@@ -115,10 +115,6 @@ class Model_Account extends Model_Auth_UserDefault {
foreach ($this->invoices_due($date) as $io)
$result += $io->due();
// @todo This shouldnt really be required
if ($result < 0)
throw new Kohana_Exception($result);
return $format ? Currency::display($result) : $result;
}