diff options
author | ivan <ivan> | 2009-09-15 20:44:00 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-09-15 20:44:00 +0000 |
commit | b6f55ef84f3d57448ec7aa7556457c03b9226c27 (patch) | |
tree | 3c788824d7bb3b24ab64000f59c4b326629900b6 /FS/FS/cust_main_Mixin.pm | |
parent | bbc003b77d2070f53a29a84cccce530f01db691e (diff) |
fix display_custnum on reports, RT#
Diffstat (limited to 'FS/FS/cust_main_Mixin.pm')
-rw-r--r-- | FS/FS/cust_main_Mixin.pm | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm index ced0a1f..86751b1 100644 --- a/FS/FS/cust_main_Mixin.pm +++ b/FS/FS/cust_main_Mixin.pm @@ -26,7 +26,12 @@ for example, from a JOINed search. See httemplate/search/ for examples. =over 4 -=item name +=cut + +sub cust_unlinked_msg { '(unlinked)'; } +sub cust_linked { $_[0]->custnum; } + +=item display_custnum Given an object that contains fields from cust_main (say, from a JOINed search; see httemplate/search/ for examples), returns the equivalent of the @@ -35,8 +40,21 @@ a customer. =cut -sub cust_unlinked_msg { '(unlinked)'; } -sub cust_linked { $_[0]->custnum; } +sub display_custnum { + my $self = shift; + $self->cust_linked + ? FS::cust_main::display_custnum($self) + : $self->cust_unlinked_msg; +} + +=item name + +Given an object that contains fields from cust_main (say, from a JOINed +search; see httemplate/search/ for examples), returns the equivalent of the +FS::cust_main I<name> method, or "(unlinked)" if this object is not linked to +a customer. + +=cut sub name { my $self = shift; |