From 8c5343fc29f58dbdaee9b4d46c53cc668958f8c5 Mon Sep 17 00:00:00 2001 From: Benard Ebinu Date: Wed, 13 Dec 2017 12:26:23 -0800 Subject: [PATCH] DIV-542: Question about how claimant and spouse will calculate income --- edivorce/apps/core/static/js/functions.js | 47 +- edivorce/apps/core/static/js/main.js | 25 - .../question/06_children_income_expenses.html | 888 +++++++++--------- edivorce/fixtures/Question.json | 20 +- 4 files changed, 506 insertions(+), 474 deletions(-) diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index fadac594..4184936c 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -8,6 +8,8 @@ var reveal = function(el) { var css_class = el.data("target_class"); var related_id = el.data("related_id"); var reveal_condition = el.data("reveal_condition"); + var invert_target = el.data("invert_target"); + var should_reveal = true; if (reveal_condition !== undefined) { @@ -25,12 +27,21 @@ var reveal = function(el) { } if (!should_reveal) { - if (related_id !== undefined){ + if (related_id !== undefined) { $('#' + related_id).hide(); } - if (css_class !== undefined){ + if (css_class !== undefined) { $('.' + css_class).hide(); } + if (invert_target !== undefined) { + $(invert_target).show(); + } + } + } else if (invert_target !== undefined) { + if (el.data("reveal_target")) { + $(invert_target).hide(); + } else { + $(invert_target).show(); } } @@ -69,24 +80,24 @@ var showHideTargetId = function(el, id, related_id) { if (related_id !== undefined){ $('#' + related_id).show(); } + } - var revealCheckboxes = [ - { - matchIdSelector: "#annual_gross_income", - radioSelector: "input[name=agree_to_child_support_amount]:checked" - }, - { - matchIdSelector: "#spouse_annual_gross_income", - radioSelector: "input[name=spouse_agree_to_child_support_amount]:checked" - } - ]; + var revealCheckboxes = [ + { + matchIdSelector: "#annual_gross_income", + radioSelector: "input[name=agree_to_child_support_amount]:checked" + }, + { + matchIdSelector: "#spouse_annual_gross_income", + radioSelector: "input[name=spouse_agree_to_child_support_amount]:checked" + } + ]; - revealCheckboxes.forEach(function(option) { - if (id === option.matchIdSelector) { - reveal($(option.radioSelector)); - } - }); - } + revealCheckboxes.forEach(function(option) { + if (id === option.matchIdSelector) { + reveal($(option.radioSelector)); + } + }); }; // Controls show or hiding a target css class diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 965979f9..c4b5bc43 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -357,32 +357,7 @@ $(function () { $('.invalid-date').parent().siblings('.form-group').find('.reconciliation-from-date').focus(); } }); - - // For Fact Sheet A, automatically sum up the values in the various expense fields and provide the user with a total - // in the total field. - $('[data-mirror=true]').on('change', function(e) { - var target_id = $(this).data("mirror_target_id"); - var scale_factor_identifier = $(this).data("mirror_scale"); - var broadcast_change = $(this).data("mirror_broadcast_change"); - - if (target_id !== "undefined" && scale_factor_identifier !== "undefined") { - var scaled_value = parseFloat($(this).val()); - if (scaled_value !== 0) { - if (scale_factor_identifier === "year_up") { - scaled_value *= 12; - } else if (scale_factor_identifier === "month_down") { - scaled_value /= 12; - } - var target_element = $('#' + target_id); - target_element.val(scaled_value.toFixed(2)); - - if (broadcast_change !== "undefined" && broadcast_change) { - target_element.trigger("change"); - } - } - } - }); $('.money').on('change', function() { var value = parseFloat($(this).val()); diff --git a/edivorce/apps/core/templates/question/06_children_income_expenses.html b/edivorce/apps/core/templates/question/06_children_income_expenses.html index 59e892d6..8e09704b 100644 --- a/edivorce/apps/core/templates/question/06_children_income_expenses.html +++ b/edivorce/apps/core/templates/question/06_children_income_expenses.html @@ -10,15 +10,66 @@

Step {% step_order step="children" %}:Children - Income & expenses

-

How will you and your spouse be calculating your income?

-

Under the Federal Guidelines, you can do one of the following:

+

How will you and your spouse be calculating your income?

+

Under the Federal Guidelines, you can do one of the following:

+ +
+ +

+ Under these rules, the total income shown on line 150 of your most recent income tax return or your + notice of assessment is a good place to start. The Federal Child Support Guidelines Step by Step + Guide has a + worksheet you can use to help calculate your annual income. +

+
+ +
+ +

+ For this option you will need to provide the court with another form called the + + Agreement as to Annual Income (F9) + . +

+
+ +
-
-

What is your -

+
+ {% money_input_field name="annual_gross_income" value="" class="money" data_target_id="annual_gross_income" data_related_id="you_fact_sheet_f" data_reveal_target="true" data_reveal_condition=">150000" %}
-
-
-
-

- The Federal Guidelines are a set of rules and tables used to determine child support when parents - divorce. They are the law. Their main goals are: -

-
    -
  • - to establish a fair standard of support for children so that they continue to benefit from both - parents’ incomes after the separation or divorce; -
  • -
  • - to reduce conflict and tension between parents by making the calculation of child support more - objective; -
  • -
  • - to ensure that parents and children in similar situations are treated the same; and -
  • -
  • - to make the legal process more efficient and encourage settlements by giving courts and parents guidance about child support. -
  • -
-

- Source: - {% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h12" link_text="Federal Child Support Guidelines" %} - , Department of Justice -

-
-
- -
-

What is your spouse's - +

What is your spouse's + annual gross income - as per the - - Federal Child Support Guidelines - ? -

-
- {% money_input_field name="spouse_annual_gross_income" value="" class="money" data_target_id="spouse_annual_gross_income" data_related_id="spouse_fact_sheet_f" data_reveal_target="true" data_reveal_condition=">150000" %} -
- -

+
+ {% money_input_field name="spouse_annual_gross_income" value="" class="money" data_target_id="spouse_annual_gross_income" data_related_id="spouse_fact_sheet_f" data_reveal_target="true" data_reveal_condition=">150000" %}
-
-
-
-

- The Federal Guidelines are a set of rules and tables used to determine child support when parents - divorce. They are the law. Their main goals are: -

-
    -
  • - to establish a fair standard of support for children so that they continue to benefit from both - parents’ incomes after the separation or divorce; -
  • -
  • - to reduce conflict and tension between parents by making the calculation of child support more - objective; -
  • -
  • - to ensure that parents and children in similar situations are treated the same; and -
  • -
  • - to make the legal process more efficient and encourage settlements by giving courts and parents guidance about child support. -
  • -
-

- Source: - {% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/start-com.html#h12" link_text="Federal Child Support Guidelines" %} - , Department of Justice -

-
-
-