X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay.pm;h=6156eadeb9b51cccf08dbadeba9e232c170906a6;hb=ddb53fcc9fc80561354b97e4e7803004990138d0;hp=839571a95bcc69f179cf441a8fdc57b7eeb1c162;hpb=b05f4d252a27eab0a6fa8212abf920c0fa24a509;p=freeside.git diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 839571a95..6156eadeb 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -136,6 +136,17 @@ sub insert { } } + if ( $self->paybatch =~ /^webui-/ ) { + my @cust_pay = qsearch('cust_pay', { + 'custnum' => $self->custnum, + 'paybatch' => $self->paybatch, + } ); + if ( scalar(@cust_pay) > 1 ) { + $dbh->rollback if $oldAutoCommit; + return "a payment with webui token ". $self->paybatch. " already exists"; + } + } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; #false laziness w/ cust_credit::insert @@ -348,7 +359,7 @@ sub unapplied { =head1 VERSION -$Id: cust_pay.pm,v 1.16 2002-02-07 22:29:34 ivan Exp $ +$Id: cust_pay.pm,v 1.17 2002-02-10 18:56:49 ivan Exp $ =head1 BUGS