3 Clickable link to bill a customer.
6 <% include( '/elements/bill.html',
16 url => $p.'view/cust_main.cgi?'.$custnum,
19 # optional, can contain any FS::cust_main::bill_and_collect options
21 bill_opts => { 'batch_card' => 'yes' },
22 formname => 'MyBillNowLink', # if for some reason you want this
26 <FORM NAME="<%$formname%>" STYLE="display:inline">
27 <% include('/elements/progress-init.html',
29 [ 'custnum', @opt_keys ],
31 $url ? { url => $url } : { message => $message },
32 $formname, # use it as 'key'
34 <A HREF="javascript:void(0);" onclick="javascript:<%$formname%>process();"><%$label%></A>
35 <INPUT TYPE="hidden" NAME="custnum" VALUE="<%$custnum%>">
36 % foreach(@opt_keys) {
37 <INPUT TYPE="hidden" NAME="<%$_%>" VALUE="<%$bill_opts->{$_}%>">
43 my $custnum = $opt{'custnum'};
44 my $label = $opt{'label'};
45 # formname no longer needs to be passed from outside, but we still
46 # need one and it needs to be unique
47 my $formname = $opt{'formname'} ||
48 'bill'.sprintf('%04d',random_id(4)).$custnum;
49 my $url = $opt{'url'} || '';
50 my $message = $opt{'message'} || 'Finished!';
51 my $bill_opts = $opt{'bill_opts'} || {};
52 my @opt_keys = keys(%$bill_opts);
53 my @opt_vals = values(%$bill_opts);