Improvements to payment and other misc items

This commit is contained in:
Deon George
2013-06-19 19:26:07 +10:00
parent 1caeed6606
commit 3499776ddc
33 changed files with 569 additions and 530 deletions

View File

@@ -13,6 +13,7 @@ class Model_Account extends Model_Auth_UserDefault {
// Relationships
protected $_has_many = array(
'user_tokens' => array('model' => 'user_token'),
'service_billing' => array('far_key'=>'id'),
'email_log' => array('far_key'=>'id'),
'group' => array('through' => 'account_group'),
'invoice' => array('far_key'=>'id'),
@@ -132,10 +133,7 @@ class Model_Account extends Model_Auth_UserDefault {
* Return an account name
*/
public function name($withcompany=FALSE) {
if ($withcompany)
return sprintf('%s %s%s',$this->first_name,$this->last_name,$this->company ? sprintf(' (%s)',$this->company) : '');
else
return sprintf('%s %s',$this->first_name,$this->last_name);
return trim(sprintf('%s %s',$this->first_name,$this->last_name).(($withcompany AND $this->company) ? sprintf(' (%s)',$this->company) : ''));
}
/**