%doc> Clickable link to bill a customer. Example: <% include( '/elements/bill.html', ### # required ### custnum => $custnum, label => 'Bill Now!', ### # recommended ### url => $p.'view/cust_main.cgi?'.$custnum, ### # optional, can contain any FS::cust_main::bill_and_collect options ### bill_opts => { 'batch_card' => 'yes' }, formname => 'MyBillNowLink', # if for some reason you want this ) %> %doc>
<%init> my %opt = @_; my $custnum = $opt{'custnum'}; my $label = $opt{'label'}; # formname no longer needs to be passed from outside, but we still # need one and it needs to be unique my $formname = $opt{'formname'} || 'bill'.sprintf('%04d',int(rand(10000))).$custnum; my $url = $opt{'url'} || ''; my $message = $opt{'message'} || 'Finished!'; my $bill_opts = $opt{'bill_opts'} || {}; my @opt_keys = keys(%$bill_opts); my @opt_vals = values(%$bill_opts); %init>