Fixed organisaiton listing and editing in backend

This commit is contained in:
Tom Bloor 2017-09-04 14:03:58 +01:00
parent 2594d826ef
commit 2ef5193e41
4 changed files with 64 additions and 17 deletions

View file

@ -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;