X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2Fcust_main_invoice.pm;h=2823294c18f648b82b92f04d494bab37c7184ee3;hb=f892887626d5d6288e455768d24b5bcaff646123;hp=61edae961fa79f6ddae5420303d7fc23518746f1;hpb=c93520accf00e15095e7af5fcb59caed2bd9e556;p=freeside.git diff --git a/site_perl/cust_main_invoice.pm b/site_perl/cust_main_invoice.pm index 61edae961..2823294c1 100644 --- a/site_perl/cust_main_invoice.pm +++ b/site_perl/cust_main_invoice.pm @@ -86,7 +86,7 @@ returns the error, otherwise returns false. sub replace { my ( $new, $old ) = ( shift, shift ); - return "Can't change custnum!" unless $old->custnum eq $new->custnum; + return "Can't change custnum!" unless $old->custnum == $new->custnum; $new->SUPER::replace; } @@ -105,13 +105,28 @@ sub check { my $error = $self->ut_numbern('destnum') || $self->ut_number('custnum') - || $self->ut_text('dest') + || $self->checkdest; ; return $error if $error; return "Unknown customer" unless qsearchs('cust_main',{ 'custnum' => $self->custnum }); + ''; #noerror +} + +=item checkdest + +Checks the dest field only. + +=cut + +sub checkdest { + my $self = shift; + + my $error = $self->ut_text('dest'); + return $error if $error; + if ( $self->dest eq 'POST' ) { #contemplate our navel } elsif ( $self->dest =~ /^(\d+)$/ ) { @@ -152,7 +167,7 @@ sub address { =head1 VERSION -$Id: cust_main_invoice.pm,v 1.4 1999-01-18 09:22:42 ivan Exp $ +$Id: cust_main_invoice.pm,v 1.6 1999-01-25 12:26:10 ivan Exp $ =head1 BUGS @@ -168,7 +183,13 @@ added hfields ivan@sisd.com 97-nov-13 $Log: cust_main_invoice.pm,v $ -Revision 1.4 1999-01-18 09:22:42 ivan +Revision 1.6 1999-01-25 12:26:10 ivan +yet more mod_perl stuff + +Revision 1.5 1999/01/18 21:58:05 ivan +esthetic: eq and ne were used in a few places instead of == and != + +Revision 1.4 1999/01/18 09:22:42 ivan changes to track email addresses for email invoicing Revision 1.3 1998/12/29 11:59:42 ivan