X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-payment_options.html;h=8859b9b36dc8ad02b5bc9259c798c00cf69bf05a;hp=5197c37064270480d6b9bc8772f0176c29ee5f34;hb=01c9143a54bf5e1513537547fd362822f58d1e2a;hpb=ca2f12276eb88b2e71762c76974ae564f008b8c1 diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html index 5197c3706..8859b9b36 100644 --- a/httemplate/elements/tr-select-payment_options.html +++ b/httemplate/elements/tr-select-payment_options.html @@ -1,3 +1,30 @@ +<%doc> + +Example: + + include( '/elements/tr-select-payment_options.html', + + #opt - most get used in /elements/tr-amount-fee + 'custnum' => 4, # customer number needed for selecting invoices + 'prefix' => 'pre', # prefix to fields and row ID's + 'amount' => 1, # payment amount + 'process-pkgpart' => scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)), + 'process-display' => scalar($conf->config('manual_process-display')), + 'process-skip_first' => $conf->exists('manual_process-skip_first'), + 'num_payments' => scalar($cust_main->cust_pay), + 'surcharge_percentage' => + ( $payby eq 'CARD' + ? scalar($conf->config('credit-card-surcharge-percentage', $cust_main->agentnum)) + : 0 + ), + 'surcharge_flatfee' => + ( $payby eq 'CARD' + ? scalar($conf->config('credit-card-surcharge-flatfee', $cust_main->agentnum)) + : 0 + ), + ) + + <% mt('Payment options') |h %> @@ -17,10 +44,12 @@ <& /elements/tr-select-invoice.html, - %opt + 'custnum' => $opt{custnum}, + 'prefix' => $opt{prefix}, &> <& /elements/tr-amount_fee.html, + 'row_style' => 'STYLE="display:none;"', %opt &> @@ -31,6 +60,7 @@ if ( what.value == 'select' ) { document.getElementById('payment_amount_row').style.display = 'none'; document.getElementById('invoice_row').style.display = 'none'; + document.getElementById('<% $opt{prefix} %>invoice').value = 'select'; document.getElementById('amount').value = ''; } else if ( what.value == 'invoice' ) { @@ -41,6 +71,7 @@ else { document.getElementById('payment_amount_row').style.display = 'block'; document.getElementById('invoice_row').style.display = 'none'; + document.getElementById('<% $opt{prefix} %>invoice').value = 'select'; document.getElementById('amount').value = what.value; }