X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_pay_batch.pm;h=d28085cbd47e1824a9fb3d48efb28709c070e920;hp=e1e32d3d422968adee3ad04b64ba3030a61b63cb;hb=622c72770c971ae44d37dfb59a0f25972051a25a;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe diff --git a/FS/FS/cust_pay_batch.pm b/FS/FS/cust_pay_batch.pm index e1e32d3d4..d28085cbd 100644 --- a/FS/FS/cust_pay_batch.pm +++ b/FS/FS/cust_pay_batch.pm @@ -16,6 +16,9 @@ use FS::cust_bill; # 3 is even more information including possibly sensitive data $DEBUG = 0; +#@encrypted_fields = ('payinfo'); +sub nohistory_fields { ('payinfo'); } + =head1 NAME FS::cust_pay_batch - Object methods for batch cards @@ -127,6 +130,8 @@ and replace methods. sub check { my $self = shift; + my $conf = new FS::Conf; + my $error = $self->ut_numbern('paybatchnum') || $self->ut_numbern('trancode') #deprecated @@ -135,7 +140,9 @@ sub check { || $self->ut_number('custnum') || $self->ut_text('address1') || $self->ut_textn('address2') - || $self->ut_text('city') + || ($conf->exists('cust_main-no_city_in_address') + ? $self->ut_textn('city') + : $self->ut_text('city')) || $self->ut_textn('state') ; @@ -308,15 +315,15 @@ sub approve { my %opt = @_; my $paybatchnum = $new->paybatchnum; my $old = qsearchs('cust_pay_batch', { paybatchnum => $paybatchnum }) - or return "paybatchnum $paybatchnum not found"; + or return "cannot approve, paybatchnum $paybatchnum not found"; # leave these restrictions in place until TD EFT is converted over # to B::BP - return "paybatchnum $paybatchnum already resolved ('".$old->status."')" + return "cannot approve paybatchnum $paybatchnum, already resolved ('".$old->status."')" if $old->status; $new->status('Approved'); my $error = $new->replace($old); if ( $error ) { - return "error updating status of paybatchnum $paybatchnum: $error\n"; + return "error approving paybatchnum $paybatchnum: $error\n"; } my $cust_pay = new FS::cust_pay ( { 'custnum' => $new->custnum, @@ -358,7 +365,7 @@ sub decline { my $paybatchnum = $new->paybatchnum; my $old = qsearchs('cust_pay_batch', { paybatchnum => $paybatchnum }) - or return "paybatchnum $paybatchnum not found"; + or return "cannot decline, paybatchnum $paybatchnum not found"; if ( $old->status ) { # Handle the case where payments are rejected after the batch has been # approved. FS::pay_batch::import_results won't allow results to be @@ -385,14 +392,14 @@ sub decline { } else { # normal case: refuse to do anything - return "paybatchnum $paybatchnum already resolved ('".$old->status."')"; + return "cannot decline paybatchnum $paybatchnum, already resolved ('".$old->status."')"; } } # !$old->status $new->status('Declined'); $new->error_message($reason); my $error = $new->replace($old); if ( $error ) { - return "error updating status of paybatchnum $paybatchnum: $error\n"; + return "error declining paybatchnum $paybatchnum: $error\n"; } my $due_cust_event = $new->cust_main->due_cust_event( 'eventtable' => 'cust_pay_batch',