diff options
author | Christopher Burger <burgerc@freeside.biz> | 2018-01-02 19:47:44 -0500 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2018-01-02 19:47:44 -0500 |
commit | ca2f12276eb88b2e71762c76974ae564f008b8c1 (patch) | |
tree | 84ea86c8cae2029fc71c441f76758ef660a078db /httemplate/elements/tr-select-payment_options.html | |
parent | 4d873df8a99f87a6427a58ccd3e69b1c9474f44a (diff) |
RT# 34134 - removed payment amount field from payment screen, added 3 payment options (pay full balance, pay specific invoice, pay another amount) which will prefill the payment amount field.
Diffstat (limited to 'httemplate/elements/tr-select-payment_options.html')
-rw-r--r-- | httemplate/elements/tr-select-payment_options.html | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html new file mode 100644 index 000000000..5197c3706 --- /dev/null +++ b/httemplate/elements/tr-select-payment_options.html @@ -0,0 +1,68 @@ + + <TR STYLE="display:block"> + <TH ALIGN="right"><% mt('Payment options') |h %></TH> + <TD COLSPAN=7> + <SELECT + ID = "<% $opt{prefix} %>payment_option" + NAME = "<% $opt{prefix} %>payment_option" + onChange = "<% $opt{prefix} %>payment_option_changed(this)" + <% $opt{disabled} %> + > + <OPTION VALUE="select">Select payment option</OPTION> + <OPTION VALUE="<% $opt{amount} %>">Pay full balance</OPTION> + <OPTION VALUE="invoice">Pay specific invoice</OPTION> + <OPTION VALUE="">Pay specific amount</OPTION> + </SELECT> + </TD> + </TR> + + <& /elements/tr-select-invoice.html, + %opt + &> + + <& /elements/tr-amount_fee.html, + %opt + &> + + <SCRIPT TYPE="text/javascript"> + + function <% $opt{prefix} %>payment_option_changed(what) { + + if ( what.value == 'select' ) { + document.getElementById('payment_amount_row').style.display = 'none'; + document.getElementById('invoice_row').style.display = 'none'; + document.getElementById('amount').value = ''; + } + else if ( what.value == 'invoice' ) { + document.getElementById('payment_amount_row').style.display = 'none'; + document.getElementById('invoice_row').style.display = 'block'; + document.getElementById('amount').value = ''; + } + else { + document.getElementById('payment_amount_row').style.display = 'block'; + document.getElementById('invoice_row').style.display = 'none'; + document.getElementById('amount').value = what.value; + } + + } + + function <% $opt{prefix} %>invoice_select_changed(what) { + + if ( what.value == 'select' ) { + document.getElementById('payment_amount_row').style.display = 'none'; + document.getElementById('amount').value = ''; + } + else { + document.getElementById('payment_amount_row').style.display = 'block'; + document.getElementById('amount').value = what.value; + } + + } + +</SCRIPT> + +<%init> + +my %opt = @_; + +</%init>
\ No newline at end of file |