From 98dbd4e9a292488b042c2817d8b97b47dddc5ca4 Mon Sep 17 00:00:00 2001 From: Benard Ebinu Date: Tue, 3 Apr 2018 18:43:58 -0700 Subject: [PATCH] DIV-829: fixing how calculate total monthly child support --- edivorce/apps/core/static/js/main.js | 38 ------------------- .../templates/pdf/partials/fact_sheet_a.html | 2 +- .../templates/question/06_children_facts.html | 8 ++-- .../question/06_children_what_for.html | 23 ----------- edivorce/apps/core/utils/derived.py | 26 +++++++++++++ 5 files changed, 31 insertions(+), 66 deletions(-) diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 31f4d9ef..a9788956 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -193,44 +193,6 @@ $(function () { }); - // Fact Sheet A - // Dynamically calculate total child support payment for payor - var calcTotalChildSupportPayment = function() { - var payor = $('#child_support_payor').text(); - var payorMonthlyChildSupportAmount = parseFloat($('#payor_monthly_child_support_amount').text()) || 0; - var yourShare = parseFloat($('#your_proportionate_share_amount').text()) || 0; - var spouseShare = parseFloat($('#spouse_proportionate_share_amount').text()) || 0; - var factSheet_B_ProposedAmount = parseFloat($('#fact_sheet_b_proposed_amount').text()) || 0; - var factSheet_C_ProposedAmount = parseFloat($('#fact_sheet_c_proposed_amount').text()) || 0; - 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; - } - - if ($('#show_fact_sheet_b').text() === 'False') { - factSheet_B_ProposedAmount = 0; - } - if ($('#show_fact_sheet_c').text() === 'False') { - factSheet_C_ProposedAmount = 0; - } - - // This number should include the share paid to individual - return (payorMonthlyChildSupportAmount + payorShare + factSheet_B_ProposedAmount + factSheet_C_ProposedAmount).toFixed(2); - }; - - $('#total_child_support_payment').val(calcTotalChildSupportPayment()).change(); - $('#total_extraordinary_expense_monthly').on('change', function() { - $('#total_child_support_payment').val(calcTotalChildSupportPayment()).change(); - }); - - // 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"); diff --git a/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html b/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html index abbd4660..32317888 100644 --- a/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html +++ b/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html @@ -122,7 +122,7 @@ Total monthly child support payable by {{ derived.child_support_payor }}, including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7 expenses, is - {{ responses.total_child_support_payment|money }} + {{ derived.total_child_support_payment_a|money }}

{% endif %} diff --git a/edivorce/apps/core/templates/question/06_children_facts.html b/edivorce/apps/core/templates/question/06_children_facts.html index ec0adec2..64fd754a 100644 --- a/edivorce/apps/core/templates/question/06_children_facts.html +++ b/edivorce/apps/core/templates/question/06_children_facts.html @@ -127,12 +127,12 @@
- {% money_input_field id="fact_b_your_child_support_paid" name="your_child_support_paid" class="fact-sheet-input claimants-child-support-amounts" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_between_claimants]" data_mirror="true" data_mirror_target="#fact_c_your_child_support_paid" placeholder="enter amount" %} + {% money_input_field id="fact_b_your_child_support_paid" name="your_child_support_paid" class="fact-sheet-input claimants-child-support-amounts" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_payment_amounts]" data_mirror="true" data_mirror_target="#fact_c_your_child_support_paid" placeholder="enter amount" %}
- {% money_input_field id="fact_b_your_spouse_child_support_paid" name="your_spouse_child_support_paid" class="fact-sheet-input claimants-child-support-amounts" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_between_claimants]" data_mirror="true" data_mirror_target="#fact_c_your_spouse_child_support_paid" placeholder="enter amount" %} + {% money_input_field id="fact_b_your_spouse_child_support_paid" name="your_spouse_child_support_paid" class="fact-sheet-input claimants-child-support-amounts" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_payment_amounts]" data_mirror="true" data_mirror_target="#fact_c_your_spouse_child_support_paid" placeholder="enter amount" %}
@@ -201,7 +201,7 @@
- {% money_input_field name="difference_between_claimants" value="" class="money fact-sheet-input" readonly="" %} + {% money_input_field name="difference_payment_amounts" value="" class="money fact-sheet-input" readonly="" %}
@@ -247,7 +247,7 @@
- {% money_input_field name="difference_between_claimants" value="" class="money fact-sheet-input" readonly="" %} + {% money_input_field name="difference_payment_amounts" value="" class="money fact-sheet-input" readonly="" %}
diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index b3e0e98a..73682e1c 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -11,29 +11,6 @@ {% block content %}

Step {% step_order step="children" %}:Children - What are you asking for

- -
-

- Total monthly child support payment amount including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7 - expenses: -

- - - - - - - - -

- ${% input_field type="text" id="total_child_support_payment" name="total_child_support_payment" class="border-less-heading" readonly="" %} -

-

- - Please note: The value above is based on the information you entered in Fact Sheet A - Special or Extraordinary Expenses. - -

-

What is the monthly child support amount