X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2Fcust_credit.pm;h=b9a05832b8c403554731f4923628f2cc25e12a5b;hb=1e3eae905b861761f93643aa5fce14a8be5d9ed2;hp=321c01b3401d87a1ad059d46b7d30f62e4a15e61;hpb=1f2d8690193476319d61b20b78461eb1a3ff106e;p=freeside.git diff --git a/site_perl/cust_credit.pm b/site_perl/cust_credit.pm index 321c01b34..b9a05832b 100644 --- a/site_perl/cust_credit.pm +++ b/site_perl/cust_credit.pm @@ -77,7 +77,12 @@ automatically set to amount). sub insert { my $self = shift; - $self->credited($self->amount) if $self->credited eq ''; + my $error; + return $error if $error = $self->ut_money('credited') + || $self->ut_money('amount'); + + $self->credited($self->amount) if $self->credited == 0 + || $self->credited eq ''; return "credited != amount!" unless $self->credited == $self->amount; @@ -107,9 +112,10 @@ inserting a refund (see L). sub replace { my ( $new, $old ) = ( shift, shift ); - return "Can't change custnum!" unless $old->custnum eq $new->custnum; - return "Can't change date!" unless $old->_date eq $new->_date; - return "Can't change amount!" unless $old->amount eq $new->amount; + return "Can't change custnum!" unless $old->custnum == $new->custnum; + #return "Can't change date!" unless $old->_date eq $new->_date; + return "Can't change date!" unless $old->_date == $new->_date; + return "Can't change amount!" unless $old->amount == $new->amount; return "(New) credited can't be > (new) amount!" if $new->credited > $new->amount; @@ -151,7 +157,7 @@ sub check { =head1 VERSION -$Id: cust_credit.pm,v 1.2 1998-12-29 11:59:38 ivan Exp $ +$Id: cust_credit.pm,v 1.4 1999-01-25 12:26:08 ivan Exp $ =head1 BUGS @@ -169,7 +175,13 @@ ivan@sisd.com 98-mar-17 pod, otaker from FS::UID ivan@sisd.com 98-sep-21 $Log: cust_credit.pm,v $ -Revision 1.2 1998-12-29 11:59:38 ivan +Revision 1.4 1999-01-25 12:26:08 ivan +yet more mod_perl stuff + +Revision 1.3 1999/01/18 21:58:04 ivan +esthetic: eq and ne were used in a few places instead of == and != + +Revision 1.2 1998/12/29 11:59:38 ivan mostly properly OO, some work still to be done with svc_ stuff