diff options
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/browse/cust_pay_batch.cgi | 33 | ||||
-rwxr-xr-x | httemplate/browse/pay_batch.cgi | 54 | ||||
-rw-r--r-- | httemplate/docs/schema.html | 4 | ||||
-rwxr-xr-x | httemplate/docs/trouble.html | 26 | ||||
-rw-r--r-- | httemplate/misc/download-batch.cgi | 37 |
5 files changed, 13 insertions, 141 deletions
diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index 98ea2f5a2..c7f0afe76 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -1,24 +1,12 @@ <!-- mason kludge --> -<%= include("/elements/header.html","Credit card batch details", menubar( 'Main Menu' => $p,)) %> - -<% - -die "No batch specified (bad URL)!" unless $cgi->keywords; -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $batchnum = $1; -my $pay_batch = qsearchs('pay_batch',{'batchnum'=>$batchnum}); -die "Batch not found!" unless $pay_batch; - -%> +<%= include("/elements/header.html","Pending credit card batch", menubar( 'Main Menu' => $p,)) %> <FORM ACTION="<%=$p%>misc/download-batch.cgi" METHOD="POST"> Download batch in format <SELECT NAME="format"> <OPTION VALUE="">Default batch mode</OPTION> <OPTION VALUE="csv-td_canada_trust-merchant_pc_batch">CSV file for TD Canada Trust Merchant PC Batch</OPTION> -<OPTION VALUE="PAP">80 byte file for TD Canada Trust PAP Batch</OPTION> -<OPTION VALUE="BoM">Bank of Montreal ECA batch</OPTION> -</SELECT><INPUT TYPE="hidden" NAME="batchnum" VALUE="<%= $batchnum %>"><INPUT TYPE="submit" VALUE="Download"></FORM> +<OPTION VALUE="BoM">Bank of Montreal ECA results</OPTION> +</SELECT><INPUT TYPE="submit" VALUE="Download"></FORM> <BR><BR> <FORM ACTION="<%=$p%>misc/upload-batch.cgi" METHOD="POST" ENCTYPE="multipart/form-data"> @@ -27,28 +15,25 @@ Filename <INPUT TYPE="file" NAME="batch_results"><BR> Format <SELECT NAME="format"> <OPTION VALUE="">Default batch mode</OPTION> <OPTION VALUE="csv-td_canada_trust-merchant_pc_batch">CSV results from TD Canada Trust Merchant PC Batch</OPTION> -<OPTION VALUE="PAP">264 byte results for TD Canada Trust PAP Batch</OPTION> -<OPTION VALUE="BoM">Bank of Montreal ECA results</OPTION> +<OPTION VALUE="BoM">Bank of Montreal ECA batch</OPTION> </SELECT><BR> <INPUT TYPE="submit" VALUE="Upload"></FORM> <BR> <% - my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=". - $batchnum; + my $statement = "SELECT SUM(amount) from cust_pay_batch"; my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement"; $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; my $total = $sth->fetchrow_arrayref->[0]; - my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=". - $batchnum; + my $c_statement = "SELECT COUNT(*) from cust_pay_batch"; my $c_sth = dbh->prepare($c_statement) or die dbh->errstr. "doing $c_statement"; $c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr; my $cards = $c_sth->fetchrow_arrayref->[0]; %> <%= $cards %> credit card payments batched<BR> -$<%= sprintf("%.2f", $total) %> total in batch<BR> +$<%= sprintf("%.2f", $total) %> total in pending batch<BR> <BR> <%= &table() %> @@ -60,12 +45,11 @@ $<%= sprintf("%.2f", $total) %> total in batch<BR> <TH>Card</TH> <TH>Exp</TH> <TH>Amount</TH> - <TH>Status</TH> </TR> <% foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } - qsearch('cust_pay_batch', {'batchnum'=>$batchnum} ) + qsearch('cust_pay_batch', {} ) ) { my $cardnum = $cust_pay_batch->payinfo; #$cardnum =~ s/.{4}$/xxxx/; @@ -87,7 +71,6 @@ foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } <TD><%= $cardnum %></TD> <TD><%= $exp %></TD> <TD align="right">$<%= $cust_pay_batch->amount %></TD> - <TD><%= $cust_pay_batch->status %></TD> </TR> <% } %> diff --git a/httemplate/browse/pay_batch.cgi b/httemplate/browse/pay_batch.cgi deleted file mode 100755 index 66c86d676..000000000 --- a/httemplate/browse/pay_batch.cgi +++ /dev/null @@ -1,54 +0,0 @@ -<!-- mason kludge --> -<%= include("/elements/header.html","Credit card batches", menubar( 'Main Menu' => $p,)) %> - -<BR><BR> - -<% - my %statusmap = ('I'=>'In Transit', 'O'=>'Open', 'R'=>'Resolved'); -%> - -<BR> -<%= &table() %> - <TR> - <TH>Batch</TH> - <TH>First Download</TH> - <TH>Last Upload</TH> - <TH>Item Count</TH> - <TH>Amount</TH> - <TH>Status</TH> - </TR> - -<% -foreach my $pay_batch ( sort { $b->batchnum <=> $a->batchnum } - qsearch('pay_batch', {} ) -) { - - my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=" . - $pay_batch->batchnum; - my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - my $total = $sth->fetchrow_arrayref->[0]; - - my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=" . - $pay_batch->batchnum; - my $c_sth = dbh->prepare($c_statement) - or die dbh->errstr. "doing $c_statement"; - $c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr; - my $cards = $c_sth->fetchrow_arrayref->[0]; - -%> - - <TR> - <TD><A HREF="cust_pay_batch.cgi?<%= $pay_batch->batchnum %>"><%= $pay_batch->batchnum %></TD> - <TD><%= $pay_batch->download ? time2str("%a %b %e %T %Y", $pay_batch->download) : '' %></TD> - <TD><%= $pay_batch->upload ? time2str("%a %b %e %T %Y", $pay_batch->upload) : '' %></TD> - <TD><%= $cards %></TD> - <TD align="right"><%= $total %></TD> - <TD><%= $statusmap{$pay_batch->status} %></TD> - </TR> - -<% } %> - - </TABLE> - </BODY> -</HTML> diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html index cd4914a6c..d9e35efc7 100644 --- a/httemplate/docs/schema.html +++ b/httemplate/docs/schema.html @@ -203,14 +203,11 @@ <ul> <li>batchnum <li>status - <li>download - <li>upload </ul> <li><a name="cust_pay_batch" href="man/FS/cust_pay_batch.html">cust_pay_batch</a> - Pending batch members <ul> <li>paybatchnum <li>batchnum - <li>payby - CARD, CHEK, LECB, BILL, or COMP <li>payinfo - account number <li>exp - card expiration <li>amount @@ -225,7 +222,6 @@ <li>state <li>zip <li>country - <li>status </ul> <li><a name="cust_pkg" href="man/FS/cust_pkg.html">cust_pkg</a> - Customer billing items <ul> diff --git a/httemplate/docs/trouble.html b/httemplate/docs/trouble.html deleted file mode 100755 index fce743928..000000000 --- a/httemplate/docs/trouble.html +++ /dev/null @@ -1,26 +0,0 @@ -<head> - <title>Troubleshooting</title> -</head> -<body> - <h1>Troubleshooting</h1> - <ul> - <li>When troubleshooting the web interface, helpful information is often in your web server's error log. - <li>If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL. - <li>If you get tons of errors in your web server's error log like this: -<pre> -Ambiguous use of value => resolved to "value" => -at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132. -</pre> - This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile. - <li>If you get errors like this: -<pre> -UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied -at <i>/your/path</i>/site_perl/FS/UID.pm line 26. -BEGIN failed--compilation aborted at -<i>/your/path</i>/edit/process/part_svc.cgi line 15. -</pre> - Then the scripts are not running as the freeside freeside user. See -the <a href="install.html">New Installation</a> section of the documentation. - <li>If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the <a href="http://www.mysql.com/Manual_chapter/manual_Problems.html#Can_not_connect_to_server">MySQL documentation</a>, DBI manpage and the DBD::mysql manpage for details. - </ul> -</body> diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi index 2c6481493..2d6f8a286 100644 --- a/httemplate/misc/download-batch.cgi +++ b/httemplate/misc/download-batch.cgi @@ -5,13 +5,6 @@ my $conf=new FS::Conf; #http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes http_header('Content-Type' => 'text/plain' ); -my $batchnum; -if ( $cgi->param('batchnum') =~ /^(\d+)$/ ) { - $batchnum = $1; -} else { - die "No batch number (bad URL) \n"; -} - my $format; if ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) { $format = $1; @@ -23,12 +16,11 @@ my $oldAutoCommit = $FS::UID::AutoCommit; local $FS::UID::AutoCommit = 0; my $dbh = dbh; -my $pay_batch = qsearchs('pay_batch', {'batchnum'=>$batchnum, 'status'=>'O'} ); +my $pay_batch = qsearchs('pay_batch', {'status'=>''} ); die "No pending batch. \n" unless $pay_batch; my %batchhash = $pay_batch->hash; $batchhash{'status'} = 'I'; -$batchhash{'download'} = time unless $batchhash{'download'}; my $new = new FS::pay_batch \%batchhash; my $error = $new->replace($pay_batch); die "error updating batch status: $error\n" if $error; @@ -36,10 +28,8 @@ die "error updating batch status: $error\n" if $error; my $batchtotal=0; my $batchcount=0; -my (@date)=localtime($new->download); -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 (@date)=localtime(); +my $jdate = sprintf("%03d", $date[5] % 100).sprintf("%03d", $date[7]); if ($format eq "BoM") { @@ -49,14 +39,6 @@ if ($format eq "BoM") { sprintf( "XD%03u%06u%-15s%-30s%09u%-12s \n",$typecode,$jdate,$shortname,$longname,$mybank,$myacct ) %><% -}elsif ($format eq "PAP"){ - - my($origid,$datacenter,$typecode,$shortname,$longname,$mybank,$myacct) = - $conf->config("batchconfig-$format"); - %><%= sprintf( "H%10sD%3s%06u%-15s%09u%-12s%04u%19s\n",$origid,$typecode,$cdate,$shortname,$mybank,$myacct,$pay_batch->batchnum,"") - - %><% - }elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){ # 1; }else{ @@ -79,12 +61,7 @@ for my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } if ($format eq "BoM") { my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo ); - %><%= sprintf( "D%010.0f%09u%-12s%-29s%-19s\n",$cust_pay_batch->amount*100,$aba,$account,$cust_pay_batch->payname,$cust_pay_batch->paybatchnum) %><% - - } elsif ($format eq "PAP"){ - - my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo ); - %><%= sprintf( "D%-23s%06u%-19s%09u%-12s%010.0f\n",$cust_pay_batch->payname,$cdate,$cust_pay_batch->paybatchnum,$aba,$account,$cust_pay_batch->amount*100) %><% + %><%= sprintf( "D%010u%09u%-12s%-29s%-19s\n",$cust_pay_batch->amount*100,$aba,$account,$cust_pay_batch->payname,$cust_pay_batch->invnum %><% } elsif ($format eq "csv-td_canada_trust-merchant_pc_batch") { @@ -98,13 +75,9 @@ for my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } if ($format eq "BoM") { - %><%= sprintf( "YD%08u%014.0f%56s\n",$batchcount,$batchtotal*100,"" ). + %><%= sprintf( "YD%08u%014u%56s\n",$batchcount,$batchtotal*100,"" ). sprintf( "Z%014u%05u%014u%05u%41s\n",$batchtotal*100,$batchcount,"0","0","" ) %><% -} elsif ($format eq "PAP"){ - - %><%= sprintf( "T%08u%014.0f%57s\n",$batchcount,$batchtotal*100,"" ) %><% - } elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){ #1; } else { |