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 @@
Under the Federal Guidelines, you can do one of the following:
+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) + . +
+- 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: -
-- 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 -
-- The Federal Child Support Guidelines, Step by Step Guide has a - worksheet you can use to help - calculate your annual income. Step by step instructions are also detailed in the - Step by Step Guide. -
++ 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: +
++ 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 +
+| - | Amount | -||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - How many child(ren) are you asking for support? - | -- {% input_field type="number" name="number_children_seeking_support" class="fact-sheet-input" %} - | -||||||||||||
|
+
+
+
+ How do I calculate annual income?
+
+
+ - What is the - {% 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#h11" link_text="Child Support Guidelines" %} - amount for $150,000? + The Federal Child Support Guidelines, Step by Step Guide has a + worksheet you can use to help + calculate your annual income. Step by step instructions are also detailed in the + Step by Step Guide. - {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %} - |
- - {% input_field type="number" name="child_support_amount_under_high_income" class="fact-sheet-input guideline-amount" data_sum="true" data_sum_class="guideline-amount" data_sum_target_id="total_amount" %} - | -||||||||||||
| - What is the % of income over $150,000 from the - {% 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#h11" link_text="Child Support Guidelines" %} - ? - | -- {% input_field type="number" name="percent_income_over_high_income_limit" class="fact-sheet-input" %} - | -||||||||||||
|
+
+
+
+
+ Fact Sheet F Income over $150,000+
- What is the child support amount to be paid on the portion of income over $150,000? + Do you and your spouse agree that ${{ total_guideline_amount }} is the child support amount? -
+
+
+
+
+
+
+
- + What is the amount that you and your spouse have agreed to? + ++ That differs from the Child Support Guidelines table amount +
- How can I determine this amount?
+
-
+ {% money_input_field name="agreed_child_support_amount" value="" class="fact-sheet-input money" %}
+
+
- + Why do you think the court should approve your proposed amount? + ++ Discuss the conditions, means, needs and other circumstances of the child, and the financial + ability of + each parent to support the child/children. +
-
- The child support tables only show an amount for the first $150,000 of income. You have - two choices for determining how much child support should be paid on the portion of - income over $150,000: - -
- To speak to someone in person, you can call the Department of Justice Canada's Family - Law Information Line at 1-888-373-2222. When you call, be ready to tell them: - -
- 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#h11" link_text="Federal Child Support Guidelines" %} - , Department of Justice - + {% input_field type="textarea" name="reason_child_support_amount" class="fact-sheet-input form-control response-textarea" maxlength="1000" rows="6" %} |
- - {% input_field type="number" name="amount_income_over_high_income_limit" class="fact-sheet-input guideline-amount" data_sum="true" data_sum_class="guideline-amount" data_sum_target_id="total_amount" %} - | -||||||||||||
| - Guidelines table amount - | -- {% input_field type="number" name="total_guideline_amount" id="total_amount" class="fact-sheet-input" readonly="" data_mirror="true" data_mirror_target="#agreed_total_amount" data_mirror_broadcast_change="true"%} - | -
- Do you and your spouse agree that ${{ total_guideline_amount }} is the child support amount? -
-- What is the amount that you and your spouse have agreed to? -
-- That differs from the Child Support Guidelines table amount -
-- Why do you think the court should approve your proposed amount? -
-- Discuss the conditions, means, needs and other circumstances of the child, and the financial ability of - each parent to support the child/children. -
-- 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: -
-- 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 -
-- A spouse’s annual income is determined using the sources of income set out under the heading - “Total income” in the T1 General form issued by the Canada Revenue Agency and is adjusted in - accordance with Schedule III. -
++ 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: +
++ 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 +
+| - | Amount | -||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - How many child(ren) are you asking for support? - | -- {% input_field type="number" name="spouse_number_children_seeking_support" class="fact-sheet-input" %} - | -||||||||||||
|
+
+
+
+ How do I calculate my spouse's annual income?
+
+
+ - What is the - {% 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#h11" link_text="Child Support Guidelines" %} - amount for $150,000? + A spouse’s annual income is determined using the sources of income set out under the heading + “Total income” in the T1 General form issued by the Canada Revenue Agency and is adjusted in + accordance with Schedule III. - {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_spouse_guideline_amount" %} - |
- - {% input_field type="number" name="spouse_child_support_amount_under_high_income" class="fact-sheet-input spouse-guideline-amount" data_sum="true" data_sum_class="spouse-guideline-amount" data_sum_target_id="spouse_total_amount" %} - | -||||||||||||
| - What is the % of income over $150,000 from the - {% 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#h11" link_text="Child Support Guidelines" %} - ? - | -- {% input_field type="number" name="spouse_percent_income_over_high_income_limit" class="fact-sheet-input" %} - | -||||||||||||
|
+
+
+
+
+ Fact Sheet F Income over $150,000+
- What is the child support amount to be paid on the portion of income over $150,000? + Do you and your spouse agree that ${{ spouse_total_guideline_amount }} is the child + support amount? -
+
+
+
+
+
+
+
- + What is the amount that you and your spouse have agreed to? + ++ That differs from the Child Support Guidelines table amount +
- How can I determine this amount?
+
-
+ {% money_input_field name="spouse_agreed_child_support_amount" value="" class="fact-sheet-input money" %}
+
+
- + Why do you think the court should approve your proposed amount? + ++ Discuss the conditions, means, needs and other circumstances of the child, and the financial + ability of + each parent to support the child/children. +
-
- The child support tables only show an amount for the first $150,000 of income. You have - two choices for determining how much child support should be paid on the portion of - income over $150,000: - -
- To speak to someone in person, you can call the Department of Justice Canada's Family - Law Information Line at 1-888-373-2222. When you call, be ready to tell them: - -
- 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#h11" link_text="Federal Child Support Guidelines" %} - , Department of Justice - + {% input_field type="textarea" name="spouse_reason_child_support_amount" class="fact-sheet-input form-control response-textarea" maxlength="1000" rows="6" %} |
- - {% input_field type="number" name="spouse_amount_income_over_high_income_limit" class="fact-sheet-input spouse-guideline-amount" data_sum="true" data_sum_class="spouse-guideline-amount" data_sum_target_id="spouse_total_amount" %} - | -||||||||||||
| - Guidelines table amount - | -- {% input_field type="number" name="spouse_total_guideline_amount" id="spouse_total_amount" class="fact-sheet-input" readonly="" data_mirror="true" data_mirror_target="#spouse_agreed_total_amount" data_mirror_broadcast_change="true"%} - | -
- Do you and your spouse agree that ${{ spouse_total_guideline_amount }} is the child support amount? -
-- What is the amount that you and your spouse have agreed to? -
-- That differs from the Child Support Guidelines table amount -
-- Why do you think the court should approve your proposed amount? -
-- Discuss the conditions, means, needs and other circumstances of the child, and the financial ability of - each parent to support the child/children. -
-- For this option you will need to provide the court with another form called the - Agreement as to Annual Income (F9). -
- -diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index 9e479444..288205dd 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -857,6 +857,16 @@ "model": "core.question", "pk": "child_support_act" }, +{ + "fields": { + "name": "How will you and your spouse be calculating your income?", + "description": "For Step 6, Your children - Income & expenses", + "summary_order": 0, + "required": "Required" + }, + "model": "core.question", + "pk": "how_will_calculate_income" +}, { "fields": { "name": "What is your annual gross income as per the Federal Child Support Guidelines?", @@ -1069,16 +1079,6 @@ "model": "core.question", "pk": "spouse_reason_child_support_amount" }, -{ - "fields": { - "name": "My spouse and I have entered into an agreement as to income pursuant to section 15 (2) of the Guidelines, a copy of which agreement is attached.", - "description": "For Step 6, Your children - Income & expenses", - "summary_order": 0, - "required": "Required" - }, - "model": "core.question", - "pk": "you_spouse_entered_agreement" -}, { "fields": { "name": "Are you or your spouse claiming undue hardship?",