Lines 7-12
Link Here
|
7 |
$(document).ready(function(){ |
7 |
$(document).ready(function(){ |
8 |
$('#maninvoice').preventDoubleFormSubmit(); |
8 |
$('#maninvoice').preventDoubleFormSubmit(); |
9 |
$("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); |
9 |
$("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); |
|
|
10 |
var type_fees = new Array(); |
11 |
[% FOREACH debit_type IN debit_types %] |
12 |
type_fees['[% debit_type.type_code %]'] = "[% debit_type.default_amount %]"; |
13 |
[% END %] |
14 |
|
15 |
$("#maninvoice #desc").val($("#maninvoice #type option:selected").text()); |
16 |
$("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]); |
17 |
|
18 |
$("#maninvoice #type").change(function(){ |
19 |
$("#maninvoice #desc").val($(this).find("option:selected").text()); |
20 |
$("#maninvoice #amount").val(type_fees[$(this).val()]); |
21 |
}); |
10 |
}); |
22 |
}); |
11 |
//]]> |
23 |
//]]> |
12 |
</script> |
24 |
</script> |
Lines 44-69
$(document).ready(function(){
Link Here
|
44 |
<legend>Manual invoice</legend> |
56 |
<legend>Manual invoice</legend> |
45 |
<ol> |
57 |
<ol> |
46 |
<li> |
58 |
<li> |
47 |
<script type="text/javascript"> |
|
|
48 |
var type_fees = new Array(); |
49 |
type_fees['L'] = ''; |
50 |
type_fees['F'] = ''; |
51 |
type_fees['A'] = ''; |
52 |
type_fees['N'] = ''; |
53 |
type_fees['M'] = ''; |
54 |
[% FOREACH invoice_types_loo IN invoice_types_loop %] |
55 |
type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]"; |
56 |
[% END %] |
57 |
</script> |
58 |
<label for="type">Type: </label> |
59 |
<label for="type">Type: </label> |
59 |
<select name="type" id="type" onchange="this.form.desc.value=this.options[this.selectedIndex].value; this.form.amount.value=type_fees[this.options[this.selectedIndex].value];"> |
60 |
<select name="type" id="type"> |
60 |
<option value="L">Lost item</option> |
61 |
[% FOREACH debit_type IN debit_types %] |
61 |
<option value="F">Fine</option> |
62 |
<option value="[% debit_type.type_code %]">[% debit_type.description %]</option> |
62 |
<option value="A">Account management fee</option> |
|
|
63 |
<option value="N">New card</option> |
64 |
<option value="M">Sundry</option> |
65 |
[% FOREACH invoice_types_loo IN invoice_types_loop %] |
66 |
<option value="[% invoice_types_loo.authorised_value %]">[% invoice_types_loo.authorised_value %]</option> |
67 |
[% END %] |
63 |
[% END %] |
68 |
</select> |
64 |
</select> |
69 |
</li> |
65 |
</li> |