X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fdownload-batch.cgi;h=74805b2a80256252852e250f6fe2f78eccba9b42;hb=db690b75431c6bcff432930db1646f316d2e7154;hp=038aa204920ce5bede65285788b565ddd19640ca;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi index 038aa2049..74805b2a8 100644 --- a/httemplate/misc/download-batch.cgi +++ b/httemplate/misc/download-batch.cgi @@ -24,6 +24,10 @@ %my $dbh = dbh; % %my $pay_batch = qsearchs('pay_batch', {'batchnum'=>$batchnum, 'status'=>'O'} ); +%unless ($pay_batch) { +% $pay_batch = qsearchs('pay_batch', {'batchnum'=>$batchnum, 'status'=>'I'} ) +% if $FS::CurrentUser::CurrentUser->access_right('Reprocess batches'); +%} %die "No pending batch. \n" unless $pay_batch; % %my %batchhash = $pay_batch->hash; @@ -40,6 +44,8 @@ %my $jdate = sprintf("%03d", $date[5] % 100).sprintf("%03d", $date[7] + 1); %my $cdate = sprintf("%02d", $date[3]).sprintf("%02d", $date[4] + 1). % sprintf("%02d", $date[5] % 100); +%my $sdate = sprintf("%02d", $date[5] % 100).'/'.sprintf("%02d", $date[4] + 1). +% '/'.sprintf("%02d", $date[3]); % %if ($format eq "BoM") { % @@ -63,6 +69,12 @@ % %}elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){ %# 1; +%}elsif ($format eq "csv-chase_canada-E-xactBatch"){ +% +% my($origid) = $conf->config("batchconfig-$format"); +<% sprintf( '$$E-xactBatchFileV1.0$$%s:%03u$$%s',$sdate,$pay_batch->batchnum, $origid) + %> +% %}else{ % die "Unknown format for batch in batchconfig. \n"; %} @@ -75,7 +87,13 @@ % % $cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; % my( $mon, $y ) = ( $2, $1 ); -% $mon = "0$mon" if $mon < 10; +% if ( $conf->exists('batch-increment_expiration') ) { +% my( $curmon, $curyear ) = (localtime(time))[4,5]; +% $curmon++; $curyear-=100; +% $y++ while $y < $curyear || ( $y == $curyear && $mon < $curmon ); +% } +% $mon = "0$mon" if $mon =~ /^\d$/; +% $y = "0$y" if $y =~ /^\d$/; % my $exp = "$mon$y"; % $batchcount++; % $batchtotal += $cust_pay_batch->amount; @@ -100,6 +118,12 @@ ,,,,<% $cust_pay_batch->payinfo %>,<% $exp %>,<% $cust_pay_batch->amount %>,<% $cust_pay_batch->paybatchnum %> % % +% } elsif ($format eq "csv-chase_canada-E-xactBatch"){ +% +% +<% $cust_pay_batch->paybatchnum %>,<% $cust_pay_batch->custnum %>,<% $cust_pay_batch->invnum %>,"<% $cust_pay_batch->payname %>",01,<% $cust_pay_batch->payinfo %>,<% $cust_pay_batch->amount %>,<% $exp %>,, +% +% % } else { % die "I'm already dead, but you did not know that.\n"; % } @@ -121,6 +145,8 @@ % %} elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){ % #1; +%} elsif ($format eq "csv-chase_canada-E-xactBatch"){ +% #1; %} else { % die "I'm already dead (again), but you did not know that.\n"; %}