X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main_invoice.pm;h=71148cab003973c551753c978027ee2bda86bb9e;hb=0e3d27730f91e10abb8f655d578eb0fd51b82cd1;hp=71029d0968dba248591a4ac66cd21fa3109e33f7;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/FS/FS/cust_main_invoice.pm b/FS/FS/cust_main_invoice.pm index 71029d096..71148cab0 100644 --- a/FS/FS/cust_main_invoice.pm +++ b/FS/FS/cust_main_invoice.pm @@ -132,7 +132,7 @@ sub checkdest { } elsif ( $self->dest =~ /^(\d+)$/ ) { return "Unknown local account (specified by svcnum: ". $self->dest. ")" unless qsearchs( 'svc_acct', { 'svcnum' => $self->dest } ); - } elsif ( $self->dest =~ /^([\w\.\-\&\+]+)\@(([\w\.\-]+\.)+\w+)$/ ) { + } elsif ( $self->dest =~ /^\s*([\w\.\-\&\+]+)\@(([\w\.\-]+\.)+\w+)\s*$/ ) { my($user, $domain) = ($1, $2); $self->dest("$1\@$2"); } else { @@ -159,6 +159,17 @@ sub address { } } +=item cust_main + +Returns the parent customer object (see L). + +=cut + +sub cust_main { + my $self = shift; + qsearchs( 'cust_main', { 'custnum' => $self->custnum } ); +} + =back =head1 BUGS