RT# 34134 - removed payment amount field from payment screen, added 3 payment options...
[freeside.git] / httemplate / elements / tr-select-payment_options.html
1
2   <TR STYLE="display:block">
3     <TH ALIGN="right"><% mt('Payment options') |h %></TH>
4     <TD COLSPAN=7>
5      <SELECT
6           ID       = "<% $opt{prefix} %>payment_option"
7           NAME     = "<% $opt{prefix} %>payment_option"
8           onChange = "<% $opt{prefix} %>payment_option_changed(this)"
9           <% $opt{disabled} %>
10         >
11                 <OPTION VALUE="select">Select payment option</OPTION>
12                 <OPTION VALUE="<% $opt{amount} %>">Pay full balance</OPTION>
13                 <OPTION VALUE="invoice">Pay specific invoice</OPTION>
14                 <OPTION VALUE="">Pay specific amount</OPTION>
15         </SELECT>       
16     </TD>
17   </TR>
18
19   <& /elements/tr-select-invoice.html,
20        %opt
21   &>
22
23   <& /elements/tr-amount_fee.html,
24        %opt
25   &>
26
27   <SCRIPT TYPE="text/javascript">
28
29       function <% $opt{prefix} %>payment_option_changed(what) {
30
31         if ( what.value == 'select' ) {
32                 document.getElementById('payment_amount_row').style.display = 'none';
33                 document.getElementById('invoice_row').style.display = 'none';
34                 document.getElementById('amount').value = '';
35         }
36         else if ( what.value == 'invoice' ) {
37                 document.getElementById('payment_amount_row').style.display = 'none';
38                 document.getElementById('invoice_row').style.display = 'block';
39                 document.getElementById('amount').value = '';
40         }
41         else {
42                 document.getElementById('payment_amount_row').style.display = 'block';
43                 document.getElementById('invoice_row').style.display = 'none';
44                 document.getElementById('amount').value = what.value;
45         }
46
47       }
48
49       function <% $opt{prefix} %>invoice_select_changed(what) {
50
51         if ( what.value == 'select' ) {
52                 document.getElementById('payment_amount_row').style.display = 'none';
53                 document.getElementById('amount').value = '';
54         }
55         else {
56                 document.getElementById('payment_amount_row').style.display = 'block';
57                 document.getElementById('amount').value = what.value;
58         }
59
60       }
61
62 </SCRIPT>
63
64 <%init>
65
66 my %opt = @_;
67
68 </%init>