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? + +
+
+
+ How can I determine this 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="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" %}
+
+ |
+
| - | 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? - -
-
-
- How can I determine this 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="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" %}
-
- |
-