Browse Source

DIV-744: Calculating the total monthly child support payment amount Including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7 expenses

pull/160/head
Benard Ebinu 7 years ago
parent
commit
c5518d7f90
2 changed files with 32 additions and 2 deletions
  1. +27
    -0
      edivorce/apps/core/static/js/main.js
  2. +5
    -2
      edivorce/apps/core/templates/question/06_children_facts.html

+ 27
- 0
edivorce/apps/core/static/js/main.js View File

@ -189,6 +189,33 @@ $(function () {
});
// Fact Sheet A
// Dynamically calculate total child support payment for payor
var calcTotalChildSupportPayment = function() {
var payor = $('#child_support_payor').text();
var yourShare = parseFloat($('#your_proportionate_share_amount').val());
var spouseShare = parseFloat($('#spouse_proportionate_share_amount').val());
var payorShare = 0;
if (payor === 'Myself (Claimant 1)') {
payorShare = yourShare;
}
else if (payor === 'My Spouse (Claimant 2)') {
payorShare = spouseShare;
}
else if (payor === 'Both myself and my spouse') {
payorShare = yourShare + spouseShare;
}
return payorShare + parseFloat($('#schedule_one_amount').text() || 0);
};
$('#total_child_support_payment').text(calcTotalChildSupportPayment());
$('#total_extraordinary_expense_monthly').on('change', function() {
$('#total_child_support_payment').text(calcTotalChildSupportPayment());
});
// If relationship is common law and they want spousal support, update spouse_support_act with hidden input field, spouse_support_act_common_law
if ($("#spouse_support_act_common_law").length) {
var el = $("#spouse_support_act_common_law");


+ 5
- 2
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -201,7 +201,7 @@
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="your_proportionate_share_amount" id="your_proportionate_share_amount" class="fact-sheet-input money" data_scale="true" data_quantity="#total_extraordinary_expense_monthly" data_scale_factor="input[name='your_proportionate_share_percent']" readonly="" %}
{% money_input_field name="your_proportionate_share_amount" id="your_proportionate_share_amount" class="fact-sheet-input money child-support-amounts" data_scale="true" data_quantity="#total_extraordinary_expense_monthly" data_scale_factor="input[name='your_proportionate_share_percent']" readonly="" %}
</div>
</td>
</tr>
@ -215,16 +215,19 @@
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="spouse_proportionate_share_amount" id="spouse_proportionate_share_amount" class="fact-sheet-input money" data_scale="true" data_quantity="#total_extraordinary_expense_monthly" data_scale_factor="input[name='spouse_proportionate_share_percent']" readonly="" %}
{% money_input_field name="spouse_proportionate_share_amount" id="spouse_proportionate_share_amount" class="fact-sheet-input money child-support-amounts" data_scale="true" data_quantity="#total_extraordinary_expense_monthly" data_scale_factor="input[name='spouse_proportionate_share_percent']" readonly="" %}
</div>
</td>
</tr>
</tbody>
</table>
<br>
<p><strong>Claimant {% payorize %}</strong></p>
<p>Total monthly child support payment amount
Including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7
expenses is:
<span id="child_support_payor" hidden>{{ child_support_payor }}</span>
<span id="schedule_one_amount" hidden>{{ payor_monthly_child_support_amount }}</span>
<span id="total_child_support_payment"></span>
</p>
</div>


Loading…
Cancel
Save