From 4a5fcee4c1aa3ca07ac0a7921f9bd0e645ddc788 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 6 Jul 2010 12:18:11 +0000 Subject: "Bill now" link uses job queue/progressbar, RT#8995 --- httemplate/elements/bill.html | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 httemplate/elements/bill.html (limited to 'httemplate/elements/bill.html') diff --git a/httemplate/elements/bill.html b/httemplate/elements/bill.html new file mode 100644 index 000000000..335779a0f --- /dev/null +++ b/httemplate/elements/bill.html @@ -0,0 +1,49 @@ +<%doc> +Clickable link to bill a customer. + +Example: +
+<% include( '/elements/bill.html', + ### + # required + ### + custnum => $custnum, + label => 'Bill Now!', + formname => 'MyForm', + + ### + # recommended + ### + url => $p.'view/cust_main.cgi?'.$custnum, + + ### + # optional, can contain any FS::cust_main::bill_and_collect options + ### + bill_opts => { 'batch_card' => 'yes' }, +) %> +
+ +<% include('/elements/progress-init.html', + $formname, + [ 'custnum', @opt_keys ], + $p.'misc/bill.cgi', + $url ? { url => $url } : { message => $message }, + $key, +) %> +<%$label%> + +% foreach(@opt_keys) { + +% } +<%init> +my %opt = @_; +my $custnum = $opt{'custnum'}; +my $label = $opt{'label'}; +my $formname = $opt{'formname'}; +my $key = $formname.'bill'.$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); + -- cgit v1.2.1