|
Lines 76-81
Link Here
|
| 76 |
<td> |
76 |
<td> |
| 77 |
[% IF ACCOUNT_LINE.amountoutstanding > 0 %] |
77 |
[% IF ACCOUNT_LINE.amountoutstanding > 0 %] |
| 78 |
<input name="accountline" type="checkbox" class="checkbox-pay" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]"> |
78 |
<input name="accountline" type="checkbox" class="checkbox-pay" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.accountlines_id %]"> |
|
|
79 |
<input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id %]" value="[% ACCOUNT_LINE.amountoutstanding %]" /> |
| 79 |
[% END %] |
80 |
[% END %] |
| 80 |
</td> |
81 |
</td> |
| 81 |
[% END %] |
82 |
[% END %] |
|
Lines 135-140
Link Here
|
| 135 |
<div class="control-group"> |
136 |
<div class="control-group"> |
| 136 |
<input type="hidden" id="payment-amount" name="payment_amount" value="0" /> |
137 |
<input type="hidden" id="payment-amount" name="payment_amount" value="0" /> |
| 137 |
<button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button> |
138 |
<button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button> |
|
|
139 |
<span id="amount-to-pay-label"> |
| 140 |
Amount to pay: <span id="amount-to-pay">0.00</span> |
| 141 |
</span> |
| 138 |
</div> |
142 |
</div> |
| 139 |
</fieldset> |
143 |
</fieldset> |
| 140 |
[% END %] |
144 |
[% END %] |
|
Lines 152-159
Link Here
|
| 152 |
[% BLOCK jsinclude %] |
156 |
[% BLOCK jsinclude %] |
| 153 |
<script type="text/javascript"> |
157 |
<script type="text/javascript"> |
| 154 |
$( document ).ready(function() { |
158 |
$( document ).ready(function() { |
| 155 |
$('.checkbox-pay').change( function() { |
159 |
$("#amount-to-pay-label").hide(); |
| 156 |
$("#submit-pay").prop('disabled', ! $('.checkbox-pay:checked').length ); |
160 |
|
|
|
161 |
$(".checkbox-pay").change( function() { |
| 162 |
// Disable the pay button if no fees are selected |
| 163 |
$("#submit-pay").prop("disabled", ! $(".checkbox-pay:checked").length ); |
| 164 |
|
| 165 |
// Calculate the total amount to be paid based on selected fees |
| 166 |
var total = 0; |
| 167 |
$(".checkbox-pay").each( function() { |
| 168 |
if ( $(this).is(":checked") ) { |
| 169 |
var id = this.id.split("checkbox-pay-")[1]; |
| 170 |
total += parseFloat( $("#amount-" + id).val() ); |
| 171 |
} |
| 172 |
}); |
| 173 |
|
| 174 |
if ( total ) { |
| 175 |
$("#amount-to-pay").html( total.toFixed(2) ); |
| 176 |
$("#amount-to-pay-label").show(); |
| 177 |
} else { |
| 178 |
$("#amount-to-pay-label").hide(); |
| 179 |
} |
| 157 |
}); |
180 |
}); |
| 158 |
}); |
181 |
}); |
| 159 |
</script> |
182 |
</script> |
| 160 |
- |
|
|