diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 4b89754f..6b934602 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -1,5 +1,5 @@ // Reveal sections as the form is loading -$('input:radio, input:checkbox').each(function () { +var reveal_input_elements = function () { if ($(this).is(':checked')) { if ($(this).is(':visible')) { reveal($(this)); @@ -9,7 +9,9 @@ $('input:radio, input:checkbox').each(function () { $(this).parent().addClass('active'); } } -}); +}; + +$('input:radio, input:checkbox').each(reveal_input_elements); $('input[type=number]').each(function() { if ($(this).is(':visible')) { @@ -470,7 +472,9 @@ $(function () { if (hide) { $('#fact_sheet_f_table_' + table_suffix).hide(); } else { - $('#fact_sheet_f_table_' + table_suffix).show(); + var fact_sheet_table_element = $('#fact_sheet_f_table_' + table_suffix); + fact_sheet_table_element.show(); + fact_sheet_table_element.find('input:radio, input:checkbox').each(reveal_input_elements); } if (claimant_name_selector) { diff --git a/edivorce/apps/core/templates/partials/fact_sheet_f_table.html b/edivorce/apps/core/templates/partials/fact_sheet_f_table.html index 529bd086..fd52e6a9 100644 --- a/edivorce/apps/core/templates/partials/fact_sheet_f_table.html +++ b/edivorce/apps/core/templates/partials/fact_sheet_f_table.html @@ -1,107 +1,147 @@ {% load input_field %} +{% load format_utils %}
| 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
+
+ | 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" %} - ? - |
-
-
- {% 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? - -
-
-
- How can I determine this amount?
-
-
-
-
+ amount for $150,000?
+
+ {% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %}
+ - 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: - -
- 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="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? + +
+
+ How can I determine this amount?
- |
-
-
- {% 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 %}
+
+
+
+
- + 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: + +
+ 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 + |
- |
| - 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" %}
-
- |
-
+ Discuss the conditions, means, needs and other circumstances of the child, and the financial + ability of + each parent to support the child/children. +
+- We have agreed on the Guidelines table amount set out at Line D above as - the amount of child support. -
- {% else %} -- We have agreed on an amount of child support that differs from the Guidelines table amount and the amount of child support agreed on is: -
differs from the Guidelines table amount because:
-{{ responses.reason_child_support_amount|linebreaksbr }}
--
- {% endif %} - {% endif %} diff --git a/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html b/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html index 8ee3323f..d43d4527 100644 --- a/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html +++ b/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html @@ -45,4 +45,25 @@ Income Over $150,000 - \ No newline at end of file + + + + {% if responses.does_payour_amount_match_guidelines == 'YES' %} ++ We have agreed on the Guidelines table amount set out at Line D above as + the amount of child support. +
+ {% else %} ++ We have agreed on an amount of child support that differs from the Guidelines table amount and the amount of child support agreed on is: +
differs from the Guidelines table amount because:
+{% lookup responses 'reason_child_support_amount_'|add:claimant_id %}
++
+ {% endif %} \ No newline at end of file diff --git a/edivorce/apps/core/templatetags/format_utils.py b/edivorce/apps/core/templatetags/format_utils.py index 939ce272..bf18d4be 100644 --- a/edivorce/apps/core/templatetags/format_utils.py +++ b/edivorce/apps/core/templatetags/format_utils.py @@ -174,3 +174,9 @@ def integer(value): def lookup(obj, property): """ Return the value of a dynamic property within an object""" return obj.get(property, '') + + +@register.simple_tag(takes_context=True) +def agreed_child_support_amount(context, claimant_id): + """Return the agree amount for the specific claimant fact sheet table.""" + return linebreaksli(context.get('amount_income_over_high_income_limit_{}'.format(claimant_id), '')) diff --git a/edivorce/fixtures/Question.json b/edivorce/fixtures/Question.json index 42ac19b6..c2d388ab 100644 --- a/edivorce/fixtures/Question.json +++ b/edivorce/fixtures/Question.json @@ -1009,7 +1009,7 @@ }, { "fields": { - "name": "What is the amount that you and your spouse have agreed to?", + "name": "Do you and your spouse agree that amount is he child support amount?", "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", "summary_order": 0, "required": "Conditional", @@ -1017,11 +1017,47 @@ "reveal_response": ">150000" }, "model": "core.question", - "pk": "agree_to_child_support_amount" + "pk": "agree_to_child_support_amount_you" }, { "fields": { - "name": "What is the amount that you and your spouse have agreed to?", + "name": "Do you and your spouse agree that amount is he child support 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": "agree_to_child_support_amount_spouse" +}, +{ + "fields": { + "name": "What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "claimants_agree_to_child_support_amount", + "reveal_response": "NO" + }, + "model": "core.question", + "pk": "agreed_child_support_amount_you" +}, +{ + "fields": { + "name": "What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?", + "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", + "summary_order": 0, + "required": "Conditional", + "conditional_target": "claimants_agree_to_child_support_amount", + "reveal_response": "NO" + }, + "model": "core.question", + "pk": "agreed_child_support_amount_spouse" +}, +{ + "fields": { + "name": "Why do you think the court should approve your proposed amount?", "description": "For Step 6, Your children - Income & expenses - Your Fact Sheet F", "summary_order": 0, "required": "Conditional", @@ -1029,7 +1065,7 @@ "reveal_response": "NO" }, "model": "core.question", - "pk": "agreed_child_support_amount" + "pk": "reason_child_support_amount_you" }, { "fields": { @@ -1041,7 +1077,7 @@ "reveal_response": "NO" }, "model": "core.question", - "pk": "reason_child_support_amount" + "pk": "reason_child_support_amount_spouse" }, { "fields": {