X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main_Mixin.pm;h=86751b1cbc9c7bc0b7c9f5049cb43774fdae8b75;hb=87ddf7284561e5c912aefe2ecc3f348649b78183;hp=ced0a1f55827ee3b25799177e8309f290e5fcdb4;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm index ced0a1f55..86751b1cb 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 method, or "(unlinked)" if this object is not linked to +a customer. + +=cut sub name { my $self = shift;