diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 2e1c27f4..9e9b24df 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -463,18 +463,44 @@ $(function () { var payorCallback = function() { var claimant = $(this).val(); - if ( claimant === 'Myself (Claimant 1)' && parseFloat($('input[name="annual_gross_income"]').val()) > 150000) { - $('#fact_sheet_f').show(); - } else if ( claimant === 'My Spouse (Claimant 2)' && parseFloat($('input[name="spouse_annual_gross_income"]').val()) > 150000) { + var toggleFactSheetTable = function(table_suffix, claimant_name_selector, hide) { $('#fact_sheet_f').show(); + if (hide) { + $('#fact_sheet_f_table_' + table_suffix).hide(); + } else { + $('#fact_sheet_f_table_' + table_suffix).show(); + } + + if (claimant_name_selector) { + $('#fact_sheet_f_payor_title_' + table_suffix).text($(claimant_name_selector).text()); + } + }; + + if (claimant === 'Myself (Claimant 1)' && parseFloat($('input[name="annual_gross_income"]').val()) > 150000) { + toggleFactSheetTable('1', '#__name_you'); + toggleFactSheetTable('2', null, true) + } else if (claimant === 'My Spouse (Claimant 2)' && parseFloat($('input[name="spouse_annual_gross_income"]').val()) > 150000) { + toggleFactSheetTable('2', '#__name_spouse'); + toggleFactSheetTable('1', null, true) + } else if (claimant === 'Both myself and my spouse') { + if (parseFloat($('input[name="annual_gross_income"]').val()) > 150000) { + toggleFactSheetTable('1', '#__name_you'); + } + if (parseFloat($('input[name="spouse_annual_gross_income"]').val()) > 150000) { + toggleFactSheetTable('2', '#__name_spouse'); + } } else { $('#fact_sheet_f').hide(); + $('#fact_sheet_f_table_1').hide(); + $('#fact_sheet_f_table_2').hide(); } if (claimant === 'Myself (Claimant 1)') { $('.payor-placeholder').text($('#__name_you').text()); } else if (claimant === 'My Spouse (Claimant 2)') { - $('.payor-placeholder').text($('#__name_spouse').text()) + $('.payor-placeholder').text($('#__name_spouse').text()); + } else if (claimant === 'Both myself and my spouse') { + $('.payor-placeholder').text($('#__name_you').text() + ' and ' + $('#__name_spouse').text()); } else { $('.payor-placeholder').text('the payor'); } diff --git a/edivorce/apps/core/templates/partials/fact_sheet_f_table.html b/edivorce/apps/core/templates/partials/fact_sheet_f_table.html new file mode 100644 index 00000000..529bd086 --- /dev/null +++ b/edivorce/apps/core/templates/partials/fact_sheet_f_table.html @@ -0,0 +1,107 @@ +{% load input_field %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Payor Amount
+ How many child(ren) are you asking for support? + + {% input_field type="number" name="number_children_seeking_support_"|add:claimant_id class="fact-sheet-input" %} +
+

+ What is the monthly + {% 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? +

+ {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %} +
+
+ {% money_input_field name="child_support_amount_under_high_income_"|add:claimant_id class="fact-sheet-input money guideline-amount-"|add:claimant_id data_sum="true" data_sum_class="guideline-amount-"|add:claimant_id data_sum_target_id="total_amount_"|add:claimant_id %} +
+
+ 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_"|add:claimant_id class="fact-sheet-input" %} + +
+
+

+ What is the monthly child support amount to be paid on the portion of income over + $150,000? +

+ +
+
+

+ 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: +

+
    +
  • + you can multiply the amount of income over $150,000 by the percentage shown + in the + table for the province or territory where the paying parent lives; or +
  • +
  • + you can agree on an additional amount of support based on the condition, + means, + needs and other circumstances of your children and your financial ability to + contribute. +
  • +
+

+ 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 +

+
+
+
+
+ {% money_input_field name="amount_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input money guideline-amount-"|add:claimant_id data_sum="true" data_sum_class="guideline-amount-"|add:claimant_id data_sum_target_id="total_amount_"|add:claimant_id %} +
+
+ Guidelines table amount + +
+ {% money_input_field name="total_guideline_amount_"|add:claimant_id id="total_amount_"|add:claimant_id class="fact-sheet-input money" readonly="" data_mirror="true" data_mirror_target="#agreed_total_amount" data_mirror_broadcast_change="true" %} +
+
\ No newline at end of file diff --git a/edivorce/apps/core/templates/question/06_children_facts.html b/edivorce/apps/core/templates/question/06_children_facts.html index d4a33265..3681356e 100644 --- a/edivorce/apps/core/templates/question/06_children_facts.html +++ b/edivorce/apps/core/templates/question/06_children_facts.html @@ -577,111 +577,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Amount
- How many child(ren) are you asking for support? - - {% input_field type="number" name="number_children_seeking_support" class="fact-sheet-input" %} -
-

- What is the monthly - {% 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? -

- {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %} -
-
- {% money_input_field name="child_support_amount_under_high_income" class="fact-sheet-input guideline-amount money" 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" %} - -
-
-

- What is the monthly child support amount to be paid on the portion of income over - $150,000? -

- -
-
-

- 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: -

-
    -
  • - you can multiply the amount of income over $150,000 by the percentage shown - in the - table for the province or territory where the paying parent lives; or -
  • -
  • - you can agree on an additional amount of support based on the condition, - means, - needs and other circumstances of your children and your financial ability to - contribute. -
  • -
-

- 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 -

-
-
-
-
- {% money_input_field name="amount_income_over_high_income_limit" class="fact-sheet-input guideline-amount money" data_sum="true" data_sum_class="guideline-amount" data_sum_target_id="total_amount" %} -
-
- Guidelines table amount - -
- {% money_input_field name="total_guideline_amount" id="total_amount" class="fact-sheet-input money" readonly="" data_mirror="true" data_mirror_target="#agreed_total_amount" data_mirror_broadcast_change="true" %} -
-
+ + diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index 39ba1e42..d2511393 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -887,7 +887,31 @@ "reveal_response": ">150000" }, "model": "core.question", - "pk": "number_children_seeking_support" + "pk": "number_children_seeking_support_you" +}, +{ + "fields": { + "name": "How many child(ren) are you asking for support?", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "number_children_seeking_support_spouse" +}, +{ + "fields": { + "name": "What is the Child Support Guidelines amount for $150,000?", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "child_support_amount_under_high_income_you" }, { "fields": { @@ -899,7 +923,7 @@ "reveal_response": ">150000" }, "model": "core.question", - "pk": "child_support_amount_under_high_income" + "pk": "child_support_amount_under_high_income_spouse" }, { "fields": { @@ -911,7 +935,19 @@ "reveal_response": ">150000" }, "model": "core.question", - "pk": "percent_income_over_high_income_limit" + "pk": "percent_income_over_high_income_limit_you" +}, +{ + "fields": { + "name": "What is the % of income over $150,000 from the Child Support Guidlines?", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "percent_income_over_high_income_limit_spouse" }, { "fields": { @@ -923,7 +959,31 @@ "reveal_response": ">150000" }, "model": "core.question", - "pk": "amount_income_over_high_income_limit" + "pk": "amount_income_over_high_income_limit_you" +}, +{ + "fields": { + "name": "What is the child support amount to be paid on the portion of income over $150,000?", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "amount_income_over_high_income_limit_spouse" +}, +{ + "fields": { + "name": "Guidelines table amount", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "annual_gross_income", + "reveal_response": ">150000" + }, + "model": "core.question", + "pk": "total_guideline_amount_you" }, { "fields": { @@ -935,7 +995,7 @@ "reveal_response": ">150000" }, "model": "core.question", - "pk": "total_guideline_amount" + "pk": "total_guideline_amount_spouse" }, { "fields": {