RT#7132: bulk increment package bill dates
[freeside.git] / httemplate / misc / bill.cgi
1 %if ( $error ) {
2 %  errorpage($error);
3 %} else {
4 <% $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum") %>
5 %}
6 <%init>
7
8 die "access denied"
9   unless $FS::CurrentUser::CurrentUser->access_right('Bill customer now');
10
11 #untaint custnum
12 my($query) = $cgi->keywords;
13 $query =~ /^(\d*)$/;
14 my $custnum = $1;
15 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
16 die "Can't find customer!\n" unless $cust_main;
17
18 my $conf = new FS::Conf;
19
20 my $error = $cust_main->bill_and_collect( 'fatal' => 'return',
21                                           'retry' => 'yes',
22                                         );
23
24                                   #'invoice-time'=>$time,
25                                   #'batch_card'=> 'yes',
26                                   #'batch_card'=> 'no',
27                                   #'report_badcard'=> 'yes',
28                                   #'retry_card' => 'yes',
29
30                                   #this is used only by cust_main::batch_card
31                                   #need to pick & create an actual config
32                                   #value if we're going to turn this on
33                                   #("realtime-backend" doesn't exist,
34                                   # "backend-realtime" is for something
35                                   #  entirely different)
36                                   #'realtime' => $conf->exists('realtime-backend'),
37
38 </%init>