diff options
| author | ivan <ivan> | 2007-07-11 08:08:30 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2007-07-11 08:08:30 +0000 | 
| commit | 6311c531a52916458cba1fe0218f5a4e3fd1985d (patch) | |
| tree | 1365fde60bd0a9153f82664993b3e966cdcfefc7 /FS | |
| parent | d549dfc1e276be35b1903f112c8334ccb7105e8e (diff) | |
finish adding payunique field
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/cust_pay.pm | 20 | 
1 files changed, 7 insertions, 13 deletions
| diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 0ead22658..23bcdd93a 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -69,7 +69,9 @@ L<Time::Local> and L<Date::Parse> for conversion functions.  =item paymask - Masked payinfo (See L<FS::payinfo_Mixin> for how this works) -=item paybatch - text field for tracking card processing +=item paybatch - text field for tracking card processing or other batch grouping + +=item payunique - Optional unique identifer to prevent duplicate transactions.  =item closed - books closed flag, empty or `Y' @@ -162,17 +164,6 @@ 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 @@ -421,7 +412,10 @@ sub check {    # should give a better error message the other 99.9% of the time...    if ( length($self->payunique)         && qsearchs('cust_pay', { 'payunique' => $self->payunique } ) ) { -    return "duplicate transaction"; #well, it *could* be a better error message +    #well, it *could* be a better error message +    return "duplicate transaction". +           " - a payment with unique identifer ". $self->payunique. +           " already exists";    }    $self->SUPER::check; | 
