wtf?
[freeside.git] / httemplate / edit / process / quick-charge.cgi
index f614dd5..4a090f9 100644 (file)
@@ -4,9 +4,9 @@
 %
 %  my @description = ();
 %  for ( my $row = 0; exists($param->{"description$row"}); $row++ ) {
-%    push @description, $param->{"description$row"};
+%    push @description, $param->{"description$row"}
+%      if ($param->{"description$row"} =~ /\S/);
 %  }
-%  pop @description until ($description[$#description]);
 %
 %  $param->{"custnum"} =~ /^(\d+)$/
 %    or $error .= "Illegal customer number " . $param->{"custnum"} . "  ";
 %    my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
 %      or $error .= "Unknown customer number $custnum.  ";
 %
-%    $error ||= $cust_main->charge({ 'amount'   => $amount,
-%                                   'pkg'      => $cgi->param('pkg'),
-%                                   'taxclass' => $cgi->param('taxclass'),
-%                                   'additional' => \@description,
-%                                 }
-%                               );
+%    $error ||= $cust_main->charge( {
+%      'amount'     => $amount,
+%      'pkg'        => scalar($cgi->param('pkg')),
+%      'taxclass'   => scalar($cgi->param('taxclass')),
+%      'additional' => \@description,
+%    } );
 %  }
 %
 %  if ( $error ) {
 %
-%    $cgi->param('error', "$error" );
+%    $cgi->param('error', $error );
 %    
 <% $cgi->redirect($p.'quick-charge.html?'. $cgi->query_string) %>
 %
@@ -44,4 +44,3 @@
     window.top.location.reload();
   </SCRIPT>
   </BODY></HTML>
-