%
my $conf = new FS::Conf;
my($link, $linknum, $paid, $payby, $payinfo, $quickpay, $_date);
if ( $cgi->param('error') ) {
$link = $cgi->param('link');
$linknum = $cgi->param('linknum');
$paid = $cgi->param('paid');
$payby = $cgi->param('payby');
$payinfo = $cgi->param('payinfo');
$quickpay = $cgi->param('quickpay');
$_date = $cgi->param('_date') ? str2time($cgi->param('_date')) : time;
} elsif ($cgi->keywords) {
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
$link = 'invnum';
$linknum = $1;
$paid = '';
$payby = 'BILL';
$payinfo = "";
$quickpay = '';
$_date = time;
} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
$link = 'custnum';
$linknum = $1;
$paid = '';
$payby = 'BILL';
$payinfo = '';
$quickpay = $cgi->param('quickpay');
$_date = time;
} else {
die "illegal query ". $cgi->keywords;
}
my $paybatch = "webui-$_date-$$-". rand() * 2**32;
%>
<%= header("Post payment", '') %>
<% if ( $cgi->param('error') ) { %>
Error: <%= $cgi->param('error') %>
<% } %>
<%= ntable("#cccccc",2) %>