Remove remaining calls to idiot/eidiot. Should fix 1479
[freeside.git] / httemplate / misc / bill.cgi
1 %
2 %#untaint custnum
3 %my($query) = $cgi->keywords;
4 %$query =~ /^(\d*)$/;
5 %my $custnum = $1;
6 %my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
7 %die "Can't find customer!\n" unless $cust_main;
8 %
9 %my $conf = new FS::Conf;
10 %
11 %my $error = $cust_main->bill(
12 %#                          'time'=>$time
13 %                         );
14 %
15 %unless ( $error ) {
16 %  $error = $cust_main->apply_payments_and_credits
17 %           || $cust_main->collect(
18 %                                  #'invoice-time'=>$time,
19 %                                  #'batch_card'=> 'yes',
20 %                                  #'batch_card'=> 'no',
21 %                                  #'report_badcard'=> 'yes',
22 %                                  #'retry_card' => 'yes',
23 %
24 %                                  'retry' => 'yes',
25 %                                   
26 %                                  #this is used only by cust_main::batch_card
27 %                                  #need to pick & create an actual config
28 %                                  #value if we're going to turn this on
29 %                                  #("realtime-backend" doesn't exist,
30 %                                  # "backend-realtime" is for something
31 %                                  #  entirely different)
32 %                                  #'realtime' => $conf->exists('realtime-backend'),
33 %                                 );
34 %}
35 %
36 %if ( $error ) {
37 %
38
39 <!-- mason kludge -->
40 %
41 %  errorpage($error);
42 %} else {
43 %  print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum");
44 %}
45 %