Will things ever be the same again?
[freeside.git] / httemplate / misc / bill.cgi
1 %
2 %
3 %#untaint custnum
4 %my($query) = $cgi->keywords;
5 %$query =~ /^(\d*)$/;
6 %my $custnum = $1;
7 %my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
8 %die "Can't find customer!\n" unless $cust_main;
9 %
10 %my $error = $cust_main->bill(
11 %#                          'time'=>$time
12 %                         );
13 %#&eidiot($error) if $error;
14 %
15 %unless ( $error ) {
16 %  $cust_main->apply_payments;
17 %  $cust_main->apply_credits;
18 %
19 %  $error = $cust_main->collect(
20 %  #                             'invoice-time'=>$time,
21 %                               #'batch_card'=> 'yes',
22 %                               #'batch_card'=> 'no',
23 %                               #'report_badcard'=> 'yes',
24 %                               #'retry_card' => 'yes',
25 %                               'retry' => 'yes',
26 %                              );
27 %}
28 %#&eidiot($error) if $error;
29 %
30 %if ( $error ) {
31 %
32
33 <!-- mason kludge -->
34 %
35 %  &idiot($error);
36 %} else {
37 %  print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum");
38 %}
39 %
40