+ <TD ALIGN="right"><% emt('Prepayment for') %></TD>
+% if ( $amount_id ) {
+ <SCRIPT type="text/javascript">
+var discounted_total = <% encode_json \%discounted_total %>;
+function change_discount_term(what) {
+ var new_term = what.value;
+ var amount_field = document.getElementById('<% $amount_id %>');
+ if(new_term == "") {
+ amount_field.readOnly = false;
+ amount_field.value = '';
+ }
+ else {
+ amount_field.value = discounted_total[new_term];
+ amount_field.readOnly = true;
+ }
+}
+</SCRIPT>
+% }