Fixed organisaiton listing and editing in backend
This commit is contained in:
parent
2594d826ef
commit
2ef5193e41
4 changed files with 64 additions and 17 deletions
|
@ -51,4 +51,16 @@ __PACKAGE__->has_many(
|
|||
{ cascade_copy => 0, cascade_delete => 0 },
|
||||
);
|
||||
|
||||
sub name {
|
||||
my $self = shift;
|
||||
|
||||
if ( $self->type eq 'customer' ) {
|
||||
return $self->customer->display_name;
|
||||
} elsif ( $self->type eq 'organisation' ) {
|
||||
return $self->organisation->name;
|
||||
} else {
|
||||
return "Unknown Name";
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Reference in a new issue