Browse Source

Merge pull request #84 from ariannedee/DIV-1010

Add required fields to Children section
pull/160/head
Arianne 5 years ago
committed by GitHub
parent
commit
9d43625eb1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 1925 additions and 2018 deletions
  1. +1
    -1
      edivorce/apps/core/static/css/main.css
  2. +8
    -0
      edivorce/apps/core/static/css/main.scss
  3. +33
    -42
      edivorce/apps/core/static/js/main.js
  4. +237
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_b.html
  5. +149
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_c.html
  6. +76
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_d.html
  7. +313
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html
  8. +71
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_f.html
  9. +22
    -8
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_f_table.html
  10. +1
    -1
      edivorce/apps/core/templates/partials/required.html
  11. +14
    -813
      edivorce/apps/core/templates/question/06_children_facts.html
  12. +26
    -22
      edivorce/apps/core/templates/question/06_children_income_expenses.html
  13. +11
    -8
      edivorce/apps/core/templates/question/06_children_payor_medical.html
  14. +37
    -21
      edivorce/apps/core/templates/question/06_children_what_for.html
  15. +11
    -7
      edivorce/apps/core/templates/question/06_children_your_children.html
  16. +6
    -0
      edivorce/apps/core/templatetags/format_utils.py
  17. +9
    -3
      edivorce/apps/core/templatetags/input_field.py
  18. +140
    -390
      edivorce/apps/core/tests.py
  19. +136
    -0
      edivorce/apps/core/utils/conditional_logic.py
  20. +108
    -69
      edivorce/apps/core/utils/derived.py
  21. +182
    -71
      edivorce/apps/core/utils/question_step_mapping.py
  22. +53
    -90
      edivorce/apps/core/utils/step_completeness.py
  23. +143
    -120
      edivorce/apps/core/utils/user_response.py
  24. +41
    -23
      edivorce/apps/core/views/main.py
  25. +2
    -2
      edivorce/apps/core/views/pdf.py
  26. +95
    -327
      edivorce/fixtures/Question.json

+ 1
- 1
edivorce/apps/core/static/css/main.css
File diff suppressed because it is too large
View File


+ 8
- 0
edivorce/apps/core/static/css/main.scss View File

@ -690,6 +690,14 @@ i.fa.fa-question-circle {
}
}
.table-error {
border: 2px solid $color-red !important;
-webkit-transition: 0.1s ease-in-out all;
transition: 0.1s ease-in-out all;
margin: -5px -10px;
padding: 12px 16px;
}
.btn-radio {
color: $brand-titles;
background-color: $color-blue-lighter;


+ 33
- 42
edivorce/apps/core/static/js/main.js View File

@ -355,25 +355,6 @@ $(function () {
}
});
// show fact sheet b
if (childWithBoth) {
$('#fact_sheet_b').show();
} else {
$('#fact_sheet_b').hide();
}
// show fact sheet c
// When the claimants have indicated that they have more than one child, then show fact sheet c if each
// claimant has sole custody of at least one of the children or if one claimant has sole custody of at least one
// child and the both claimants have shared custody of the remaining children.
if (childWithYou && (childWithSpouse || childWithBoth)) {
$('#fact_sheet_c').show();
} else if (childWithSpouse && (childWithYou || childWithBoth)) {
$('#fact_sheet_c').show();
} else {
$('#fact_sheet_c').hide();
}
// Initiate Child support payor.
populateChildSupportPayor(childWithBoth, childWithYou, childWithSpouse);
$('.determine-payor').on('change', function() {
@ -478,12 +459,12 @@ $(function () {
}
};
var returnToParent = function(options) {
var returnToParent = function(save) {
$('.children-questions').hide();
$('.children-list').show();
clearQuestionWellError();
clearQuestionWellError(save);
enableChildrenFooterNav({page:'review'});
saveChildQuestions(options);
saveChildQuestions({persist: save});
populateChildrenFactSheets();
};
@ -494,10 +475,15 @@ $(function () {
}
};
var clearQuestionWellError = function() {
var clearQuestionWellError = function(removeTableError) {
$('.children-questions .question-well').each(function () {
$(this).removeClass('error');
});
if (removeTableError) {
var $childrenTable = $('.children-list.question-well');
$childrenTable.removeClass('error');
$childrenTable.find('.warning').remove();
}
};
var checkNoEmptyField = function() {
@ -508,14 +494,19 @@ $(function () {
var questionWell = $(this);
questionWell.removeClass('error');
questionWell.find('input').each(function (index, inputField) {
questionWell.find('.required').hide();
$(inputField).removeClass('error');
if (inputField.type === 'text') {
if (inputField.value === '') {
isNotEmpty = false;
$(inputField).addClass('error');
questionWell.addClass('error');
questionWell.find('.required').show();
} else if (inputField.id === 'childs_birth_date') {
if (!moment(inputField.value, "MMM D, YYYY").isValid()) {
isNotEmpty = false;
questionWell.addClass('error');
questionWell.find('.required').show();
}
} else if (inputField.id === 'childs_name') {
// check for digits in the name
@ -528,6 +519,7 @@ $(function () {
if (questionWell.find('input:radio:checked').length === 0) {
isNotEmpty = false;
questionWell.addClass('error');
questionWell.find('.required').show();
}
return false;
}
@ -542,7 +534,7 @@ $(function () {
$('#btn_save_child').on('click', function(e) {
e.preventDefault();
if (checkNoEmptyField() === true) {
returnToParent({persist: true});
returnToParent(true);
} else {
scrollToFirstError();
}
@ -557,7 +549,7 @@ $(function () {
$('#btn_revert_child').on('click', function(e) {
e.preventDefault();
returnToParent({persist: false});
returnToParent(false);
// Delete the empty row added to the children table when adding new child.
// Empty row will always be the last row of the table.
@ -577,23 +569,6 @@ $(function () {
populateChildrenFactSheets();
});
// check who has sole custody
$('input[name="__claimant_children"]').each(function() {
var children = JSON.parse($(this).val());
var youHaveSoleCustody = children.every(function(child){
return child.child_live_with === 'Lives with you';
});
var spouseHasSoleCustody = children.every(function(child){
return child.child_live_with === 'Lives with spouse';
});
if (youHaveSoleCustody || spouseHasSoleCustody) {
$('#monthly_amount_question').show();
} else {
$('#monthly_amount_question').hide();
}
});
var payorCallback = function() {
var claimant = $(this).val();
@ -752,6 +727,22 @@ $(function () {
}
});
// The question child_support_in_order is required, but if child support isn't in want_which_orders
// the question is disabled and it is automatically set to NO and saved to the DB
var setWantChildOrder = function () {
var noChildSupportOption = $('input[name="child_support_in_order"][value="NO"]');
var optionInPage = noChildSupportOption.length > 0;
if (optionInPage) {
var optionIsUnchecked = noChildSupportOption.prop('checked') === false;
var childSupportNotInOrders = noChildSupportOption.data('no_child_order') === true;
if (optionIsUnchecked && childSupportNotInOrders) {
noChildSupportOption.prop('checked', true);
ajaxCall('child_support_in_order', 'NO');
}
}
}
setWantChildOrder();
// For Prequalification step 3
// If there is invalid date on reconciliation period,
// prevent user from navigate away from the page when user clicks next or back button, or use side navigation


+ 237
- 0
edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_b.html View File

@ -0,0 +1,237 @@
{% load input_field %}
<div class="question-well fact-sheets {% if derived.fact_sheet_b_error %}error{% endif %}">
<h1>Shared Living Arrangement (Fact Sheet B)</h1>
<p>
Since you have previously indicated that the child/children will live with both parents more or less equally
(between 40 to 60% of the time with each parent) we need you to answer the questions below, even if you have a Separation Agreement or
existing Court Order.<br>
<b>This information is needed for the Judge. You will be able to indicate a different child support amount in a following step.</b>
</p>
<div class="question-well {% if number_of_children_error %}error{% endif %}">
<h3>Number of children{% if number_of_children_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
This is the number of children for which you and your spouse have a <b>shared parenting arrangement</b>
(the child spends at least 40 percent of the time with each of you in a year). If you and your spouse
have a split parenting arrangement for any other children, do not include them in this set of questions.
</p>
{% input_field type="number" name="number_of_children" class="form-control input-narrow positive-integer" min="0" %}
</div>
<br/>
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>You</th>
<th>Spouse</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fact-sheet-question">
<p>
What is the approximate amount of time the children spend with each parent?
</p>
<p>
Note: This includes time that a parent is responsible for the children, even if they are not
physically with that parent (for example the child is at school).
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_percentage_time"
aria-controls="collapse_percentage_time">
<div>
How do I determine the percentage of time spent with each parent?
</div>
</div>
<div class="collapse" id="collapse_percentage_time">
<div>
<p>For more information please refer to:</p>
<ul>
<li>
The <a href="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/step3-etap3.html#h5"
target="_blank">Federal Child Support Guidelines: Step-by-Step Guide</a>
</li>
<li>
The <a href="http://www.familylaw.lss.bc.ca/resources/fact_sheets/child_support.php#fortyPercentPrinciple"
target="_blank">child support</a> page on the Family Law in B.C. website.
</li>
</ul>
</div>
</div>
</td>
<td class="fact-sheet-answer">
<div class="{% if time_spent_with_you_error %}table-error{% endif %}">
<div class="percent-suffix">
{% input_field type="number" name="time_spent_with_you" class="fact-sheet-input" min="0" placeholder="enter number" ignore_error=True %}
<label> %</label>
</div>
</div>
</td>
<td class="fact-sheet-answer">
<div class="{% if time_spent_with_spouse_error %}table-error{% endif %}">
<div class="percent-suffix">
{% input_field type="number" name="time_spent_with_spouse" class="fact-sheet-input" min="0" placeholder="enter number" ignore_error=True %}
<label> %</label>
</div>
</div>
</td>
</tr>
<tr>
</tr>
<tr>
<td class="fact-sheet-question">Annual income as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" target="_blank">Federal Child Support
Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle"
aria-hidden="true"></i>
</span>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_b_annual_gross_income" name="annual_gross_income" value="" class="fact-sheet-input" readonly="" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_b_spouse_annual_gross_income" name="spouse_annual_gross_income" value="" class="fact-sheet-input" readonly="" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">What is the 'Guideline' amount for child support?
</td>
<td class="fact-sheet-answer">
<div class="{% if your_child_support_paid_b_error %}table-error{% endif %}">
<div class="dollar-prefix">
{% money_input_field id="fact_b_your_child_support_paid" name="your_child_support_paid_b" class="fact-sheet-input claimants-child-support-amounts determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_payment_amounts_b]" placeholder="enter amount" ignore_error=True %}
</div>
</div>
</td>
<td class="fact-sheet-answer">
<div class="{% if your_spouse_child_support_paid_b_error %}table-error{% endif %}">
<div class="dollar-prefix">
{% money_input_field id="fact_b_your_spouse_child_support_paid" name="your_spouse_child_support_paid_b" class="fact-sheet-input claimants-child-support-amounts determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_payment_amounts_b]" placeholder="enter amount" ignore_error=True %}
</div>
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_amounted_needed"
aria-controls="collapse_amounted_needed">
<div>
How do I determine the 'Guideline' amount for child support?
</div>
</div>
<div class="collapse" id="collapse_amounted_needed">
<div>
<p>
To figure out how much child support the
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Payor</b><br />The person who pays child support.">
payor<i class="fa fa-question-circle" aria-hidden="true"></i>
</span> will be paying under the guidelines:
</p>
<ul>
<li>
Use the <a href="http://www.justice.gc.ca/eng/fl-df/child-enfant/2017/look-rech.asp" target="_blank">
Child Support Table Lookup tool</a>
(effective from November 22, 2017) to calculate the correct amount of child support.
</li>
<li>
Refer to the <a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/index.html" target="_blank">
Federal Child Support Tables</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i
class="fa fa-question-circle" aria-hidden="true"></i>
</span>.
Make sure you view the table pertaining to the province where the payor lives
</li>
</ul>
<p>
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:
</p>
<ul>
<li>Where the paying parent lives</li>
<li>Whether both parents live in the same province or territory, and</li>
<li>The number of children to be supported</li>
</ul>
</div>
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Difference between the Guidelines table amount of the claimant and the Guidelines table amount of the respondent
</td>
<td class="fact-sheet-answer" colspan="2" readonly>
<div class="dollar-prefix">
{% money_input_field name="difference_payment_amounts_b" value="" class="money fact-sheet-input" readonly="" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Special or extraordinary expenses (as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/section-7.html" target="_blank">Section 7 of the Federal Child
Support Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle"
aria-hidden="true"></i>
</span>
) to be paid monthly
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="your_proportionate_share_amount" class="money fact-sheet-input" readonly="" %}
</div>
</td>
<td class="fact-sheet-answer" readonly="">
<div class="dollar-prefix">
{% money_input_field name="spouse_proportionate_share_amount" class="money fact-sheet-input" readonly="" %}
</div>
</td>
</tr>
<tr>
<td colspan="3">
<p>
Any other relevant information regarding the conditions, means, needs and other circumstances of
each spouse or of any child for whom support is sought? {% include 'partials/optional.html' %}
</p>
{% input_field style="height:50px;" type="textarea" name="additional_relevant_spouse_children_info" maxlength="500" rows="3" class="fact-sheet-input form-control response-textarea" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>Amount of child support to be paid per month by <span class="payor-placeholder">payor</span></p>
<p>Please note: You will need to indicate who the 'payor' is below.</p>
</td>
<td class="fact-sheet-answer" colspan="2" readonly>
<div class="dollar-prefix">
{% money_input_field name="difference_payment_amounts_b" value="" class="money fact-sheet-input different-payment-amounts" readonly="" %}
</div>
</td>
</tr>
</tbody>
</table>
</div>

+ 149
- 0
edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_c.html View File

@ -0,0 +1,149 @@
{% load input_field %}
<div class="question-well fact-sheets {% if derived.fact_sheet_c_error %}error{% endif %}">
<h1>Split Living Arrangement (Fact Sheet C)</h1>
<p>
Since you have previously indicated that you and your spouse have more than one child and
at least one of the children lives primarily with just 1 parent (more than 60% of the time)
you must complete Fact Sheet C.
<b>This information is needed for the Judge. You will be able to indicate a different child support amount in a following step.</b>
</p>
{% if derived.show_fact_sheet_b and derived.show_fact_sheet_c %}
<div class="bg-danger" id="fact-sheet-b-and-c-alert">
<p>
Do not include any children that are <b>SHARED on fact sheet B.</b> You may indicate 0 (zero) children for 1 of the parents in Fact
Sheet C and insert 0 (zero) dollars for child support amount.
</p>
</div>
{% endif %}
<table class="table table-bordered">
<tbody>
<tr>
<td class="fact-sheet-question">
How many children spend more than <strong>60 percent of their time</strong> with you and for whom you are asking for support?
</td>
<td class="fact-sheet-answer table-bordered">
<div class="{% if number_of_children_claimant_error %}table-error{% endif %}">
{% input_field type="number" name="number_of_children_claimant" class="positive-integer fact-sheet-input number-spinner" min="0" placeholder="enter number" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
Your spouse's annual income?
</p>
<p>
As per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" link_text="sections 15 to 20" %}
of the Federal Child Support Guidelines
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_calculate_annual_income_spouse" aria-controls="collapse_calculate_annual_income">
<div>
How do I calculate annual income?
</div>
</div>
<div class="collapse" id="collapse_calculate_annual_income_spouse">
<div>
The Federal Child Support Guidelines, Step-by-Step Guide has a
{% 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/w1-f1.html#s1" link_text="worksheet" %}
you can use to help calculate your annual income. Step-by-step instructions are also detailed in 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/step5-etap5.html#h7" link_text="Step-by-Step Guide" %}
.
</div>
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_c_spouse_annual_gross_income" name="spouse_annual_gross_income" class="fact-sheet-input money" readonly="" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>What is the 'Guideline' amount for child support payable by your spouse (as per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" link_text="Federal Child Support Tables" %}
)?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_amount_to_pay" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix {% if your_spouse_child_support_paid_c_error %}table-error{% endif %}">
{% money_input_field id="fact_c_your_spouse_child_support_paid" name="your_spouse_child_support_paid_c" class="fact-sheet-input money claimants-child-support-paid determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-paid" data_delta_target_selector="input[name=difference_payment_amounts_c]" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
How many children spend more than <strong>60 percent of their time</strong> with your spouse and for whom you are obliged to pay
support?
</td>
<td class="fact-sheet-answer table-bordered">
<div class="{% if number_of_children_claimant_spouse_error %}table-error{% endif %}">
{% input_field type="number" name="number_of_children_claimant_spouse" class="positive-integer fact-sheet-input number-spinner" min="0" placeholder="enter number" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>Your annual income?</p>
<p>
As per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" link_text="sections 15 to 20" %}
of the Federal Child Support Guidelines
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_calculate_annual_income_you" aria-controls="collapse_calculate_annual_income">
<div>
How do I calculate annual income?
</div>
</div>
<div class="collapse" id="collapse_calculate_annual_income_you">
<div>
The Federal Child Support Guidelines, Step-by-Step Guide has a
{% 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/w1-f1.html#s1" link_text="worksheet" %}
you can use to
help calculate your annual income. Step-by-step instructions are also detailed in 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/step5-etap5.html#h7" link_text="Step-by-Step Guide" %}
.
</div>
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_c_annual_gross_income" name="annual_gross_income" class="fact-sheet-input money" readonly="" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>What is the 'Guideline' amount for child support payable by you (as per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" link_text="Federal Child Support Tables" %}
)?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_claimant_amounts" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix {% if your_child_support_paid_c_error %}table-error{% endif %}">
{% money_input_field id="fact_c_your_child_support_paid" name="your_child_support_paid_c" class="fact-sheet-input money claimants-child-support-paid determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-paid" data_delta_target_selector="input[name=difference_payment_amounts_c]" ignore_error=True %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Difference between Guidelines table amounts
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="difference_payment_amounts_c" name="difference_payment_amounts_c" class="fact-sheet-input different-payment-amounts" readonly="" ignore_error=True %}
</div>
</td>
</tr>
</tbody>
</table>
</div>

+ 76
- 0
edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_d.html View File

@ -0,0 +1,76 @@
{% load input_field %}
<div class="question-well fact-sheets {% if derived.fact_sheet_d_error %}error{% endif %}">
<h1>Child(ren) 19 Years or Older (Fact Sheet D)</h1>
<p>
Since you have previously indicated that you have a child/children 19 years of age or older for whom support
is claimed, you will need to answer the next set of questions.
</p>
<div class="question-well">
<p>
How many child(ren) are 19 years or older for whom you are asking for support?
</p>
<div>
{% input_field type="number" name="number_children_over_19_need_support" value="number_children_over_19" class="fact-sheet-input input-narrow positive-integer" readonly="" %}
</div>
</div>
<div class="question-well">
<p>
What would the child support amount be using the Federal Child Support Guidelines?
<b>This information is needed for the Judge. You will be able to indicate a different child support amount in a following step.</b>
</p>
<div>
{% if derived.show_fact_sheet_b or derived.show_fact_sheet_c %}
<div class="dollar-prefix">
{% money_input_field id="total_spouse_paid_child_support" name="total_spouse_paid_child_support" value=derived.guideline_amounts_difference_total class="fact-sheet-input money input-narrow form-block response-textbox" readonly="" %}
</div>
{% else %}
<div class="dollar-prefix">
{% money_input_field name="total_spouse_paid_child_support" value_src="payor_monthly_child_support_amount" class="fact-sheet-input money input-narrow form-block response-textbox" readonly="" %}
</div>
{% endif %}
</div>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_amounts" %}
</div>
<div class="question-well-border-less">
<p>
Because you have a child(ren) 19 years or older, who may also be contributing to their own support, do you and your spouse agree that the
monthly Guidelines table amount for child support is appropriate?
{% if agree_to_guideline_child_support_amount_error %}{% include 'partials/required.html' %}{% endif %}
</p>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="agree_to_guideline_child_support_amount" class="fact-sheet-input" autocomplete="off" value="YES" data_target_id="enter_appropriate_amount" data_reveal_target="false" %}
Yes
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="agree_to_guideline_child_support_amount" class="fact-sheet-input" autocomplete="off" value="NO" data_target_id="enter_appropriate_amount" data_reveal_target="true" %}
No
</label>
</div>
<div id="enter_appropriate_amount" hidden>
<p>
What would be the appropriate amount?
{% if appropriate_spouse_paid_child_support_error %}{% include 'partials/required.html' %}{% endif %}
</p>
<div class="dollar-prefix">
{% money_input_field name="appropriate_spouse_paid_child_support" class="fact-sheet-input money form-block response-textbox" %}
</div>
<p>
Please describe - Why do you think the court should approve your proposed amount?
</p>
<p>
Describe the condition, means, needs, and other circumstances of the child, and the financial
ability of
each parent to provide support to the child. {% if suggested_child_support_error %}{% include 'partials/required.html' %}{% endif %}
</p>
<div>
{% input_field type="textarea" name="suggested_child_support" class="fact-sheet-input form-control response-textarea" maxlength="500" rows="5" %}
</div>
</div>
</div>
</div>

+ 313
- 0
edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html View File

@ -0,0 +1,313 @@
{% load input_field %}
<div class="question-well {% if claiming_undue_hardship_error or derived.fact_sheet_e_error %}error{% endif %}">
<h3>Are you or your spouse claiming undue hardship?{% if claiming_undue_hardship_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>
The Child Support Guidelines tables contain the base amounts for child support. If you our your spouse feel
that the child support amount will not leave enough money, you can claim that you will suffer
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
title="
<b>Undue hardship</b>
<p>
Circumstances that show the amount of child support under the child support guidelines is too
high or low. Must create &quot;undue&quot; (exceptional, excessive or disproportionate) difficulty
for the person making the claim.
</p>
<p>
A term used by the Child Support Guidelines to describe circumstances when payment of the table
amount of child support would cause financial difficulty for the payor or the recipient, potentially
justifying an award of support in an amount different than the table amount. See &quot;child support,&quot;
&quot;Child Support Guidelines&quot; and &quot;table amount.&quot;
</p>
">
undue hardship<i class="fa fa-question-circle" aria-hidden="true"></i>.
</span>
</p>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="claiming_undue_hardship" autocomplete="off" value="YES" data_target_id="fact_sheet_e" data_reveal_target="true" %}
YES
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="claiming_undue_hardship" autocomplete="off" value="NO" data_target_id="fact_sheet_e" data_reveal_target="false" %}
NO
</label>
</div>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_undue_hardship_situations"
aria-controls="collapse_undue_hardship_situations">
<div>
What situations are considered to be undue hardship?
</div>
</div>
<div class="collapse" id="collapse_undue_hardship_situations">
<div>
<p>The types of situations that might result in undue hardship include:</p>
<ul>
<li>having an unusual or excessive amount of debt,</li>
<li>having to make other support payments to children of another family (for example, from a previous marriage),</li>
<li>having to support a disabled or ill person, and</li>
<li>having to spend a lot of money to visit the child (for example, airfare to another city).</li>
</ul>
</div>
</div>
<div id="fact_sheet_e" class="question-well-border-less" hidden>
<h1>Fact Sheet E Undue Hardship</h1>
<p>
Since you have previously indicated that you will be claiming undue hardship you will need to provide
answers to the next set of questions. A claim for undue hardship can only be considered if the parent
making the claim can show that their household’s standard of living is not higher than the standard of
living in the household of the other parent. Often, income alone (which is all that is used to calculate
the guideline amount) does not reflect other circumstances that may impact a households’ finances.
</p>
{% if derived.fact_sheet_e_error %}<p class="warning">* At least one debt, expense, person, or other circumstance must be added in
this area to claim Undue Hardship. You can turn off this requirement by selecting NO above for Undue Hardship.</p>{% endif %}
<p><strong>Unusual or excessive debts</strong></p>
<p>
What are the unusual or excessive debts that you owe? These are debts that were taken on to support the family
before you separated (e.g. student loans). The debt can also be due to earning a living (e.g. vehicle,
specialized equipment).
</p>
<table id="claimant_debts" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Debt name</th>
<th class="table-bordered">What are the
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
title="
<b>Terms of this Debt</b>
<p>For example, how much is owed, what is the rate of interest,
when it must be repaid.</p>
">
terms of this debt<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>?
</th>
<th class="table-bordered">Monthly amount</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="debt-group" hidden>
{% include "partials/fact_sheet_excessive_debt.html" with debt_monthly_amount=0 %}
</tr>
{% multiple_values_to_list source=claimant_debts as debts %}
{% for debt in debts %}
<tr class="debt-item-row">
{% include "partials/fact_sheet_excessive_debt.html" with debt_name=debt.debt_name debt_terms=debt.debt_terms debt_monthly_amount=debt.debt_monthly_amount %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-debt fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-debt"></i> Add Debt</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Unusually high expenses for parenting time, contact with, or access to a child.</strong></p>
<p>
For example, airfare and accommodation to visit the child in another city.
</p>
<table id="claimant_expenses" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Expense</th>
<th class="table-bordered">Amount</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="expense-group" hidden>
{% include "partials/fact_sheet_expense.html" with expense_amount=0 %}
</tr>
{% multiple_values_to_list source=claimant_expenses as expenses %}
{% for expense in expenses %}
<tr class="expense-item-row">
{% include "partials/fact_sheet_expense.html" with expense_name=expense.expense_name expense_amount=expense.expense_amount %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-expense fact-sheet-control" colspan="2" readonly>
<a href=""><i class="fa fa-plus btn-add-expense"></i> Add Expense</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Supporting another person</strong></p>
<p>
Legal duty to support any other person, such as a former spouse or a new spouse who is too ill or disabled to be able to support himself
or herself.
</p>
<table id="supporting_non_dependents" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Name of person</th>
<th class="table-bordered">Relationship</th>
<th class="table-bordered">Describe reason(s) for support</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="supporting-non-dependent-group" hidden>
{% include "partials/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" %}
</tr>
{% multiple_values_to_list source=supporting_non_dependents as non_dependents %}
{% for non_dependent in non_dependents %}
<tr class="supporting-non-dependent-item-row">
{% include "partials/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" name=non_dependent.non_dependent_name relationship=non_dependent.non_dependent_relationship reason=non_dependent.non_dependent_reason %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-supporting-non-dependent fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-supporting-non-dependent"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Supporting dependent child/children from another relationship.</strong></p>
<p>
List the names of any other children for whom you have a legal duty to make support payments to.
Do not include the names of any children for whom you are asking for support for as a part of this
divorce application.
</p>
<table id="supporting_dependents" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Child's name</th>
<th class="table-bordered">Relationship</th>
<th class="table-bordered">Describe reason(s) for support</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="supporting-dependent-group" hidden>
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" %}
</tr>
{% multiple_values_to_list source=supporting_dependents as dependents %}
{% for dependent in dependents %}
<tr class="supporting-dependent-item-row">
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" name=dependent.supporting_dependent_name relationship=dependent.supporting_dependent_relationship reason=dependent.supporting_dependent_reason %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-supporting-dependent fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-supporting-dependent"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Support for a disabled or ill person.</strong></p>
<table id="supporting_disabled" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Name of person</th>
<th class="table-bordered">Relationship</th>
<th class="table-bordered">Describe reason(s) for support</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="supporting-disabled-group" hidden>
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" save_selector=".supporting-disabled-input-field" %}
</tr>
{% multiple_values_to_list source=supporting_disabled as dependents %}
{% for dependent in dependents %}
<tr class="supporting-disabled-item-row">
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" name=dependent.supporting_disabled_name relationship=dependent.supporting_disabled_relationship reason=dependent.supporting_disabled_reason save_selector=".supporting-disabled-input-field" %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-supporting-disabled fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-supporting-disabled"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<p class="fact-sheet-table-inline-question">
Other undue hardship circumstances
{% input_field type="textarea" name="undue_hardship" value="" maxlength="500" multiple='true' class="fact-sheet-input form-control response-textarea" placeholder="" %}
</p>
<p><strong>Income of Other Persons in Household</strong></p>
<p>
Enter the name (s) and income for any other persons in your household (e.g. co-parent, step parent)
who have a
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Duty to support</b><br />
Parents and guardians have a responsibility (duty) under the law to financially support their
children, whether or not they see or take care of the children. A parent, for the purposes
of child support, may include a stepparent if they were living together, in a relationship,
with the child’s parent and the child during the child’s life. The duty of a stepparent or
non-parent guardian to provide support is secondary to that of the child’s parents.">
duty to support<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
a child.
</p>
<table id="income_others" class="list-builder list-builder-compact">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Name of person</th>
<th class="table-bordered">Annual income</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="income-others-group" hidden>
{% include "partials/fact_sheet_income_others.html" with income_others_amount=0 %}
</tr>
{% multiple_values_to_list source=income_others as incomes %}
{% for income in incomes %}
<tr class="income-others-item-row">
{% include "partials/fact_sheet_income_others.html" with income_others_name=income.income_others_name income_others_amount=income.income_others_amount %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="table-bordered">
Total
</td>
<td class="fact-sheet-answer table-bordered" readonly>
<div class="dollar-prefix">
{% money_input_field id="total_income_others" class="fact-sheet-input money" readonly="" %}
</div>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="btn-add-income-others fact-sheet-control" colspan="2" readonly>
<a href="" tabindex="-1"><i class="fa fa-plus btn-add-income-others"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<div id="undue_amount_question" hidden></div>
</div>
</div>

+ 71
- 0
edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_f.html View File

@ -0,0 +1,71 @@
<div class="question-well fact-sheets {% if derived.fact_sheet_f_error %}error{% endif %}">
<h1>Income over $150,000 (Fact Sheet F)</h1>
<p>
Since you have previously indicated that the payor's income is over $150,000 you will need to provide
answers to the next set of questions. The child support guideline table you previously entered only goes
to $150,000. Income beyond that point requires a 2 stage calculation, the amount payable at $150,000 +
the amount payable on the income in excess of $150,000. This takes into account other factors such as
the financial ability of each parent, maintaining a certain quality of life, etc. It is no longer a
matter of there being money simply to look after the needs of the child, but rather the level of care
factoring in the family's lifestyle.
</p>
<p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapseIncomeNeeded" aria-controls="collapseIncomeNeeded">
<div>
Whose income is needed?
</div>
</div>
</p>
<div class="collapse" id="collapseIncomeNeeded">
<div>
<p>
If the paying parent earns more than $150,000 per year, you may need to calculate both incomes.
The Federal Guidelines provide two options:
</p>
<ul style="list-style: none;">
<li>
<strong>Option 1</strong>: You can use the tables to determine the child support amount for the first $150,000. Then add
the percentage listed in the tables for the portion of income over $150,000. If you choose this
option, you would only need to calculate the paying parent’s income.
</li>
<li>
<strong>Option 2</strong>: You can use the tables to determine the child support amount for the first $150,000. You can
then determine an amount for the portion of income over $150,000 by looking at the condition,
means, needs and other circumstances of the child and the financial ability of each of you to
contribute. If you choose this option, you would need to calculate both incomes.
</li>
</ul>
<p>
In some cases:
</p>
<ul>
<li>
You may need to calculate your child’s income—for example, if the child is over the age of
majority and you are taking his or her financial means into consideration to determine a
child support amount.
</li>
<li>
You may need to calculate the income of every member of both households to compare the
standards of living if either of you is claiming undue hardship.
</li>
</ul>
<p>
Source: 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/step5-etap5.html#h7" link_text="Federal Child Support Guidelines" %}
Department of Justice
</p>
</div>
</div>
<div id="fact_sheet_f_table_1" class="question-well-border-less" {% if not derived.show_fact_sheet_f_you %}hidden{% endif %}>
{% include "partials/fact_sheets/fact_sheet_f_table.html" with table_id=1 claimant_id='you' %}
</div>
<div id="fact_sheet_f_table_2" class="question-well-border-less" {% if not derived.show_fact_sheet_f_spouse %}hidden{% endif %}>
{% include "partials/fact_sheets/fact_sheet_f_table.html" with table_id=2 claimant_id='spouse' %}
</div>
</div>

edivorce/apps/core/templates/partials/fact_sheet_f_table.html → edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_f_table.html View File

@ -14,7 +14,10 @@
How many child(ren) are you asking for support?
</td>
<td class="fact-sheet-answer">
{% input_field type="number" name="number_children_seeking_support_"|add:claimant_id class="fact-sheet-input number-spinner" placeholder="enter number " %}
{% lookup_context 'number_children_seeking_support_'|add:claimant_id|add:"_error" as question_error %}
<div class="{% if question_error %}table-error{% endif %}">
{% input_field type="number" name="number_children_seeking_support_"|add:claimant_id class="fact-sheet-input number-spinner" placeholder="enter number " ignore_error=True %}
</div>
</td>
</tr>
<tr>
@ -27,8 +30,9 @@
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_guideline_amount" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% 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 placeholder="enter amount "%}
{% lookup_context 'child_support_amount_under_high_income_'|add:claimant_id|add:"_error" as question_error %}
<div class="dollar-prefix {% if question_error %}table-error{% endif %}">
{% 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 placeholder="enter amount " ignore_error=True %}
</div>
</td>
</tr>
@ -40,8 +44,11 @@
</td>
<td class="fact-sheet-answer">
<div class="percent-suffix">
{% input_field type="number" name="percent_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input" placeholder="enter percentage "%}
<label> %</label>
{% lookup_context 'percent_income_over_high_income_limit_'|add:claimant_id|add:"_error" as question_error %}
<div class="{% if question_error %}table-error{% endif %}">
{% input_field type="number" name="percent_income_over_high_income_limit_"|add:claimant_id class="fact-sheet-input" placeholder="enter percentage " ignore_error=True %}
<label> %</label>
</div>
</div>
</td>
</tr>
@ -89,8 +96,9 @@
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% 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 data_mirror="true" data_mirror_target="#agreed_child_support_amount_"|add:claimant_id data_mirror_broadcast_change="true" placeholder="enter amount "%}
{% lookup_context 'amount_income_over_high_income_limit_'|add:claimant_id|add:"_error" as question_error %}
<div class="dollar-prefix {% if question_error %}table-error{% endif %}">
{% 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 data_mirror="true" data_mirror_target="#agreed_child_support_amount_"|add:claimant_id data_mirror_broadcast_change="true" placeholder="enter amount " ignore_error=True%}
</div>
</td>
</tr>
@ -100,7 +108,7 @@
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% 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" %}
{% 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" ignore_error=True %}
</div>
</td>
</tr>
@ -108,9 +116,11 @@
</table>
<div class="question-well-border-less">
{% lookup_context 'agree_to_child_support_amount_'|add:claimant_id|add:"_error" as question_error %}
<h3>
Do you and your spouse agree that $<span
id="agreed_child_support_amount_{{ claimant_id }}">{% agreed_child_support_amount claimant_id line_breaks=False %}</span> is the child support amount?
{% if question_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
@ -124,16 +134,20 @@
</label>
</div>
<div id="enter_agreed_appropriate_amount_{{ claimant_id }}" hidden>
{% lookup_context 'agreed_child_support_amount_'|add:claimant_id|add:"_error" as question_error %}
<h3>
What is the amount that you and your spouse have agreed to (that differs from the Child Support Guidelines table amount)?
{% if question_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div>
<div class="dollar-prefix">
{% money_input_field name="agreed_child_support_amount_"|add:claimant_id value="" class="fact-sheet-input money" %}
</div>
</div>
{% lookup_context 'reason_child_support_amount_'|add:claimant_id|add:"_error" as question_error %}
<h3>
Why do you think the court should approve your proposed amount?
{% if question_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<p>
Discuss the conditions, means, needs and other circumstances of the child, and the financial

+ 1
- 1
edivorce/apps/core/templates/partials/required.html View File

@ -1 +1 @@
<span class="required">* Required</span>
<span class="required" {% if hidden %}hidden{% endif %}>Required</span>

+ 14
- 813
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -14,368 +14,15 @@
<div id="claimant_children" hidden>
{{ claimant_children }}
</div>
<div id="fact_sheet_b" class="question-well fact-sheets" hidden>
<h1>Shared Living Arrangement (Fact Sheet B)</h1>
<p>
Since you have previously indicated that the child/children will live with both parents more or less equally
(between 40 to 60% of the time with each parent) we need you to answer the questions below, even if you have a Separation Agreement or existing Court Order.<br>
<b>This information is needed for the Judge. You will be able to indicate a different child support amount in a following step.</b>
</p>
<div class="question-well">
<h3>Number of children</h3>
<p>
This is the number of children for which you and your spouse have a <b>shared parenting arrangement</b>
(the child spends at least 40 percent of the time with each of you in a year). If you and your spouse
have a split parenting arrangement for any other children, do not include them in this set of questions.
</p>
{% input_field type="number" name="number_of_children" class="form-control input-narrow positive-integer" min="0" %}
</div>
<br />
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>You</th>
<th>Spouse</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fact-sheet-question">
<p>
What is the approximate amount of time the children spend with each parent?
</p>
<p>
Note: This includes time that a parent is responsible for the children, even if they are not
physically with that parent (for example the child is at school).
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_percentage_time" aria-controls="collapse_percentage_time">
<div>
How do I determine the percentage of time spent with each parent?
</div>
</div>
<div class="collapse" id="collapse_percentage_time">
<div>
<p>For more information please refer to:</p>
<ul>
<li>
The <a href="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/step3-etap3.html#h5"
target="_blank">Federal Child Support Guidelines: Step-by-Step Guide</a>
</li>
<li>
The <a href="http://www.familylaw.lss.bc.ca/resources/fact_sheets/child_support.php#fortyPercentPrinciple"
target="_blank">child support</a> page on the Family Law in B.C. website.
</li>
</ul>
</div>
</div>
</td>
<td class="fact-sheet-answer">
<div class="percent-suffix">
{% input_field type="number" name="time_spent_with_you" class="fact-sheet-input" min="0" placeholder="enter number" %}
<label> %</label>
</div>
</td>
<td class="fact-sheet-answer">
<div class="percent-suffix">
{% input_field type="number" name="time_spent_with_spouse" class="fact-sheet-input" min="0" placeholder="enter number" %}
<label> %</label>
</div>
</td>
</tr>
<tr>
</tr>
<tr>
<td class="fact-sheet-question">Annual income as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" target="_blank">Federal Child Support Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_b_annual_gross_income" name="annual_gross_income" value="" class="fact-sheet-input" readonly="" %}
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_b_spouse_annual_gross_income" name="spouse_annual_gross_income" value="" class="fact-sheet-input" readonly="" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">What is the 'Guideline' amount for child support?
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field id="fact_b_your_child_support_paid" name="your_child_support_paid_b" class="fact-sheet-input claimants-child-support-amounts determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_payment_amounts_b]" placeholder="enter amount" %}
</div>
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field id="fact_b_your_spouse_child_support_paid" name="your_spouse_child_support_paid_b" class="fact-sheet-input claimants-child-support-amounts determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-amounts" data_delta_target_selector="input[name=difference_payment_amounts_b]" placeholder="enter amount" %}
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_amounted_needed" aria-controls="collapse_amounted_needed">
<div>
How do I determine the 'Guideline' amount for child support?
</div>
</div>
<div class="collapse" id="collapse_amounted_needed">
<div>
<p>
To figure out how much child support the
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Payor</b><br />The person who pays child support.">
payor<i class="fa fa-question-circle" aria-hidden="true"></i>
</span> will be paying under the guidelines:
</p>
<ul>
<li>
Use the <a href="http://www.justice.gc.ca/eng/fl-df/child-enfant/2017/look-rech.asp" target="_blank">
Child Support Table Lookup tool</a>
(effective from November 22, 2017) to calculate the correct amount of child support.
</li>
<li>
Refer to the <a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/index.html" target="_blank">
Federal Child Support Tables</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>.
Make sure you view the table pertaining to the province where the payor lives
</li>
</ul>
<p>
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:
</p>
<ul>
<li>Where the paying parent lives</li>
<li>Whether both parents live in the same province or territory, and</li>
<li>The number of children to be supported</li>
</ul>
</div>
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Difference between the Guidelines table amount of the claimant and the Guidelines table amount of the respondent
</td>
<td class="fact-sheet-answer" colspan="2" readonly>
<div class="dollar-prefix">
{% money_input_field name="difference_payment_amounts_b" value="" class="money fact-sheet-input" readonly="" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Special or extraordinary expenses (as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/section-7.html" target="_blank">Section 7 of the Federal Child Support Guidelines</a>
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Federal Child Support Guidelines</b><br />
This is a copy of an official work that is published by the Government of Canada and that this copy has
not been produced in affiliation with, or with the endorsement of the Government of Canada."><i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
) to be paid monthly
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field name="your_proportionate_share_amount" class="money fact-sheet-input" readonly="" %}
</div>
</td>
<td class="fact-sheet-answer" readonly="">
<div class="dollar-prefix">
{% money_input_field name="spouse_proportionate_share_amount" class="money fact-sheet-input" readonly="" %}
</div>
</td>
</tr>
<tr>
<td colspan="3">
<p>
Any other relevant information regarding the conditions, means, needs and other circumstances of
each spouse or of any child for whom support is sought?
</p>
{% input_field style="height:50px;" type="textarea" name="additional_relevant_spouse_children_info" maxlength="500" rows="3" class="fact-sheet-input form-control response-textarea" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>Amount of child support to be paid per month by <span class="payor-placeholder">payor</span></p>
<p>Please note: You will need to indicate who the 'payor' is below.</p>
</td>
<td class="fact-sheet-answer" colspan="2" readonly>
<div class="dollar-prefix">
{% money_input_field name="difference_payment_amounts_b" value="" class="money fact-sheet-input different-payment-amounts" readonly="" %}
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="fact_sheet_c" class="question-well fact-sheets" hidden>
<h1>Split Living Arrangement (Fact Sheet C)</h1>
<p>
Since you have previously indicated that you and your spouse have more than one child and
at least one of the children lives primarily with just 1 parent (more than 60% of the time)
you must complete Fact Sheet C.
<b>This information is needed for the Judge. You will be able to indicate a different child support amount in a following step.</b>
</p>
{% if derived.show_fact_sheet_b and derived.show_fact_sheet_c %}
<div class="bg-danger" id="fact-sheet-b-and-c-alert">
<p>
Do not include any children that are <b>SHARED on fact sheet B.</b> You may indicate 0 (zero) children for 1 of the parents in Fact Sheet C and insert 0 (zero) dollars for child support amount.
</p>
</div>
{% if derived.show_fact_sheet_b %}
{% include "partials/fact_sheets/fact_sheet_b.html" %}
{% endif %}
<table class="table table-bordered">
<tbody>
<tr>
<td class="fact-sheet-question">
How many children spend more than <strong>60 percent of their time</strong> with you and for whom you are asking for support?
</td>
<td class="fact-sheet-answer table-bordered">
{% input_field type="number" name="number_of_children_claimant" class="positive-integer fact-sheet-input number-spinner" min="0" placeholder="enter number" %}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>
Your spouse's annual income?
</p>
<p>
As per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" link_text="sections 15 to 20" %}
of the Federal Child Support Guidelines
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_calculate_annual_income_spouse" aria-controls="collapse_calculate_annual_income">
<div>
How do I calculate annual income?
</div>
</div>
<div class="collapse" id="collapse_calculate_annual_income_spouse">
<div>
The Federal Child Support Guidelines, Step-by-Step Guide has a
{% 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/w1-f1.html#s1" link_text="worksheet" %}
you can use to help calculate your annual income. Step-by-step instructions are also detailed in 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/step5-etap5.html#h7" link_text="Step-by-Step Guide" %}
.
</div>
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_c_spouse_annual_gross_income" name="spouse_annual_gross_income" class="fact-sheet-input money" readonly="" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>What is the 'Guideline' amount for child support payable by your spouse (as per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" link_text="Federal Child Support Tables" %}
)?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_amount_to_pay" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field id="fact_c_your_spouse_child_support_paid" name="your_spouse_child_support_paid_c" class="fact-sheet-input money claimants-child-support-paid determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-paid" data_delta_target_selector="input[name=difference_payment_amounts_c]" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
How many children spend more than <strong>60 percent of their time</strong> with your spouse and for whom you are obliged to pay support?
</td>
<td class="fact-sheet-answer table-bordered">
{% input_field type="number" name="number_of_children_claimant_spouse" class="positive-integer fact-sheet-input number-spinner" min="0" placeholder="enter number"%}
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>Your annual income?</p>
<p>
As per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-2.html#h-6" link_text="sections 15 to 20" %}
of the Federal Child Support Guidelines
</p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_calculate_annual_income_you" aria-controls="collapse_calculate_annual_income">
<div>
How do I calculate annual income?
</div>
</div>
<div class="collapse" id="collapse_calculate_annual_income_you">
<div>
The Federal Child Support Guidelines, Step-by-Step Guide has a
{% 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/w1-f1.html#s1" link_text="worksheet" %}
you can use to
help calculate your annual income. Step-by-step instructions are also detailed in 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/step5-etap5.html#h7" link_text="Step-by-Step Guide" %}
.
</div>
</div>
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="fact_c_annual_gross_income" name="annual_gross_income" class="fact-sheet-input money" readonly="" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
<p>What is the 'Guideline' amount for child support payable by you (as per
{% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-11.html#h-15" link_text="Federal Child Support Tables" %}
)?
</p>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_claimant_amounts" %}
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field id="fact_c_your_child_support_paid" name="your_child_support_paid_c" class="fact-sheet-input money claimants-child-support-paid determine-payor" data_calc_delta="true" data_delta_term_selector=".claimants-child-support-paid" data_delta_target_selector="input[name=difference_payment_amounts_c]" %}
</div>
</td>
</tr>
<tr>
<td class="fact-sheet-question">
Difference between Guidelines table amounts
</td>
<td class="fact-sheet-answer" readonly>
<div class="dollar-prefix">
{% money_input_field id="difference_payment_amounts_c" name="difference_payment_amounts_c" class="fact-sheet-input different-payment-amounts" readonly="" %}
</div>
</td>
</tr>
</tbody>
</table>
</div>
{% if derived.show_fact_sheet_c %}
{% include "partials/fact_sheets/fact_sheet_c.html" %}
{% endif %}
<div class="question-well" id="who_is_payor">
<div class="question-well {% if child_support_payor_error %}error{% endif %}" id="who_is_payor">
{% money_input_field name="annual_gross_income" hidden="true" %}
{% money_input_field name="spouse_annual_gross_income" hidden="true" %}
<span id="__name_you" hidden>{{ name_you }}</span>
@ -391,6 +38,7 @@
payor<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
?
{% if child_support_payor_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
{% if derived.show_fact_sheet_b %}
<p>
@ -468,462 +116,15 @@
</div>
</div>
{% if derived.show_fact_sheet_d %}
{% include "partials/fact_sheets/fact_sheet_d.html" %}
{% endif %}
{% if children_of_marriage == 'YES' and 'NO' not in children_financial_support|load_json and number_children_over_19|integer > 0 %}
<div id="fact_sheet_d" class="question-well fact-sheets">
<h1>Child(ren) 19 Years or Older (Fact Sheet D)</h1>
<p>
Since you have previously indicated that you have a child/children 19 years of age or older for whom support
is claimed, you will need to answer the next set of questions.
</p>
<div class="question-well">
<p>
How many child(ren) are 19 years or older for whom you are asking for support?
</p>
<div>
{% input_field type="number" name="number_children_over_19_need_support" value="number_children_over_19" class="fact-sheet-input input-narrow positive-integer" readonly="" %}
</div>
</div>
<div class="question-well">
<p>
What would the child support amount be using the Federal Child Support Guidelines?
<b>This information is needed for the Judge. You will be able to indicate a different child support amount in a following step.</b>
</p>
<div>
{% if derived.show_fact_sheet_b or derived.show_fact_sheet_c %}
<div class="dollar-prefix">
{% money_input_field id="total_spouse_paid_child_support" name="total_spouse_paid_child_support" value=derived.guideline_amounts_difference_total class="fact-sheet-input money input-narrow form-block response-textbox" readonly="" %}
</div>
{% else %}
<div class="dollar-prefix">
{% money_input_field name="total_spouse_paid_child_support" value_src="payor_monthly_child_support_amount" class="fact-sheet-input money input-narrow form-block response-textbox" readonly="" %}
</div>
{% endif %}
</div>
{% include "partials/inline_question_determine_amount_to_pay.html" with collapse_target_id="collapse_calculate_amounts" %}
</div>
<div class="question-well-border-less">
<p>
Because you have a child(ren) 19 years or older, who may also be contributing to their own support, do you and your spouse agree that the monthly Guidelines table amount for child support is appropriate?
</p>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="agree_to_guideline_child_support_amount" class="fact-sheet-input" autocomplete="off" value="YES" data_target_id="enter_appropriate_amount" data_reveal_target="false" %}
Yes
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="agree_to_guideline_child_support_amount" class="fact-sheet-input" autocomplete="off" value="NO" data_target_id="enter_appropriate_amount" data_reveal_target="true" %}
No
</label>
</div>
<div id="enter_appropriate_amount" hidden>
<p>
What would be the appropriate amount?
</p>
<div class="dollar-prefix">
{% money_input_field name="appropriate_spouse_paid_child_support" class="fact-sheet-input money form-block response-textbox" %}
</div>
<p>
Please describe - Why do you think the court should approve your proposed amount?
</p>
<p>
Describe the condition, means, needs, and other circumstances of the child, and the financial
ability of
each parent to provide support to the child.
</p>
<div>
{% input_field type="textarea" name="suggested_child_support" class="fact-sheet-input form-control response-textarea" maxlength="500" rows="5" %}
</div>
</div>
</div>
</div>
{% endif %}
<div class="question-well fact-sheets" id="fact_sheet_f" hidden>
<h1>Income over $150,000 (Fact Sheet F)</h1>
<p>
Since you have previously indicated that the payor's income is over $150,000 you will need to provide
answers to the next set of questions. The child support guideline table you previously entered only goes
to $150,000. Income beyond that point requires a 2 stage calculation, the amount payable at $150,000 +
the amount payable on the income in excess of $150,000. This takes into account other factors such as
the financial ability of each parent, maintaining a certain quality of life, etc. It is no longer a
matter of there being money simply to look after the needs of the child, but rather the level of care
factoring in the family's lifestyle.
</p>
<p>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapseIncomeNeeded" aria-controls="collapseIncomeNeeded">
<div>
Whose income is needed?
</div>
</div>
</p>
<div class="collapse" id="collapseIncomeNeeded">
<div>
<p>
If the paying parent earns more than $150,000 per year, you may need to calculate both incomes.
The Federal Guidelines provide two options:
</p>
<ul style="list-style: none;">
<li>
<strong>Option 1</strong>: You can use the tables to determine the child support amount for the first $150,000. Then add
the percentage listed in the tables for the portion of income over $150,000. If you choose this
option, you would only need to calculate the paying parent’s income.
</li>
<li>
<strong>Option 2</strong>: You can use the tables to determine the child support amount for the first $150,000. You can
then determine an amount for the portion of income over $150,000 by looking at the condition,
means, needs and other circumstances of the child and the financial ability of each of you to
contribute. If you choose this option, you would need to calculate both incomes.
</li>
</ul>
<p>
In some cases:
</p>
<ul>
<li>
You may need to calculate your child’s income—for example, if the child is over the age of
majority and you are taking his or her financial means into consideration to determine a
child support amount.
</li>
<li>
You may need to calculate the income of every member of both households to compare the
standards of living if either of you is claiming undue hardship.
</li>
</ul>
<p>
Source: 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/step5-etap5.html#h7" link_text="Federal Child Support Guidelines" %}
Department of Justice
</p>
</div>
</div>
<div id="fact_sheet_f_table_1" class="question-well-border-less" hidden>
{% include "partials/fact_sheet_f_table.html" with table_id=1 claimant_id='you' %}
</div>
<div id="fact_sheet_f_table_2" class="question-well-border-less" hidden>
{% include "partials/fact_sheet_f_table.html" with table_id=2 claimant_id='spouse' %}
</div>
</div>
<div class="question-well">
<h3>Are you or your spouse claiming undue hardship?</h3>
<p>
The Child Support Guidelines tables contain the base amounts for child support. If you our your spouse feel
that the child support amount will not leave enough money, you can claim that you will suffer
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
title="
<b>Undue hardship</b>
<p>
Circumstances that show the amount of child support under the child support guidelines is too
high or low. Must create &quot;undue&quot; (exceptional, excessive or disproportionate) difficulty
for the person making the claim.
</p>
<p>
A term used by the Child Support Guidelines to describe circumstances when payment of the table
amount of child support would cause financial difficulty for the payor or the recipient, potentially
justifying an award of support in an amount different than the table amount. See &quot;child support,&quot;
&quot;Child Support Guidelines&quot; and &quot;table amount.&quot;
</p>
">
undue hardship<i class="fa fa-question-circle" aria-hidden="true"></i>.
</span>
</p>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="claiming_undue_hardship" autocomplete="off" value="YES" data_target_id="fact_sheet_e" data_reveal_target="true" %} YES
</label>
<label class="btn btn-radio">
{% input_field type="radio" name="claiming_undue_hardship" autocomplete="off" value="NO" data_target_id="fact_sheet_e" data_reveal_target="false" %} NO
</label>
</div>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
data-target="#collapse_undue_hardship_situations"
aria-controls="collapse_undue_hardship_situations">
<div>
What situations are considered to be undue hardship?
</div>
</div>
<div class="collapse" id="collapse_undue_hardship_situations">
<div>
<p>The types of situations that might result in undue hardship include:</p>
<ul>
<li>having an unusual or excessive amount of debt,</li>
<li>having to make other support payments to children of another family (for example, from a previous marriage),</li>
<li>having to support a disabled or ill person, and</li>
<li>having to spend a lot of money to visit the child (for example, airfare to another city).</li>
</ul>
</div>
</div>
<div id="fact_sheet_e" class="question-well-border-less" hidden>
<h1>Fact Sheet E Undue Hardship</h1>
<p>
Since you have previously indicated that you will be claiming undue hardship you will need to provide
answers to the next set of questions. A claim for undue hardship can only be considered if the parent
making the claim can show that their household’s standard of living is not higher than the standard of
living in the household of the other parent. Often, income alone (which is all that is used to calculate
the guideline amount) does not reflect other circumstances that may impact a households’ finances.
</p>
<p><strong>Unusual or excessive debts</strong></p>
<p>
What are the unusual or excessive debts that you owe? These are debts that were taken on to support the family
before you separated (e.g. student loans). The debt can also be due to earning a living (e.g. vehicle,
specialized equipment).
</p>
<table id="claimant_debts" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Debt name</th>
<th class="table-bordered">What are the
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
title="
<b>Terms of this Debt</b>
<p>For example, how much is owed, what is the rate of interest,
when it must be repaid.</p>
">
terms of this debt<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>?
</th>
<th class="table-bordered">Monthly amount</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="debt-group" hidden>
{% include "partials/fact_sheet_excessive_debt.html" with debt_monthly_amount=0%}
</tr>
{% multiple_values_to_list source=claimant_debts as debts %}
{% for debt in debts %}
<tr class="debt-item-row">
{% include "partials/fact_sheet_excessive_debt.html" with debt_name=debt.debt_name debt_terms=debt.debt_terms debt_monthly_amount=debt.debt_monthly_amount %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-debt fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-debt"></i> Add Debt</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Unusually high expenses for parenting time, contact with, or access to a child.</strong></p>
<p>
For example, airfare and accommodation to visit the child in another city.
</p>
<table id="claimant_expenses" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Expense</th>
<th class="table-bordered">Amount</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="expense-group" hidden>
{% include "partials/fact_sheet_expense.html" with expense_amount=0%}
</tr>
{% multiple_values_to_list source=claimant_expenses as expenses %}
{% for expense in expenses %}
<tr class="expense-item-row">
{% include "partials/fact_sheet_expense.html" with expense_name=expense.expense_name expense_amount=expense.expense_amount %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-expense fact-sheet-control" colspan="2" readonly>
<a href=""><i class="fa fa-plus btn-add-expense"></i> Add Expense</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Supporting another person</strong></p>
<p>
Legal duty to support any other person, such as a former spouse or a new spouse who is too ill or disabled to be able to support himself or herself.
</p>
<table id="supporting_non_dependents" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Name of person</th>
<th class="table-bordered">Relationship</th>
<th class="table-bordered">Describe reason(s) for support</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="supporting-non-dependent-group" hidden>
{% include "partials/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" %}
</tr>
{% multiple_values_to_list source=supporting_non_dependents as non_dependents %}
{% for non_dependent in non_dependents %}
<tr class="supporting-non-dependent-item-row">
{% include "partials/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" name=non_dependent.non_dependent_name relationship=non_dependent.non_dependent_relationship reason=non_dependent.non_dependent_reason %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-supporting-non-dependent fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-supporting-non-dependent"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Supporting dependent child/children from another relationship.</strong></p>
<p>
List the names of any other children for whom you have a legal duty to make support payments to.
Do not include the names of any children for whom you are asking for support for as a part of this
divorce application.
</p>
<table id="supporting_dependents" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Child's name</th>
<th class="table-bordered">Relationship</th>
<th class="table-bordered">Describe reason(s) for support</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="supporting-dependent-group" hidden>
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" %}
</tr>
{% multiple_values_to_list source=supporting_dependents as dependents %}
{% for dependent in dependents %}
<tr class="supporting-dependent-item-row">
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" name=dependent.supporting_dependent_name relationship=dependent.supporting_dependent_relationship reason=dependent.supporting_dependent_reason %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-supporting-dependent fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-supporting-dependent"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<p><strong>Support for a disabled or ill person.</strong></p>
<table id="supporting_disabled" class="list-builder">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Name of person</th>
<th class="table-bordered">Relationship</th>
<th class="table-bordered">Describe reason(s) for support</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="supporting-disabled-group" hidden>
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" save_selector=".supporting-disabled-input-field" %}
</tr>
{% multiple_values_to_list source=supporting_disabled as dependents %}
{% for dependent in dependents %}
<tr class="supporting-disabled-item-row">
{% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" name=dependent.supporting_disabled_name relationship=dependent.supporting_disabled_relationship reason=dependent.supporting_disabled_reason save_selector=".supporting-disabled-input-field" %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="btn-add-supporting-disabled fact-sheet-control" colspan="3" readonly>
<a href=""><i class="fa fa-plus btn-add-supporting-disabled"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<p class="fact-sheet-table-inline-question">
Other undue hardship circumstances
{% input_field type="textarea" name="undue_hardship" value="" maxlength="500" multiple='true' class="fact-sheet-input form-control response-textarea" placeholder="" %}
</p>
<p><strong>Income of Other Persons in Household</strong></p>
<p>
Enter the name (s) and income for any other persons in your household (e.g. co-parent, step parent)
who have a
<span class="tooltip-link"
data-toggle="tooltip"
data-placement="right"
data-html="true"
title="<b>Duty to support</b><br />
Parents and guardians have a responsibility (duty) under the law to financially support their
children, whether or not they see or take care of the children. A parent, for the purposes
of child support, may include a stepparent if they were living together, in a relationship,
with the child’s parent and the child during the child’s life. The duty of a stepparent or
non-parent guardian to provide support is secondary to that of the child’s parents.">
duty to support<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
a child.
</p>
<table id="income_others" class="list-builder list-builder-compact">
<thead>
<tr class="list-builder-header">
<th class="table-bordered">Name of person</th>
<th class="table-bordered">Annual income</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="income-others-group" hidden>
{% include "partials/fact_sheet_income_others.html" with income_others_amount=0%}
</tr>
{% multiple_values_to_list source=income_others as incomes %}
{% for income in incomes %}
<tr class="income-others-item-row">
{% include "partials/fact_sheet_income_others.html" with income_others_name=income.income_others_name income_others_amount=income.income_others_amount %}
</tr>
{% endfor %}
</tbody>
<tbody>
<tr>
<td class="table-bordered">
Total
</td>
<td class="fact-sheet-answer table-bordered" readonly>
<div class="dollar-prefix">
{% money_input_field id="total_income_others" class="fact-sheet-input money" readonly="" %}
</div>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="btn-add-income-others fact-sheet-control" colspan="2" readonly>
<a href="" tabindex="-1"><i class="fa fa-plus btn-add-income-others"></i> Add Person</a>
</td>
</tr>
</tbody>
</table>
<div id="undue_amount_question" hidden></div>
</div>
</div>
{% if derived.show_fact_sheet_f %}
{% include "partials/fact_sheets/fact_sheet_f.html" %}
{% endif %}
{% include "partials/fact_sheets/fact_sheet_e.html" %}
{% endblock %}


+ 26
- 22
edivorce/apps/core/templates/question/06_children_income_expenses.html View File

@ -9,8 +9,8 @@
{% block content %}
<h1><small>Step {% step_order step="children" %}:</small>Children - Income & expenses</h1>
<div class="question-well">
<h3>How will you and your spouse be determining your income?</h3>
<div class="question-well {% if how_will_calculate_income_error %}error{% endif %}">
<h3>How will you and your spouse be determining your income?{% if how_will_calculate_income_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>Under the Federal Guidelines, you can do one of the following:</p>
<div class="radio">
@ -107,8 +107,8 @@
</div>
<div id="annual_gross_income_question">
<div class="question-well">
<h3>What is your annual gross income as determined above?</h3>
<div class="question-well {% if annual_gross_income_error %}error{% endif %}">
<h3>What is your annual gross income as determined above?{% if annual_gross_income_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="dollar-prefix">
{% money_input_field name="annual_gross_income" value="" class="money form-block response-textbox positive-float" %}
</div>
@ -133,8 +133,8 @@
</div>
</div>
<div class="question-well">
<h3>What is your spouse's annual gross income as determined above?</h3>
<div class="question-well {% if spouse_annual_gross_income_error %}error{% endif %}">
<h3>What is your spouse's annual gross income as determined above?{% if spouse_annual_gross_income_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="dollar-prefix">
{% money_input_field name="spouse_annual_gross_income" value="" class="money form-block response-textbox positive-float" %}
</div>
@ -161,11 +161,11 @@
</div>
<input type="text" name="__claimant_children" value="{{ claimant_children }}" hidden >
<div class="question-well" id="monthly_amount_question" hidden>
{% if derived.sole_custody %}
<div class="question-well {% if payor_monthly_child_support_amount_error %}error{% endif %}" id="monthly_amount_question">
<h3>What is the monthly child support amount (as per
<a href="http://laws-lois.justice.gc.ca/eng/regulations/SOR-97-175/page-5.html#h-9" target="_blank">Schedule 1</a>
of the guidelines) that is payable?</h3>
of the guidelines) that is payable?{% if payor_monthly_child_support_amount_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="dollar-prefix">
{% money_input_field name="payor_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block" data_mirror="true" data_mirror_target="#child_support_amount_label" %}
</div>
@ -258,8 +258,9 @@
</div>
</div>
</div>
{% endif %}
<div class="question-well">
<div class="question-well {% if special_extraordinary_expenses_error %}error{% endif %}">
<h3>
Are you claiming any
<span class="tooltip-link"
@ -275,7 +276,7 @@
</p>
">
special and extraordinary expenses<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>?
</span>?{% if special_extraordinary_expenses_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<p>
<strong>NOTE: If you have a Separation Agreement or Court Order that deals with special and extraordinary expenses, you may wish NOT to select this option.</strong>
@ -305,9 +306,12 @@
</div>
<div id="fact_sheet_a" class="fact-sheets" hidden>
<div class="question-well">
<h1>Special or Extraordinary Expenses (Fact Sheet A)</h1>
<div class="question-well {% if derived.special_expenses_missing_error %}error{% endif %}">
<h1>Special or Extraordinary Expenses (Fact Sheet A){% if derived.special_expenses_missing_error %}{% include 'partials/required.html' %}{% endif %}</h1>
<p>Since you have indicated that there are special or extraordinary expenses, we need you to answer the next set of questions.</p>
{% if derived.special_expenses_missing_error %}<p class="warning">
* At least one of these values must be greater than 0
</p>{% endif %}
<table class="table table-bordered">
<thead>
<tr>
@ -322,7 +326,7 @@
</td>
<td class="fact-sheet-answer table-bordered">
<div class="dollar-prefix">
{% money_input_field name="child_care_expenses" id="child_care_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#child_care_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" %}
{% money_input_field name="child_care_expenses" id="child_care_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#child_care_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer">
@ -337,7 +341,7 @@
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="children_healthcare_premiums" id="children_healthcare_premiums_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#children_healthcare_premiums_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" %}
{% money_input_field name="children_healthcare_premiums" id="children_healthcare_premiums_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#children_healthcare_premiums_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer">
@ -362,7 +366,7 @@
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="health_related_expenses" id="health_related_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#health_related_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" %}
{% money_input_field name="health_related_expenses" id="health_related_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#health_related_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer">
@ -387,7 +391,7 @@
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="extraordinary_educational_expenses" id="extraordinary_educational_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#extraordinary_educational_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" %}
{% money_input_field name="extraordinary_educational_expenses" id="extraordinary_educational_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#extraordinary_educational_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer">
@ -401,7 +405,7 @@
<td class="fact-sheet-question">Post-secondary school expenses</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="post_secondary_expenses" id="post_secondary_expenses_month" class="fact-sheet-input extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#post_secondary_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" %}
{% money_input_field name="post_secondary_expenses" id="post_secondary_expenses_month" class="fact-sheet-input extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#post_secondary_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer">
@ -428,7 +432,7 @@
</td>
<td class="fact-sheet-answer">
<div class="dollar-prefix">
{% money_input_field name="extraordinary_extracurricular_expenses" id="extraordinary_extracurricular_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#extraordinary_extracurricular_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" %}
{% money_input_field name="extraordinary_extracurricular_expenses" id="extraordinary_extracurricular_expenses_month" class="fact-sheet-input money extraordinary-expense-monthly positive-float" data_mirror_on_pressed="true" data_mirror_target="#extraordinary_extracurricular_expenses_year" data_mirror_scale="year_up" data_mirror_broadcast_change="true" ignore_error=True %}
</div>
</td>
<td class="fact-sheet-answer">
@ -513,9 +517,9 @@
</tbody>
</table>
</div>
<div class="question-well">
<h3>Please describe the order you are asking for regarding Special and Extraordinary Expenses</h3>
<div class="question-well {% if describe_order_special_extra_expenses_error %}error{% endif %}">
<h3>Please describe the order you are asking for regarding Special and Extraordinary Expenses{% if describe_order_special_extra_expenses_error %}
{% include 'partials/required.html' %}{% endif %}</h3>
<p>
If you're not sure how to write what you are asking for, you can refer to section "G" of the
<a href="http://www.courts.gov.bc.ca/supreme_court/practice_and_procedure/family_law_orders/picklist_family_orders.pdf" target="_blank">


+ 11
- 8
edivorce/apps/core/templates/question/06_children_payor_medical.html View File

@ -15,8 +15,9 @@
<input name="claimant_children" value="{{ claimant_children }}" title="claimant_children" hidden />
</div>
<div class="question-well">
<h3>Is medical coverage available for the children?</h3>
<div class="question-well {% if medical_coverage_available_error %}error{% endif %}">
<h3>Is medical coverage available for the children? {% if medical_coverage_available_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="medical_coverage_available" autocomplete="off" value="YES" data_target_id="who_plan_is_coverage_under" data_reveal_class="true" data_reveal_target="true" %} Yes
@ -28,8 +29,8 @@
</div>
</div>
<div class="question-well" id="who_plan_is_coverage_under" hidden>
<h3>Whose plan is the coverage under?</h3>
<div class="question-well {% if whose_plan_is_coverage_under_error %}error{% endif %}" id="who_plan_is_coverage_under" hidden>
<h3>Whose plan is the coverage under? {% if whose_plan_is_coverage_under_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<p>Please check all that apply:</p>
<div class="checkbox-group">
<div class="checkbox"><label>{% input_field type="checkbox" name="whose_plan_is_coverage_under" value="My plan" %} My plan</label></div>
@ -37,7 +38,7 @@
</div>
</div>
<div class="question-well">
<div class="question-well {% if child_support_payments_in_arrears_error %}error{% endif %}">
<h3>Are there any child support payments (
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
@ -47,7 +48,9 @@
">
in arrears <i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
) that have not been paid (as of today's date) under an existing order or written agreement?</h3>
) that have not been paid (as of today's date) under an existing order or written agreement?
{% if child_support_payments_in_arrears_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="child_support_payments_in_arrears" autocomplete="off" value="YES" data_target_id="arrears_amount_question" data_reveal_target="true" %} Yes
@ -58,8 +61,8 @@
</label>
</div>
</div>
<div class="question-well" id="arrears_amount_question" hidden>
<h3>What is the amount as of today's date?</h3>
<div class="question-well {% if child_support_arrears_amount_error %}error{% endif %}" id="arrears_amount_question" hidden>
<h3>What is the amount as of today's date? {% if child_support_arrears_amount_error %}{% include 'partials/required.html' %}{% endif %}</h3>
<div class="dollar-prefix">
{% money_input_field name="child_support_arrears_amount" class="money positive-float form-control input-narrow" min="0" %}
</div>


+ 37
- 21
edivorce/apps/core/templates/question/06_children_what_for.html View File

@ -11,7 +11,7 @@
{% block content %}
<h1><small>Step {% step_order step="children" %}:</small>Children - What are you asking for</h1>
<div class="question-well">
<div class="question-well {% if child_support_in_order_error or child_support_in_order_reason_error %}error{% endif %}">
<h3>What is the monthly child support amount
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
@ -25,6 +25,7 @@
proposed in the order<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
to be paid by {% payorize %}?
{% if child_support_in_order_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="radio">
<label class="radio-with-textbox">
@ -85,9 +86,11 @@
<div class="radio">
{% if 'Child support' in want_which_orders|load_json %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %}We are not asking for child support to be included in the order</label>
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %}
We are not asking for child support to be included in the order</label>
{% else %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" disabled="" checked="" %}We are not asking for child support to be included in the order</label>
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" data_no_child_order="true" disabled="" %}
We are not asking for child support to be included in the order</label>
<div class="information-message bg-danger">
<p>This option has been automatically selected for you because you indicated in Step 1 you didn't want an "Order pertaining to children"</p>
</div>
@ -99,8 +102,10 @@
</div>
</div>
<div class="question-well support-amount-match hide-grouping" id="amount_does_not_match" hidden>
<h3>Do you and the other parent agree (have consented) on the child support amount?</h3>
<div class="question-well support-amount-match hide-grouping {% if claimants_agree_to_child_support_amount_error %}error{% endif %}" id="amount_does_not_match" hidden>
<h3>Do you and the other parent agree (have consented) on the child support amount?
{% if claimants_agree_to_child_support_amount_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="claimants_agree_to_child_support_amount" value="YES" data_target_id="what_special_provisions" data_reveal_target="false" %} Yes
@ -111,13 +116,15 @@
</div>
</div>
<div class="question-well hide-grouping support-amount-match" id="what_special_provisions" hidden>
<h3>What special provisions have been made?</h3>
<div class="question-well hide-grouping support-amount-match {% if child_support_payment_special_provisions_error %}error{% endif %}" id="what_special_provisions" hidden>
<h3>What special provisions have been made?{% if child_support_payment_special_provisions_error %}{% include 'partials/required.html' %}{% endif %}</h3>
{% input_field type="textarea" name="child_support_payment_special_provisions" class="response-textarea form-control" tabindex="-1" maxlength="1000" rows="3" %}
</div>
<div class="question-well">
<h3>Do you have a separation agreement that sets out what you've agreed to around parenting and child support?</h3>
<div class="question-well {% if have_separation_agreement_error %}error{% endif %}">
<h3>Do you have a separation agreement that sets out what you've agreed to around parenting and child support?
{% if have_separation_agreement_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="have_separation_agreement" autocomplete="off" value="YES" data_target_id="separation_agreement" data_reveal_target="true" %} Yes
@ -208,7 +215,7 @@
</div>
<div class="question-well">
<div class="question-well {% if have_court_order_error %}error{% endif %}">
<h3>Do you already have a child support
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
@ -220,7 +227,9 @@
</p>
">
order <i class="fa fa-question-circle" aria-hidden="true"></i>
</span>in Provincial or Supreme Court?</h3>
</span>in Provincial or Supreme Court?
{% if have_court_order_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
{% input_field type="radio" name="have_court_order" autocomplete="off" value="YES" data_target_id="court_order_details" data_reveal_target="true" %} Yes
@ -259,8 +268,10 @@
</div>
<div class="question-well">
<h3>The court needs to know what the current parenting arrangements are for the children of the marriage. Please describe below.</h3>
<div class="question-well {% if what_parenting_arrangements_error %}error{% endif %}">
<h3>The court needs to know what the current parenting arrangements are for the children of the marriage. Please describe below.
{% if what_parenting_arrangements_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false" data-target="#collapse_parenting_arrangement" aria-controls="collapse_parenting_arrangement">
<div>
What should we consider when determining parenting arrangements?
@ -300,8 +311,7 @@
{% input_field type="textarea" name="what_parenting_arrangements" class="response-textarea form-control" maxlength="20000" rows="7"%}
</div>
{% if 'Child support' in want_which_orders|load_json %}
<div class="question-well">
<div class="question-well {% if want_parenting_arrangements_error %}error{% endif %}">
<h3>Are you asking the court for an
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
@ -317,6 +327,7 @@
">
order about parenting arrangements or contact <i class="fa fa-question-circle" aria-hidden="true"></i>
</span> with a child?
{% if want_parenting_arrangements_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="btn-radio-group" data-toggle="buttons">
<label class="btn btn-radio">
@ -329,8 +340,10 @@
</div>
</div>
<div class="question-well" id="parenting_arrangement_detail" hidden>
<h3>Please indicate the parenting arrangements you are asking for below.</h3>
<div class="question-well {% if order_respecting_arrangement_error %}error{% endif %}" id="parenting_arrangement_detail" hidden>
<h3>Please indicate the parenting arrangements you are asking for below.
{% if order_respecting_arrangement_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<p>
You need to include each of the orders you want pertaining to guardianship, parental responsibilities and
parenting time, and contact with the child. You will need to write them as if a Judge is telling you to do it.
@ -353,8 +366,8 @@
</blockquote>
{% input_field type="textarea" name="order_respecting_arrangement" class="response-textarea form-control" maxlength="20000" rows="7"%}
</div>
<div class="question-well" id="child_support_description">
{% if 'Child support' in want_which_orders|load_json %}
<div class="question-well {% if order_for_child_support_error %}error{% endif %}" id="child_support_description">
<h3>If you are asking for an
<span class="tooltip-link"
data-toggle="tooltip" data-placement="right" data-html="true"
@ -367,6 +380,7 @@
order for child support<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
please describe what you are asking for.
{% if order_for_child_support_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<p>
Child support is determined according to the federal government’s
@ -400,8 +414,10 @@
{% endif %}
{# DIV-963: Show/hide logic and text update will be handled by JavaScript function updateChildSupportActQuestion() #}
<div class="question-well" id="child_support_act" {% if 'Child support' in want_which_orders|load_json %}data-want_child_order="true"{% endif %}>
<h3 id="child_support_act_question">Please indicate which act(s) you are asking for child support under.</h3>
<div class="question-well {% if child_support_act_error %}error{% endif %}" id="child_support_act" {% if 'Child support' in want_which_orders|load_json %}data-want_child_order="true"{% endif %}>
<h3><span id="child_support_act_question">Please indicate which act(s) you are asking for child support under.</span>
{% if child_support_act_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
<div class="checkbox-group">
<div class="checkbox">
<label>


+ 11
- 7
edivorce/apps/core/templates/question/06_children_your_children.html View File

@ -52,7 +52,9 @@
and how they will spend time with each parent.
</p>
{% endif %}
<div class="question-well children-list">
<div class="question-well children-list {% if claimant_children_error %}error{% endif %}">
<p class="warning">* You have indicated that you have children of the marriage. This includes children under and over the age of 19. Their details
must be added below.</p>
<table id="claimant_children" class="list-builder">
<thead>
<tr>
@ -82,7 +84,9 @@
<tbody>
<tr>
<td id="btn_add_child" class="btn-add-child fact-sheet-control" colspan="5" readonly>
<a href="#add"><i class="fa fa-plus btn-add-child"></i> Add Child</a>
<a href="#add"><i class="fa fa-plus btn-add-child"></i> Add Child{% if claimant_children_error %}
{% include 'partials/required.html' with hidden=True %}{% endif %}
</a>
</td>
</tr>
</tbody>
@ -92,7 +96,7 @@
<div class="children-questions" hidden>
<div class="question-well">
<h3>What is your child's name?</h3>
<h3>What is your child's name?{% include 'partials/required.html' with hidden=True %}</h3>
<p>Enter full name</p>
<span class="form-group">
{% input_field type="text" name="child_name" class="form-block input-wide response-textbox children-input-block name" id="childs_name" placeholder="First, Middle, Last Name" data_mirror="true" data_mirror_target="#child_name_0" data_skip_ajax="true" %}
@ -101,7 +105,7 @@
<div class="question-well">
<h3>What is your child's date of birth?</h3>
<h3>What is your child's date of birth?{% include 'partials/required.html' with hidden=True %}</h3>
<p>
<span class="input-group date date-picker-group">
{% input_field type="text" name="child_birth_date" class="date-picker form-control children-input-block" id="childs_birth_date" placeholder="MMM D, YYYY" data_mirror="true" data_mirror_target="#child_birth_date_0" data_skip_ajax="true" %}
@ -113,7 +117,7 @@
</div>
<div class="question-well">
<h3>Where/whom does this child currently live with?</h3>
<h3>Where/whom does this child currently live with?{% include 'partials/required.html' with hidden=True %}</h3>
<p>Please select one</p>
<div class="radio">
<label class="tight-spacing">
@ -168,7 +172,7 @@
</div>
<div class="question-well">
<h3>What is your relationship to this child?</h3>
<h3>What is your relationship to this child?{% include 'partials/required.html' with hidden=True %}</h3>
<div class="radio">
<label>{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_you" value="Natural child" data_mirror="true" data_mirror_target="#child_relationship_you_0" data_skip_ajax="true" %}Natural
child</label>
@ -235,7 +239,7 @@
</div>
<div class="question-well">
<h3>What is your spouse's relationship to this child?</h3>
<h3>What is your spouse's relationship to this child?{% include 'partials/required.html' with hidden=True %}</h3>
<div class="radio">
<label>{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_spouse" value="Natural child" data_mirror="true" data_mirror_target="#child_relationship_spouse_0" data_skip_ajax="true" %}Natural
child</label>


+ 6
- 0
edivorce/apps/core/templatetags/format_utils.py View File

@ -177,6 +177,12 @@ def lookup(obj, property):
return obj.get(property, '')
@register.simple_tag(takes_context=True)
def lookup_context(context, property):
""" Return the value of a dynamic property from context"""
return context.get(property, '')
@register.simple_tag(takes_context=True)
def agreed_child_support_amount(context, claimant_id, line_breaks=True):
"""Return the agree amount for the specific claimant fact sheet table."""


+ 9
- 3
edivorce/apps/core/templatetags/input_field.py View File

@ -10,7 +10,7 @@ register = template.Library()
@register.simple_tag(takes_context=True)
def money_input_field(context, input_type='number', name='', value_src=None, value='', scale_factor=None, **kwargs):
def money_input_field(context, input_type='number', name='', value_src=None, value='', scale_factor=None, ignore_error=False, **kwargs):
"""
:param context:
@ -22,6 +22,12 @@ def money_input_field(context, input_type='number', name='', value_src=None, val
:param kwargs:
:return:
"""
error = context.get(name + '_error', False)
if error and not ignore_error:
if 'class' in kwargs:
kwargs['class'] += ' error'
else:
kwargs['class'] = 'error'
if value == '':
if value_src is None:
value = context.get(name, 0.0)
@ -59,12 +65,12 @@ def money_input_field(context, input_type='number', name='', value_src=None, val
@register.simple_tag(takes_context=True)
def input_field(context, type, name='', value='', multiple='', **kwargs):
def input_field(context, type, name='', value='', multiple='', ignore_error=False, **kwargs):
"""
Usage: when specifying data attributes in templates, use "data_" instead of "data-".
"""
error = context.get(name + '_error', False)
if error:
if error and not ignore_error:
if 'class' in kwargs:
kwargs['class'] += ' error'
else:


+ 140
- 390
edivorce/apps/core/tests.py View File

@ -3,592 +3,342 @@ from edivorce.apps.core.models import UserResponse, Question, BceidUser
from edivorce.apps.core.utils.step_completeness import is_complete
from edivorce.apps.core.utils.question_step_mapping import question_step_mapping
# Create your tests here.
from edivorce.apps.core.utils.user_response import get_data_for_user, get_step_responses
class UserResponseTestCase(TestCase):
fixtures = ['Question.json']
def setUp(self):
BceidUser.objects.create(user_guid='1234')
self.user = BceidUser.objects.create(user_guid='1234')
def check_completeness(self, step):
responses_dict = get_data_for_user(self.user)
responses_dict_by_step = get_step_responses(responses_dict)
return is_complete(responses_dict_by_step[step])
def create_response(self, question, value):
UserResponse.objects.create(bceid_user=self.user, question=Question.objects.get(key=question), value=value)
def test_which_order(self):
step = 'which_orders'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required question
create_response(user, 'want_which_orders', '["nothing"]')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('want_which_orders', '["nothing"]')
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='want_which_orders').update(value="[]")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
def test_your_info(self):
step = 'your_information'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Testing required questions
# Missing few required questions
create_response(user, 'name_you', 'John Doe')
create_response(user, 'last_name_before_married_you', 'Jackson')
create_response(user, 'birthday_you', '11/11/1111')
create_response(user, 'occupation_you', 'Plumber')
self.create_response('name_you', 'John Doe')
self.create_response('last_name_before_married_you', 'Jackson')
self.create_response('birthday_you', '11/11/1111')
self.create_response('occupation_you', 'Plumber')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Few required questions with one checking question with hidden question not shown
create_response(user, 'lived_in_bc_you', '11/11/1111')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('lived_in_bc_you', '11/11/1111')
self.assertEqual(self.check_completeness(step), False)
# All required questions with one checking question with hidden question not shown
create_response(user, 'last_name_born_you', 'Jackson')
self.create_response('last_name_born_you', 'Jackson')
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# All required questions with one checking question with hidden question missing
UserResponse.objects.filter(question_id='lived_in_bc_you').update(value="Moved to B.C. on")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions with one checking question with hidden question
create_response(user, 'moved_to_bc_date_you', '12/12/1212')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('moved_to_bc_date_you', '12/12/1212')
self.assertEqual(self.check_completeness(step), False)
# All required questions with two checking question with one hidden and one shown
create_response(user, 'any_other_name_you', 'NO')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('any_other_name_you', 'NO')
self.assertEqual(self.check_completeness(step), True)
# All required questions with two checking question with one hidden question missing
UserResponse.objects.filter(question_id='any_other_name_you').update(value="YES")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions with all checking question with all hidden questions
create_response(user, 'other_name_you', '[["also known as","Smith"]]')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('other_name_you', '[["also known as","Smith"]]')
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='other_name_you').update(value='[["",""]]')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
def test_your_spouse(self):
step = 'your_spouse'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Testing required questions
# Missing few required questions
create_response(user, 'name_spouse', 'John Doe')
create_response(user, 'last_name_before_married_spouse', 'Jackson')
create_response(user, 'birthday_spouse', '11/11/1111')
create_response(user, 'occupation_spouse', 'Electrician')
self.create_response('name_spouse', 'John Doe')
self.create_response('last_name_before_married_spouse', 'Jackson')
self.create_response('birthday_spouse', '11/11/1111')
self.create_response('occupation_spouse', 'Electrician')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Few required questions with one checking question with hidden question not shown
create_response(user, 'any_other_name_spouse', 'NO')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('any_other_name_spouse', 'NO')
self.assertEqual(self.check_completeness(step), False)
# All required questions with one checking question with hidden question not shown
create_response(user, 'last_name_born_spouse', 'Jackson')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('last_name_born_spouse', 'Jackson')
self.assertEqual(self.check_completeness(step), False)
# All required questions with one checking question with hidden question missing
UserResponse.objects.filter(question_id='any_other_name_spouse').update(value="YES")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions with one checking question with hidden question
create_response(user, 'lived_in_bc_spouse', 'Since birth')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('lived_in_bc_spouse', 'Since birth')
self.assertEqual(self.check_completeness(step), False)
# All required questions with two checking question with one hidden and one shown
create_response(user, 'other_name_spouse', '[["also known as","Smith"]]')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('other_name_spouse', '[["also known as","Smith"]]')
self.assertEqual(self.check_completeness(step), True)
# All required questions with two checking question with one hidden question missing
UserResponse.objects.filter(question_id='lived_in_bc_spouse').update(value="Moved to B.C. on")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions with all checking question with all hidden questions
create_response(user, 'moved_to_bc_date_spouse', '12/12/1212')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('moved_to_bc_date_spouse', '12/12/1212')
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='name_spouse').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Put empty response
UserResponse.objects.filter(question_id='other_name_spouse').update(value='[["",""]]')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
def test_your_marriage(self):
step = 'your_marriage'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Some required questions
create_response(user, 'when_were_you_live_married_like', '12/12/2007')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Some required questions
create_response(user, 'when_were_you_married', '12/12/2008')
self.create_response('when_were_you_live_married_like', '12/12/2007')
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('when_were_you_married', '12/12/2008')
self.assertEqual(self.check_completeness(step), False)
# Some required questions
create_response(user, 'marital_status_before_you', 'Never married')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('marital_status_before_you', 'Never married')
self.assertEqual(self.check_completeness(step), False)
# Some required questions
create_response(user, 'marital_status_before_spouse', 'Widowed')
self.create_response('marital_status_before_spouse', 'Widowed')
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Some required questions
create_response(user, 'where_were_you_married_city', 'Vancouver')
self.create_response('where_were_you_married_city', 'Vancouver')
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Some required questions
create_response(user, 'where_were_you_married_prov', 'BC')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('where_were_you_married_prov', 'BC')
self.assertEqual(self.check_completeness(step), False)
# All required questions
create_response(user, 'where_were_you_married_country', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('where_were_you_married_country', 'Canada')
self.assertEqual(self.check_completeness(step), True)
# All required questions but missing conditional question
UserResponse.objects.filter(question_id='where_were_you_married_country').update(value="Other")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions
create_response(user, 'where_were_you_married_other_country', 'Peru')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('where_were_you_married_other_country', 'Peru')
self.assertEqual(self.check_completeness(step), True)
def test_your_separation(self):
step = 'your_separation'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required question
create_response(user, 'no_reconciliation_possible', 'I agree')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('no_reconciliation_possible', 'I agree')
self.assertEqual(self.check_completeness(step), False)
# Put empty response
UserResponse.objects.filter(question_id='no_reconciliation_possible').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
def test_spousal_support(self):
step = 'spousal_support'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# One required question
create_response(user, 'spouse_support_details', 'I will support you')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('spouse_support_details', 'I will support you')
self.assertEqual(self.check_completeness(step), False)
# Two required questions
create_response(user, 'spouse_support_act', 'Family Law')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('spouse_support_act', 'Family Law')
self.assertEqual(self.check_completeness(step), True)
# Remove first added required response to test the second required question
UserResponse.objects.get(question_id='spouse_support_details').delete()
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Put empty response
UserResponse.objects.filter(question_id='spouse_support_details').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
def test_property_and_debt(self):
step = 'property_and_debt'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required question with no hidden shown
create_response(user, 'deal_with_property_debt', 'Equal division')
self.create_response('deal_with_property_debt', 'Equal division')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.assertEqual(self.check_completeness(step), True)
# All required question with hidden shown but no response
UserResponse.objects.filter(question_id='deal_with_property_debt').update(value="Unequal division")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Only one required question with hidden shown and answered
create_response(user, 'how_to_divide_property_debt', 'Do not divide them')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('how_to_divide_property_debt', 'Do not divide them')
# Only two required question with hidden shown and answered
# NOTE: want_other_property_claims not in use anymore
# create_response(user, 'want_other_property_claims', '["Ask for other property claims"]')
#
# lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
# self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), True)
# All required question with hidden shown and answered
create_response(user, 'other_property_claims', 'Want these property claims')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# Put empty response
# UserResponse.objects.filter(question_id='want_other_property_claims').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
# All required question with optional fields
self.create_response('other_property_claims', 'Want these property claims')
self.assertEqual(self.check_completeness(step), True)
def test_other_orders(self):
step = 'other_orders'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required question
self.create_response('name_change_you', 'NO')
self.assertEqual(self.check_completeness(step), False)
create_response(user, 'name_change_you', 'NO')
self.assertEqual(is_complete(step, lst)[0], False)
create_response(user, 'name_change_spouse', 'NO')
create_response(user, 'other_orders_detail', 'I want more orders')
self.create_response('name_change_spouse', 'NO')
self.create_response('other_orders_detail', 'I want more orders')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.assertEqual(self.check_completeness(step), True)
# make incomplete
UserResponse.objects.filter(question_id='name_change_spouse').update(value="YES")
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
create_response(user, 'name_change_spouse_fullname', 'new name')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('name_change_spouse_fullname', 'new name')
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='other_orders_detail').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.assertEqual(self.check_completeness(step), True)
def test_other_questions(self):
step = 'other_questions'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# One required question
create_response(user, 'address_to_send_official_document_street_you', '123 Cambie st')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# Two required question
create_response(user, 'address_to_send_official_document_city_you', 'Vancouver')
# Some required question
self.create_response('address_to_send_official_document_street_you', '123 Cambie st')
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_city_you', 'Vancouver')
self.assertEqual(self.check_completeness(step), False)
# Three required question
create_response(user, 'address_to_send_official_document_prov_you', 'BC')
self.create_response('address_to_send_official_document_prov_you', 'BC')
self.assertEqual(self.check_completeness(step), False)
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Four required question
create_response(user, 'address_to_send_official_document_country_you', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_country_you', 'Canada')
self.assertEqual(self.check_completeness(step), False)
# All required questions for you
create_response(user, 'address_to_send_official_document_postal_code_you', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_postal_code_you', 'Canada')
self.assertEqual(self.check_completeness(step), False)
# One required question for spouse
create_response(user, 'address_to_send_official_document_street_spouse', '123 Cambie st')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_street_spouse', '123 Cambie st')
self.assertEqual(self.check_completeness(step), False)
# Two required question for spouse
create_response(user, 'address_to_send_official_document_city_spouse', 'Vancouver')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_city_spouse', 'Vancouver')
self.assertEqual(self.check_completeness(step), False)
# Three required question for spouse
create_response(user, 'address_to_send_official_document_prov_spouse', 'BC')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_prov_spouse', 'BC')
self.assertEqual(self.check_completeness(step), False)
# Four required question for spouse
create_response(user, 'address_to_send_official_document_country_spouse', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.create_response('address_to_send_official_document_country_spouse', 'Canada')
self.assertEqual(self.check_completeness(step), False)
# All required questions
create_response(user, 'divorce_take_effect_on', 'the 31st day after the date of this order')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('divorce_take_effect_on', 'the 31st day after the date of this order')
self.assertEqual(self.check_completeness(step), True)
# Missing conditional required question
UserResponse.objects.filter(question_id='divorce_take_effect_on').update(value="specific date")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions
create_response(user, 'divorce_take_effect_on_specific_date', '12/12/2018')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('divorce_take_effect_on_specific_date', '12/12/2018')
self.assertEqual(self.check_completeness(step), True)
# All required questions for spouse and you
create_response(user, 'address_to_send_official_document_postal_code_spouse', 'Canada')
self.create_response('address_to_send_official_document_postal_code_spouse', 'Canada')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.assertEqual(self.check_completeness(step), True)
# All required questions for spouse and you with empty email(optional so still true)
create_response(user, 'address_to_send_official_document_email_you', 'a@example.com')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('address_to_send_official_document_email_you', 'a@example.com')
self.assertEqual(self.check_completeness(step), True)
# Testing other country missing
UserResponse.objects.filter(question_id='address_to_send_official_document_country_spouse').update(value="Other")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required questions
create_response(user, 'address_to_send_official_document_other_country_spouse', 'Mexico')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('address_to_send_official_document_other_country_spouse', 'Mexico')
self.assertEqual(self.check_completeness(step), True)
# Set Specific date on to empty
UserResponse.objects.filter(question_id='divorce_take_effect_on_specific_date').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value',
'question__conditional_target',
'question__reveal_response',
'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
def test_filing_locations(self):
step = 'filing_locations'
questions = question_step_mapping[step]
user = BceidUser.objects.get(user_guid='1234')
# No response should be False
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
self.assertEqual(self.check_completeness(step), False)
# All required question
create_response(user, 'court_registry_for_filing', 'Vancouver')
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], True)
self.create_response('court_registry_for_filing', 'Vancouver')
self.assertEqual(self.check_completeness(step), True)
# Put empty response
UserResponse.objects.filter(question_id='court_registry_for_filing').update(value="")
lst = UserResponse.objects.filter(question_id__in=questions).values('question_id', 'value', 'question__conditional_target', 'question__reveal_response', 'question__required')
self.assertEqual(is_complete(step, lst)[0], False)
# Helper functions
def create_response(user, question, value):
UserResponse.objects.create(bceid_user=user, question=Question.objects.get(key=question), value=value)
self.assertEqual(self.check_completeness(step), False)

+ 136
- 0
edivorce/apps/core/utils/conditional_logic.py View File

@ -0,0 +1,136 @@
import json
def get_children(questions_dict):
children_json = questions_dict.get('claimant_children', '[]')
if isinstance(children_json, dict):
children_json = children_json.get('value', '[]')
return json.loads(children_json)
def determine_sole_custody(questions_dict):
child_list = get_children(questions_dict)
return (all([child['child_live_with'] == 'Lives with you' for child in child_list]) or
all([child['child_live_with'] == 'Lives with spouse' for child in child_list]))
def determine_shared_custody(questions_dict):
child_list = get_children(questions_dict)
return any([child['child_live_with'] == 'Lives with both'
for child in child_list])
def determine_split_custody(questions_dict):
child_list = get_children(questions_dict)
with_you = 0
with_spouse = 0
with_both = 0
for child in child_list:
if child['child_live_with'] == 'Lives with you':
with_you += 1
elif child['child_live_with'] == 'Lives with spouse':
with_spouse += 1
elif child['child_live_with'] == 'Lives with both':
with_both += 1
return (with_you > 0 and (with_spouse + with_both > 0) or
with_spouse > 0 and (with_you + with_both > 0))
def determine_child_over_19_supported(questions_dict):
try:
children_over_19 = float(questions_dict.get('number_children_over_19', 0))
except ValueError:
children_over_19 = 0
support = json.loads(questions_dict.get('children_financial_support', '[]'))
has_children_of_marriage = questions_dict.get('children_of_marriage', '') == 'YES'
return (len(support) > 0 and children_over_19 > 0 and
'NO' not in support and has_children_of_marriage)
def determine_missing_undue_hardship_reasons(questions_dict):
claiming_undue_hardship = questions_dict.get('claiming_undue_hardship', '') == 'YES'
if claiming_undue_hardship:
at_least_one_of = ["claimant_debts", "claimant_expenses", "supporting_non_dependents", "supporting_dependents",
"supporting_disabled", "undue_hardship"]
for question in at_least_one_of:
value = questions_dict.get(question)
if value:
try:
items = json.loads(value)
for item in items:
for key in item:
if item[key]:
return False
except json.JSONDecodeError:
if value:
return False
return True
def determine_child_support_payor(questions_dict):
payor = questions_dict.get('child_support_payor', '')
if payor == 'Myself (Claimant 1)':
return 'Claimant 1'
elif payor == 'My Spouse (Claimant 2)':
return 'Claimant 2'
elif payor == 'Both myself and my spouse':
return 'both Claimant 1 and Claimant 2'
return ''
def determine_show_fact_sheet_f_you(questions_dict):
"""
If claimant 1 (you) is a payor and makes over $150,000/year, show fact sheet F for claimant 1
"""
payor = determine_child_support_payor(questions_dict)
try:
annual = float(questions_dict.get('annual_gross_income', 0))
except ValueError:
annual = 0
return (payor == 'Claimant 1' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000
def determine_show_fact_sheet_f_spouse(questions_dict):
"""
If claimant 2 (spouse) is a payor and makes over $150,000/year, show fact sheet F for claimant 2
"""
payor = determine_child_support_payor(questions_dict)
try:
annual = float(questions_dict.get('spouse_annual_gross_income', 0))
except ValueError:
annual = 0
return (payor == 'Claimant 2' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000
def determine_child_support_act_requirement(questions_dict):
orders_wanted = json.loads(questions_dict.get('want_which_orders', '[]'))
return 'Child support' in orders_wanted
def determine_missing_extraordinary_expenses(questions_dict):
special_expenses_keys = ["child_care_expenses",
"children_healthcare_premiums",
"health_related_expenses",
"extraordinary_educational_expenses",
"post_secondary_expenses",
"extraordinary_extracurricular_expenses"]
if questions_dict.get('special_extraordinary_expenses') == 'YES':
for special_expense in special_expenses_keys:
value = questions_dict.get(special_expense)
if value and value != '0.00':
return False
return True
else:
return False
def get_cleaned_response_value(response):
ignore_values = [None, '', '[]', '[["",""]]', '[["also known as",""]]']
if response not in ignore_values:
return response
return None

+ 108
- 69
edivorce/apps/core/utils/derived.py View File

@ -13,8 +13,17 @@ under the _derived_ key.
import json
from edivorce.apps.core.utils import conditional_logic
# This array is order sensitive: later functions may depend on values from
# earlier ones
from edivorce.apps.core.utils.conditional_logic import (
determine_child_support_payor,
determine_show_fact_sheet_f_spouse,
determine_show_fact_sheet_f_you,
determine_missing_extraordinary_expenses
)
DERIVED_DATA = [
'orders_wanted',
'children',
@ -26,12 +35,17 @@ DERIVED_DATA = [
'wants_other_orders',
'show_fact_sheet_a',
'show_fact_sheet_b',
'fact_sheet_b_error',
'show_fact_sheet_c',
'fact_sheet_c_error',
'show_fact_sheet_d',
'fact_sheet_d_error',
'show_fact_sheet_e',
'show_fact_sheet_f',
'fact_sheet_e_error',
'show_fact_sheet_f_you',
'show_fact_sheet_f_spouse',
'show_fact_sheet_f',
'fact_sheet_f_error',
'has_fact_sheets',
'child_support_payor_b',
'child_support_payor_c',
@ -71,6 +85,8 @@ DERIVED_DATA = [
'child_support_acts',
'pursuant_parenting_arrangement',
'pursuant_child_support',
'sole_custody',
'special_expenses_missing_error',
]
@ -149,9 +165,18 @@ def show_fact_sheet_b(responses, derived):
If any child lives with both parents, custody is shared, so Fact Sheet B
is indicated.
"""
return conditional_logic.determine_shared_custody(responses)
return any([child['child_live_with'] == 'Lives with both'
for child in derived['children']])
def fact_sheet_b_error(responses, derived):
questions = ['number_of_children',
'time_spent_with_you',
'time_spent_with_spouse',
'your_child_support_paid_b',
'your_spouse_child_support_paid_b',
]
if derived['show_fact_sheet_b']:
return _any_question_errors(responses, questions)
def show_fact_sheet_c(responses, derived):
@ -159,19 +184,17 @@ def show_fact_sheet_c(responses, derived):
If any child lives with one parent and there's another child who lives with
the other parent or is shared, Fact Sheet C is indicated.
"""
return conditional_logic.determine_split_custody(responses)
with_you = 0
with_spouse = 0
with_both = 0
for child in derived['children']:
if child['child_live_with'] == 'Lives with you':
with_you += 1
elif child['child_live_with'] == 'Lives with spouse':
with_spouse += 1
elif child['child_live_with'] == 'Lives with both':
with_both += 1
return (with_you > 0 and (with_spouse + with_both > 0) or
with_spouse > 0 and (with_you + with_both > 0))
def fact_sheet_c_error(responses, derived):
questions = ['number_of_children_claimant',
'determine_split_custody',
'number_of_children_claimant_spouse',
'your_child_support_paid_c',
]
if derived['show_fact_sheet_c']:
return _any_question_errors(responses, questions)
def show_fact_sheet_d(responses, derived):
@ -179,15 +202,13 @@ def show_fact_sheet_d(responses, derived):
If a claimaint is claiming financial support for a child of the marriage
over 19, Fact Sheet D is indicated.
"""
return conditional_logic.determine_child_over_19_supported(responses)
try:
children_over_19 = float(responses.get('number_children_over_19', 0))
except ValueError:
children_over_19 = 0
support = json.loads(responses.get('children_financial_support', '[]'))
return (len(support) > 0 and children_over_19 > 0 and
'NO' not in support and has_children_of_marriage(responses, derived))
def fact_sheet_d_error(responses, derived):
questions = ['agree_to_guideline_child_support_amount', 'appropriate_spouse_paid_child_support', 'suggested_child_support']
if derived['show_fact_sheet_d']:
return _any_question_errors(responses, questions)
def show_fact_sheet_e(responses, derived):
@ -198,54 +219,59 @@ def show_fact_sheet_e(responses, derived):
return responses.get('claiming_undue_hardship', '') == 'YES'
def show_fact_sheet_f(responses, derived):
"""
If one of the claimants earns over $150,000, Fact Sheet F is indicated.
"""
return show_fact_sheet_f_you(responses, derived) or show_fact_sheet_f_spouse(responses, derived)
def fact_sheet_e_error(responses, derived):
return conditional_logic.determine_missing_undue_hardship_reasons(responses)
def show_fact_sheet_f_you(responses, derived):
"""
:param responses:
:param derived:
:return:
"""
payor = child_support_payor(responses, derived)
return determine_show_fact_sheet_f_you(responses)
try:
annual = float(responses.get('annual_gross_income', 0))
except ValueError:
annual = 0
return (payor == 'Claimant 1' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000
def show_fact_sheet_f_spouse(responses, derived):
return determine_show_fact_sheet_f_spouse(responses)
def show_fact_sheet_f_spouse(responses, derived):
def show_fact_sheet_f(responses, derived):
"""
:param responses:
:param derived:
:return:
If one of the claimants earns over $150,000, Fact Sheet F is indicated.
"""
payor = child_support_payor(responses, derived)
return derived['show_fact_sheet_f_you'] or derived['show_fact_sheet_f_spouse']
try:
annual = float(responses.get('spouse_annual_gross_income', 0))
except ValueError:
annual = 0
return (payor == 'Claimant 2' or payor == 'both Claimant 1 and Claimant 2') and annual > 150000
def fact_sheet_f_error(responses, derived):
"""
Helper to see if there are any errors for missing required fields
"""
fields_for_you = ['number_children_seeking_support_you',
'child_support_amount_under_high_income_you',
'percent_income_over_high_income_limit_you',
'amount_income_over_high_income_limit_you',
'agree_to_child_support_amount_you',
'agreed_child_support_amount_you',
'reason_child_support_amount_you',
]
fields_for_spouse = ['number_children_seeking_support_spouse',
'child_support_amount_under_high_income_spouse',
'percent_income_over_high_income_limit_spouse',
'amount_income_over_high_income_limit_spouse',
'agree_to_child_support_amount_spouse',
'agreed_child_support_amount_spouse',
'reason_child_support_amount_spouse']
if show_fact_sheet_f_you(responses, derived):
if _any_question_errors(responses, fields_for_you):
return True
if show_fact_sheet_f_spouse(responses, derived):
if _any_question_errors(responses, fields_for_spouse):
return True
def has_fact_sheets(responses, derived):
""" Return whether or not the user is submitting fact sheets """
return any([derived['show_fact_sheet_b'], derived['show_fact_sheet_c'],
derived['show_fact_sheet_d'], derived['show_fact_sheet_e'],
derived['show_fact_sheet_f'], ])
def child_support_payor_b(responses, derived):
""" Return who the payor is depends on the monthly amount from Factsheet B """
try:
@ -263,10 +289,11 @@ def child_support_payor_b(responses, derived):
elif amount_1 < amount_2:
payor = 'spouse'
else:
payor = 'both'
payor = 'both'
return payor
def child_support_payor_c(responses, derived):
""" Return who the payor is depends on the monthly amount from Factsheet C """
try:
@ -284,10 +311,11 @@ def child_support_payor_c(responses, derived):
elif amount_1 < amount_2:
payor = 'spouse'
else:
payor = 'both'
payor = 'both'
return payor
def guideline_amounts_difference_b(responses, derived):
"""
Return the difference between the guideline amounts to be paid by
@ -306,6 +334,7 @@ def guideline_amounts_difference_b(responses, derived):
return abs(amount_1 - amount_2)
def guideline_amounts_difference_c(responses, derived):
"""
Return the difference between the guideline amounts to be paid by
@ -324,6 +353,7 @@ def guideline_amounts_difference_c(responses, derived):
return abs(amount_1 - amount_2)
def guideline_amounts_difference_total(responses, derived):
"""
Return the sum of the guideline amounts B and C
@ -338,14 +368,15 @@ def guideline_amounts_difference_total(responses, derived):
if payor_b == payor_c:
return amount_b + amount_c
else:
return abs(amount_b - amount_c)
return abs(amount_b - amount_c)
def schedule_1_amount(responses, derived):
""" Return the amount as defined in schedule 1 for child support """
try:
if derived['show_fact_sheet_b'] or derived['show_fact_sheet_c']:
return derived['guideline_amounts_difference_total']
return derived['guideline_amounts_difference_total']
else:
return float(responses.get('payor_monthly_child_support_amount', 0))
except ValueError:
@ -354,16 +385,7 @@ def schedule_1_amount(responses, derived):
def child_support_payor(responses, derived):
""" Return the payor phrased for the affidavit """
payor = responses.get('child_support_payor', '')
if payor == 'Myself (Claimant 1)':
return 'Claimant 1'
elif payor == 'My Spouse (Claimant 2)':
return 'Claimant 2'
elif payor == 'Both myself and my spouse':
return 'both Claimant 1 and Claimant 2'
return ''
return determine_child_support_payor(responses)
def child_support_payor_by_name(responses, derived):
@ -539,13 +561,11 @@ def total_monthly_support_1_and_a(responses, derived):
total += derived['total_section_seven_expenses']
return total
def total_child_support_payment_a(response, derived):
""" Return the total monthly child support payable by the payor for Fact Sheet A """
total = 0
sole_custody = (all([child['child_live_with'] == 'Lives with you' for child in derived['children']]) or
all([child['child_live_with'] == 'Lives with spouse' for child in derived['children']]))
if sole_custody:
if sole_custody(response, derived):
total += derived['schedule_1_amount']
else:
if derived['show_fact_sheet_b']:
@ -710,3 +730,22 @@ def pursuant_child_support(responses, derived):
if len(arrangement.strip()) > 0]
except ValueError:
return []
def sole_custody(responses, derived):
"""
Return True if either parent has sole custody of the children
"""
return conditional_logic.determine_sole_custody(responses)
def special_expenses_missing_error(responses, derived):
return determine_missing_extraordinary_expenses(responses)
def _any_question_errors(responses, questions):
for field in questions:
error_field_name = f'{field}_error'
if responses.get(error_field_name):
return True
return False

+ 182
- 71
edivorce/apps/core/utils/question_step_mapping.py View File

@ -34,13 +34,105 @@ pre_qual_step_question_mapping = {
}
}
children_substep_question_mapping = {
'your_children': {
'claimant_children'
},
'income_expenses': {
'how_will_calculate_income',
'annual_gross_income',
'spouse_annual_gross_income',
'payor_monthly_child_support_amount',
'special_extraordinary_expenses',
'child_care_expenses',
'children_healthcare_premiums',
'health_related_expenses',
'extraordinary_educational_expenses',
'post_secondary_expenses',
'extraordinary_extracurricular_expenses',
'total_section_seven_expenses',
'your_proportionate_share_percent',
'your_proportionate_share_amount',
'spouse_proportionate_share_percent',
'spouse_proportionate_share_amount',
'describe_order_special_extra_expenses',
},
'facts': {
'child_support_payor',
# Fact sheet B
'number_of_children',
'time_spent_with_you',
'time_spent_with_spouse',
'your_child_support_paid_b',
'your_spouse_child_support_paid_b',
'additional_relevant_spouse_children_info',
# Fact sheet C
'number_of_children_claimant',
'your_spouse_child_support_paid_c',
'number_of_children_claimant_spouse',
'your_child_support_paid_c',
# Fact sheet D
'agree_to_guideline_child_support_amount',
'appropriate_spouse_paid_child_support',
'suggested_child_support',
# Fact sheet E
'claiming_undue_hardship',
'claimant_debts',
'claimant_expenses',
'supporting_non_dependents',
'supporting_dependents',
'supporting_disabled',
'undue_hardship',
'income_others',
# Fact sheet F
'number_children_seeking_support_you',
'child_support_amount_under_high_income_you',
'percent_income_over_high_income_limit_you',
'amount_income_over_high_income_limit_you',
'total_guideline_amount_you',
'agree_to_child_support_amount_you',
'agreed_child_support_amount_you',
'reason_child_support_amount_you',
'number_children_seeking_support_spouse',
'child_support_amount_under_high_income_spouse',
'percent_income_over_high_income_limit_spouse',
'amount_income_over_high_income_limit_spouse',
'total_guideline_amount_spouse',
'agree_to_child_support_amount_spouse',
'agreed_child_support_amount_spouse',
'reason_child_support_amount_spouse',
},
'payor_medical': {
'medical_coverage_available',
'whose_plan_is_coverage_under',
'child_support_payments_in_arrears',
'child_support_arrears_amount',
},
'what_for': {
'child_support_in_order',
'order_monthly_child_support_amount',
'child_support_in_order_reason',
'claimants_agree_to_child_support_amount',
'child_support_payment_special_provisions',
'have_separation_agreement',
'have_court_order',
'what_parenting_arrangements',
'want_parenting_arrangements',
'order_respecting_arrangement',
'order_for_child_support',
'child_support_act'
},
}
"""
Mapping between questions and steps
Usage: For each step title, list all questions_keys belong to that step
"""
question_step_mapping = {
'prequalification': ['married_marriage_like', 'lived_in_bc',
'lived_in_bc_at_least_year', 'separation_date',
'prequalification': ['married_marriage_like',
'lived_in_bc',
'lived_in_bc_at_least_year',
'separation_date',
'children_of_marriage',
'number_children_under_19',
'number_children_over_19',
@ -49,108 +141,126 @@ question_step_mapping = {
'original_marriage_certificate',
'provide_certificate_later',
'provide_certificate_later_reason',
'not_provide_certificate_reason', 'divorce_reason',
'not_provide_certificate_reason',
'divorce_reason',
'marriage_certificate_in_english',
'try_reconcile_after_separated',
'reconciliation_period'],
'which_orders': ['want_which_orders'],
'your_information': ['name_you', 'any_other_name_you', 'other_name_you',
'last_name_born_you', 'last_name_before_married_you',
'birthday_you', 'lived_in_bc_you',
'moved_to_bc_date_you', 'occupation_you'],
'your_spouse': ['name_spouse', 'any_other_name_spouse', 'other_name_spouse',
'last_name_born_spouse', 'last_name_before_married_spouse',
'birthday_spouse', 'lived_in_bc_spouse',
'moved_to_bc_date_spouse', 'occupation_spouse'],
'your_marriage': ['when_were_you_married', 'where_were_you_married_city',
'your_information': ['name_you',
'any_other_name_you',
'other_name_you',
'last_name_born_you',
'last_name_before_married_you',
'birthday_you',
'lived_in_bc_you',
'moved_to_bc_date_you',
'occupation_you'],
'your_spouse': ['name_spouse',
'any_other_name_spouse',
'other_name_spouse',
'last_name_born_spouse',
'last_name_before_married_spouse',
'birthday_spouse',
'lived_in_bc_spouse',
'moved_to_bc_date_spouse',
'occupation_spouse'],
'your_marriage': ['when_were_you_married',
'where_were_you_married_city',
'where_were_you_married_prov',
'where_were_you_married_country',
'where_were_you_married_other_country',
'marital_status_before_you',
'marital_status_before_spouse',
'when_were_you_live_married_like'],
'your_separation': ['no_reconciliation_possible', 'no_collusion'],
'your_separation': ['no_reconciliation_possible',
'no_collusion'],
'your_children': ['claimant_children',
# Income & Expenses
'how_will_calculate_income',
'annual_gross_income',
'spouse_annual_gross_income',
'payor_monthly_child_support_amount',
# Fact sheet A
'special_extraordinary_expenses',
'child_care_expenses',
'children_healthcare_premiums',
'health_related_expenses',
'extraordinary_educational_expenses',
'post_secondary_expenses',
'extraordinary_extracurricular_expenses',
'describe_order_special_extra_expenses',
# Payor & Fact Sheets
'child_support_payor',
# Fact sheet B
'number_of_children',
'time_spent_with_you',
'time_spent_with_spouse',
'your_child_support_paid_b',
'your_spouse_child_support_paid_b',
'additional_relevant_spouse_children_info',
# Fact sheet C
'number_of_children_claimant',
'your_spouse_child_support_paid_c',
'number_of_children_claimant_spouse',
'your_child_support_paid_c',
# Fact sheet D
'agree_to_guideline_child_support_amount',
'appropriate_spouse_paid_child_support',
'suggested_child_support',
# Fact sheet E
'claiming_undue_hardship',
'claimants_agree_to_child_support_amount',
'claimant_debts',
'claimant_expenses',
'supporting_non_dependents',
'supporting_dependents',
'supporting_disabled',
'undue_hardship',
'income_others',
# Fact sheet F
'number_children_seeking_support_you',
'child_support_amount_under_high_income_you',
'percent_income_over_high_income_limit_you',
'amount_income_over_high_income_limit_you',
'total_guideline_amount_you',
'agree_to_child_support_amount_you',
'agreed_child_support_amount_you',
'reason_child_support_amount_you',
'number_children_seeking_support_spouse',
'child_support_amount_under_high_income_spouse',
'percent_income_over_high_income_limit_spouse',
'amount_income_over_high_income_limit_spouse',
'total_guideline_amount_spouse',
'agree_to_child_support_amount_spouse',
'agreed_child_support_amount_spouse',
'reason_child_support_amount_spouse',
# Medical and other expenses
'medical_coverage_available',
'whose_plan_is_coverage_under',
'child_support_payments_in_arrears',
'child_support_arrears_amount',
# What are you asking for
'child_support_in_order',
'order_monthly_child_support_amount',
'child_support_in_order_reason',
'claimants_agree_to_child_support_amount',
'child_support_payment_special_provisions',
'number_children_seeking_support',
'child_support_amount_under_high_income',
'percent_income_over_high_income_limit',
'amount_income_over_high_income_limit',
'total_guideline_amount',
'agree_to_child_support_amount',
'agreed_child_support_amount',
'reason_child_support_amount',
'have_separation_agreement',
'have_court_order',
'what_parenting_arrangements',
'want_parenting_arrangements',
'order_respecting_arrangement',
'order_for_child_support',
'child_support_act',
'spouse_number_children_seeking_support',
'spouse_child_support_amount_under_high_income',
'spouse_percent_income_over_high_income_limit',
'spouse_amount_income_over_high_income_limit',
'spouse_total_guideline_amount',
'spouse_agree_to_child_support_amount',
'spouse_agreed_child_support_amount',
'spouse_reason_child_support_amount',
'you_spouse_entered_agreement',
'claimant_debts',
'claimant_expenses',
'supporting_non_dependents',
'supporting_dependents',
'supporting_disabled',
'undue_hardship',
'income_others',
'total_income_others',
'number_of_children',
'time_spent_with_you',
'time_spent_with_spouse',
'annual_gross_income',
'spouse_annual_gross_income',
'your_child_support_paid_b',
'your_spouse_child_support_paid_b',
'your_child_support_paid_c',
'your_spouse_child_support_paid_c',
'extra_ordinary_expenses_you',
'extra_ordinary_expenses_spouse',
'additional_relevant_spouse_children_info',
'difference_between_claimants',
'child_care_expenses',
'children_healthcare_premiums',
'health_related_expenses',
'extraordinary_educational_expenses',
'post_secondary_expenses',
'extraordinary_extracurricular_expenses',
'total_section_seven_expenses',
'your_proportionate_share_percent',
'your_proportionate_share_amount',
'spouse_proportionate_share_percent',
'spouse_proportionate_share_amount',
'describe_order_special_extra_expenses'
],
'spousal_support': ['spouse_support_details', 'spouse_support_act'],
'child_support_act'],
'spousal_support': ['spouse_support_details',
'spouse_support_act'],
'property_and_debt': ['deal_with_property_debt',
'how_to_divide_property_debt',
'other_property_claims'],
'other_orders': ['name_change_you', 'name_change_you_fullname',
'name_change_spouse', 'name_change_spouse_fullname',
'other_orders': ['name_change_you',
'name_change_you_fullname',
'name_change_spouse',
'name_change_spouse_fullname',
'other_orders_detail'],
'other_questions': ['address_to_send_official_document_street_you',
'address_to_send_official_document_city_you',
@ -173,20 +283,21 @@ question_step_mapping = {
'filing_locations': ['court_registry_for_filing'],
}
page_step_mapping = {
'prequalification': 'prequalification',
'orders': 'which_orders',
'claimant': 'your_information',
'respondent': 'your_spouse',
'marriage': 'your_marriage',
'separation': 'your_separation',
'children': 'your_children',
'support': 'spousal_support',
'property': 'property_and_debt',
'other_orders': 'other_orders',
'other_questions': 'other_questions',
'filing_locations': 'filing_locations',
}
""" List of court registries """
list_of_registries = ['Fort St. John', 'Dawson Creek', 'Prince Rupert',
'Terrace', 'Smithers', 'Prince George', 'Quesnel',


+ 53
- 90
edivorce/apps/core/utils/step_completeness.py View File

@ -1,8 +1,8 @@
import ast
from django.urls import reverse
from edivorce.apps.core.models import Question
from edivorce.apps.core.utils.question_step_mapping import question_step_mapping, pre_qual_step_question_mapping
from edivorce.apps.core.utils.question_step_mapping import children_substep_question_mapping, page_step_mapping, pre_qual_step_question_mapping, question_step_mapping
from edivorce.apps.core.utils.conditional_logic import get_cleaned_response_value
def evaluate_numeric_condition(target, reveal_response):
@ -32,67 +32,36 @@ def evaluate_numeric_condition(target, reveal_response):
return None
def get_step_status(responses_by_step):
def get_step_completeness(questions_by_step):
"""
Accepts a dictionary of {step: {question_id: {question__name, question_id, value, error}}} <-- from get_step_responses
Returns {step: status}, {step: [missing_question_key]}
"""
status_dict = {}
for step, lst in responses_by_step.items():
if not lst:
for step, questions_dict in questions_by_step.items():
if not_started(questions_dict):
status_dict[step] = "Not started"
else:
if is_complete(step, lst)[0]:
complete = is_complete(questions_dict)
if complete:
status_dict[step] = "Complete"
else:
status_dict[step] = "Started"
return status_dict
def is_complete(step, lst):
"""
Check required field of question for complete state
Required: question is always require user response to be complete
Conditional: Optional question needed depends on reveal_response value of conditional_target.
"""
if not lst:
return False, []
question_list = Question.objects.filter(key__in=question_step_mapping[step])
required_list = list(question_list.filter(required='Required').values_list("key", flat=True))
conditional_list = list(question_list.filter(required='Conditional'))
complete = True
missing_responses = []
for question_key in required_list:
# everything in the required_list is required
if not __has_value(question_key, lst):
complete = False
missing_responses += [question_key]
for question in conditional_list:
# check condition for payor_monthly_child_support_amount
# which needs sole_custody to be computed separately
# payor_monthly_child_support_ammount is required only if sole_custody is True
if question.key == "payor_monthly_child_support_amount":
for target in lst:
if target["question_id"] == "claimant_children":
child_list = ast.literal_eval(target['value'])
sole_custody = (all([child['child_live_with'] == 'Lives with you' for child in child_list]) or
all([child['child_live_with'] == 'Lives with spouse' for child in child_list]))
if sole_custody:
if not __has_value(question.key, lst):
complete = False
missing_responses += [question.key]
break
else:
# find the response to the conditional target
for target in lst:
if target["question_id"] == question.conditional_target:
if __condition_met(question.reveal_response, target, lst):
# the condition was met then the question is required.
# ... so check if it has a value
if not __has_value(question.key, lst):
complete = False
missing_responses += [question.key]
def not_started(question_list):
for question_dict in question_list:
if get_cleaned_response_value(question_dict['value']):
return False
return True
return complete, missing_responses
def is_complete(question_list):
for question_dict in question_list:
if question_dict['error']:
return False
return True
def get_formatted_incomplete_list(missed_question_keys):
@ -115,40 +84,34 @@ def get_formatted_incomplete_list(missed_question_keys):
return missed_questions
def __condition_met(reveal_response, target, lst):
# check whether using a numeric condition
numeric_condition_met = evaluate_numeric_condition(target["value"], reveal_response)
if numeric_condition_met is None:
# handle special negation options. ex) '!NO' matches anything but 'NO'
if reveal_response.startswith('!'):
if target["value"] == "" or target["value"] == reveal_response[1:]:
return False
elif target["value"] != reveal_response:
return False
elif numeric_condition_met is False:
return False
# return true if the target is not Conditional
if target['question__required'] != 'Conditional':
return True
else:
# if the target is Conditional and the condition was met, check the target next
reveal_response = target["question__reveal_response"]
conditional_target = target["question__conditional_target"]
for new_target in lst:
if new_target["question_id"] == conditional_target:
# recursively search up the tree
return __condition_met(reveal_response, new_target, lst)
# if the for loop above didn't find the target, then the target question
# is unanswered and the condition was not met
return False
def __has_value(key, lst):
for user_response in lst:
if user_response["question_id"] == key:
answer = user_response["value"]
if answer != "" and answer != "[]" and answer != '[["",""]]' and answer != "\n":
return True
return False
def get_error_dict(questions_by_step, step, substep=None):
"""
Accepts questions dict of {step: [{question_dict}]} and a step (and substep)
Returns a dict of {question_key_error: True} for missing questions that are part of that step (and substep)
"""
responses_dict = {}
question_step = page_step_mapping[step]
step_questions = questions_by_step.get(question_step)
if substep:
substep_questions = children_substep_question_mapping[substep]
step_questions = list(filter(lambda question_dict: question_dict['question_id'] in substep_questions, step_questions))
if not not_started(step_questions) and not is_complete(step_questions):
for question_dict in step_questions:
if question_dict['error']:
field_error_key = question_dict['question_id'] + '_error'
responses_dict[field_error_key] = True
return responses_dict
def get_missed_question_keys(questions_by_step, step):
"""
Accepts questions dict of {step: [{question_dict}]} and a step
Returns a list of [question_key] for missing questions that are part of that step
"""
missed_questions = []
question_step = page_step_mapping[step]
step_questions = questions_by_step.get(question_step)
for question_dict in step_questions:
if question_dict['error']:
missed_questions.append(question_dict['question_id'])
return missed_questions

+ 143
- 120
edivorce/apps/core/utils/user_response.py View File

@ -1,104 +1,153 @@
from edivorce.apps.core.models import UserResponse, Question
from edivorce.apps.core.utils.question_step_mapping import question_step_mapping
from edivorce.apps.core.utils import conditional_logic
from edivorce.apps.core.utils.conditional_logic import get_cleaned_response_value
from edivorce.apps.core.utils.question_step_mapping import page_step_mapping, question_step_mapping
from edivorce.apps.core.utils.step_completeness import evaluate_numeric_condition
from collections import OrderedDict
def get_responses_from_db(bceid_user, show_errors=False, step=None, substep=None):
""" Get UserResponses from the database for a user."""
married, married_questions, responses = __get_data(bceid_user)
REQUIRED = 0
HIDDEN = 1
OPTIONAL = 2
def get_data_for_user(bceid_user):
"""
Return a dictionary of {question_key: user_response_value}
"""
responses = UserResponse.objects.filter(bceid_user=bceid_user)
responses_dict = {}
for answer in responses:
if not married and answer.question_id in married_questions:
responses_dict[answer.question.key] = ''
elif answer.value.strip('[').strip(']'):
responses_dict[answer.question.key] = answer.value
if show_errors:
step_questions = question_step_mapping.get(step, [])
questions = Question.objects.filter(key__in=step_questions)
for question in questions:
if responses_dict.get(question.key):
error = False
elif question.required == 'Required':
error = True
elif question.required == 'Conditional':
conditional_response = UserResponse.objects.filter(question=question.conditional_target).first()
error = conditional_response and conditional_response.value == question.reveal_response
else:
error = False
responses_dict['{}_error'.format(question.key)] = error
for response in responses:
if response.value.strip('[').strip(']'):
responses_dict[response.question_id] = response.value
return responses_dict
def get_responses_from_db_grouped_by_steps(bceid_user, hide_failed_conditionals=False):
def get_step_responses(responses_by_key):
"""
Group questions and responses by steps to which they belong
`hide_failed_conditionals` goes through the responses after grouping and
tests their conditionality. If they fail, the response is blanked (this is
to hide conditional responses that are no longer applicable but haven't been
erased, mainly for the question review page).
Accepts a dictionary of {question_key: user_response_value} <-- from get_data_for_user
Returns a dictionary of {step: {question_id: {question__name, question_id, value, error}}}
"""
married, married_questions, responses = __get_data(bceid_user)
responses_dict = {}
responses_by_step = {}
for step in page_step_mapping.values():
questions_dict = _get_questions_dict_set_for_step(step)
step_responses = []
for question in questions_dict:
question_details = _get_question_details(question, questions_dict, responses_by_key)
if question_details['show']:
question_dict = questions_dict[question]
question_dict['value'] = question_details['value']
question_dict['error'] = question_details['error']
step_responses.append(question_dict)
responses_by_step[step] = step_responses
return responses_by_step
def _get_questions_dict_set_for_step(step):
questions = Question.objects.filter(key__in=question_step_mapping[step])
questions_dict = {}
for question in questions:
question_dict = {
'question__conditional_target': question.conditional_target,
'question__reveal_response': question.reveal_response,
'question__name': question.name,
'question__required': question.required,
'question_id': question.key,
}
questions_dict[question.pk] = question_dict
return questions_dict
def _condition_met(target_response, reveal_response):
# check whether using a numeric condition
numeric_condition_met = evaluate_numeric_condition(target_response, reveal_response)
if numeric_condition_met is None:
# handle special negation options. ex) '!NO' matches anything but 'NO'
if reveal_response.startswith('!'):
if target_response == "" or target_response.lower() == reveal_response[1:].lower():
return False
elif str(target_response) != reveal_response:
return False
elif numeric_condition_met is False:
return False
return True
def _get_question_details(question, questions_dict, responses_by_key):
"""
Return details for a question given the set of question details and user responses.
value: The user's response to a question (or None if unanswered)
error: True if the question has an error (e.g. required but not answered)
show: False if the response shouldn't be displayed (e.g. don't show 'Also known as' name, but 'Does your spouse go by any other names' is NO)
"""
required = False
show = True
question_required = _is_question_required(question, questions_dict, responses_by_key)
if question_required == REQUIRED:
required = True
show = True
elif question_required == HIDDEN:
required = False
show = False
elif question_required == OPTIONAL:
required = False
show = True
if show:
value = None
response = responses_by_key.get(question)
if response:
value = get_cleaned_response_value(response)
error = required and not value
else:
value = None
error = None
for step, questions in question_step_mapping.items():
details = {
'value': value,
'error': error,
'show': show
}
return details
lst = []
step_responses = responses.filter(question_id__in=questions).exclude(
value__in=['', '[]', '[["",""]]']).order_by('question')
for answer in step_responses:
if not married and answer.question_id in married_questions:
value = ''
def _is_question_required(question, questions_dict, responses_by_key):
"""
returns REQUIRED, HIDDEN, or OPTIONAL
raises KeyError if the question is conditional and improperly configured (for development testing purposes)
"""
question_dict = questions_dict[question]
if question_dict['question__required'] == 'Required':
return REQUIRED
elif question_dict['question__required'] == 'Conditional':
target = question_dict.get('question__conditional_target')
reveal_response = question_dict.get('question__reveal_response')
if not target or not reveal_response:
raise KeyError(f"Improperly configured question '{question}'. Needs target and reveal response")
if target.startswith('determine_'):
# Look for the right function to evaluate conditional logic
derived_condition = getattr(conditional_logic, target)
if not derived_condition:
raise NotImplemented(target)
result = derived_condition(responses_by_key)
if result and _condition_met(result, reveal_response):
return REQUIRED
else:
value = answer.value
lst += [{'question__conditional_target': answer.question.conditional_target,
'question__reveal_response': answer.question.reveal_response,
'value': value,
'question__name': answer.question.name,
'question__required': answer.question.required,
'question_id': answer.question.pk}]
# This was added for DIV-514, where the user entered a name change for
# their spouse but then said 'no', they won't be changing their name.
# Since we don't blank related answers, we need to hide it dynamically.
# This only works for questions in the same step.
if hide_failed_conditionals:
values = {q['question_id']: q['value'] for q in lst}
for q in lst:
if q['question__required'] != 'Conditional':
continue
target = q['question__conditional_target']
if target.startswith('['):
targets = target.strip('[]').split(',')
filtered_targets = [t for t in targets if t not in values]
# filtered_targets = list(filter(lambda t: t not in values, targets))
if len(filtered_targets):
continue
reveal_responses = dict(zip(targets, q['question__reveal_response'].strip('[]').split(',')))
present = [val for key, val in reveal_responses.items() if val != values[key]]
if len(present):
q['value'] = ''
continue
if target not in values:
continue
numeric_condition = evaluate_numeric_condition(values[target], q['question__reveal_response'])
if numeric_condition is None:
if q['question__reveal_response'].startswith('!'):
if values[target] == "" or values[target] == q['question__reveal_response'][1:]:
q['value'] = ''
elif q['question__reveal_response'] and q['question__reveal_response'] != values[target]:
q['value'] = ''
elif numeric_condition is False:
q['value'] = ''
responses_dict[step] = lst
return responses_dict
return HIDDEN
elif target in questions_dict:
target_question_requirement = _is_question_required(target, questions_dict, responses_by_key)
if target_question_requirement == REQUIRED:
target_response = responses_by_key.get(target)
if target_response and _condition_met(target_response, reveal_response):
return REQUIRED
return HIDDEN
else:
raise KeyError(f"Invalid conditional target '{target}' for question '{question}'")
else:
return OPTIONAL
def get_responses_from_session(request):
@ -106,19 +155,15 @@ def get_responses_from_session(request):
def get_responses_from_session_grouped_by_steps(request):
question_list = Question.objects.filter(key__in=question_step_mapping['prequalification'])
lst = []
step_questions_dict = _get_questions_dict_set_for_step('prequalification')
step_questions_list = []
for question_key, question_dict in step_questions_dict.items():
question_details = _get_question_details(question_key, step_questions_dict, request.session)
question_dict['value'] = question_details['value']
question_dict['error'] = question_details['error']
step_questions_list.append(question_dict)
for question in question_list:
lst += [{'question__conditional_target': question.conditional_target,
'question__reveal_response': question.reveal_response,
'value': request.session.get(question.pk, ''),
'question__name': question.name,
'question__required': question.required,
'question_id': question.pk}]
return {'prequalification': lst}
return {'prequalification': step_questions_list}
def save_to_db(serializer, question, value, bceid_user):
@ -153,25 +198,3 @@ def copy_session_to_db(request, bceid_user):
# clear the response from the session
request.session[q.key] = None
def __get_data(bceid_user):
"""
Gets UserResponses from the database for a user, plus a boolean indicating
if the user is married or common-law, and a list of questions that only apply to
married couples
"""
COMMON_LAW = 'Living together in a marriage like relationship'
MARRIED = 'Legally married'
responses = UserResponse.objects.filter(bceid_user=bceid_user).select_related('question')
married_status = responses.filter(question_id='married_marriage_like')
if married_status.count() > 0:
married = married_status[0].value != COMMON_LAW
else:
married = False
married_questions = list(
Question.objects.filter(reveal_response=MARRIED).values_list("key", flat=True))
return married, married_questions, responses

+ 41
- 23
edivorce/apps/core/views/main.py View File

@ -1,4 +1,5 @@
import datetime
from copy import deepcopy
from django.conf import settings
from django.shortcuts import render, redirect
@ -6,12 +7,16 @@ from django.utils import timezone
from edivorce.apps.core.utils.derived import get_derived_data
from ..decorators import bceid_required, intercept
from ..utils.question_step_mapping import list_of_registries, page_step_mapping
from ..utils.step_completeness import get_step_status, is_complete, get_formatted_incomplete_list
from ..utils.question_step_mapping import list_of_registries
from ..utils.step_completeness import get_error_dict, get_missed_question_keys, get_step_completeness, is_complete, get_formatted_incomplete_list
from ..utils.template_step_order import template_step_order
from ..utils.user_response import get_responses_from_db, copy_session_to_db, \
get_responses_from_db_grouped_by_steps, get_responses_from_session, \
get_responses_from_session_grouped_by_steps
from ..utils.user_response import (
get_data_for_user,
copy_session_to_db,
get_step_responses,
get_responses_from_session,
get_responses_from_session_grouped_by_steps,
)
def home(request):
@ -40,10 +45,11 @@ def prequalification(request, step):
if not request.user.is_authenticated:
responses_dict = get_responses_from_session(request)
else:
responses_dict = get_responses_from_db(request.user)
responses_dict = get_data_for_user(request.user)
responses_dict['active_page'] = 'prequalification'
responses_by_step = get_responses_from_db_grouped_by_steps(request.user)
responses_dict['step_status'] = get_step_status(responses_by_step)
responses_by_step = get_step_responses(responses_dict)
step_status = get_step_completeness(responses_by_step)
responses_dict['step_status'] = step_status
return render(request, template_name=template, context=responses_dict)
@ -56,7 +62,7 @@ def success(request):
return redirect(settings.PROXY_BASE_URL + settings.FORCE_SCRIPT_NAME[:-1] + '/overview')
prequal_responses = get_responses_from_session_grouped_by_steps(request)['prequalification']
complete, _ = is_complete('prequalification', prequal_responses)
complete = is_complete(prequal_responses)
if complete:
return render(request, 'success.html', context={'register_url': settings.REGISTER_URL,'register_sc_url': settings.REGISTER_SC_URL})
return redirect(settings.PROXY_BASE_URL + settings.FORCE_SCRIPT_NAME[:-1] + '/incomplete')
@ -66,8 +72,8 @@ def incomplete(request):
"""
This page is shown if the user misses any pre-qualification questions
"""
prequal_responses = get_responses_from_session_grouped_by_steps(request)['prequalification']
_, missed_question_keys = is_complete('prequalification', prequal_responses)
prequal_responses = get_responses_from_session_grouped_by_steps(request)
missed_question_keys = get_missed_question_keys(prequal_responses, 'prequalification')
missed_questions = get_formatted_incomplete_list(missed_question_keys)
responses_dict = get_responses_from_session(request)
@ -153,12 +159,14 @@ def overview(request):
"""
Dashboard: Process overview page.
"""
responses_dict_by_step = get_responses_from_db_grouped_by_steps(request.user)
responses_dict = get_data_for_user(request.user)
responses_dict_by_step = get_step_responses(responses_dict)
# Add step status dictionary
responses_dict_by_step['step_status'] = get_step_status(responses_dict_by_step)
step_status = get_step_completeness(responses_dict_by_step)
responses_dict_by_step['step_status'] = step_status
responses_dict_by_step['active_page'] = 'overview'
responses_dict_by_step['derived'] = get_derived_data(get_responses_from_db(request.user))
responses_dict_by_step['derived'] = get_derived_data(responses_dict)
response = render(request, 'overview.html', context=responses_dict_by_step)
@ -173,7 +181,7 @@ def dashboard_nav(request, nav_step):
"""
Dashboard: All other pages
"""
responses_dict = get_responses_from_db(request.user)
responses_dict = get_data_for_user(request.user)
responses_dict['active_page'] = nav_step
template_name = 'dashboard/%s.html' % nav_step
return render(request, template_name=template_name, context=responses_dict)
@ -187,15 +195,25 @@ def question(request, step, sub_step=None):
sub_page_template = '_{}'.format(sub_step) if sub_step else ''
template = 'question/%02d_%s%s.html' % (template_step_order[step], step, sub_page_template)
responses_dict_by_step = get_responses_from_db_grouped_by_steps(request.user, True)
step_status = get_step_status(responses_dict_by_step)
if step == "review":
responses_dict = responses_dict_by_step
derived = get_derived_data(get_responses_from_db(request.user))
data_dict = get_data_for_user(request.user)
responses_dict_by_step = get_step_responses(data_dict)
step_status = get_step_completeness(responses_dict_by_step)
derived = get_derived_data(data_dict)
responses_dict = {}
# Just for now (until showing missing questions in review is implemented) remove unanswered questions
for step, question_list in responses_dict_by_step.items():
copy = deepcopy(question_list)
for question_dict in question_list:
if question_dict['value'] is None:
copy.remove(question_dict)
responses_dict[step] = copy
else:
question_step = page_step_mapping.get(step, step)
show_errors = step_status.get(question_step) == 'Started'
responses_dict = get_responses_from_db(request.user, show_errors=show_errors, step=question_step, substep=sub_step)
responses_dict = get_data_for_user(request.user)
responses_dict_by_step = get_step_responses(responses_dict)
step_status = get_step_completeness(responses_dict_by_step)
responses_dict.update(get_error_dict(responses_dict_by_step, step, sub_step))
derived = get_derived_data(responses_dict)
# Add step status dictionary
@ -253,7 +271,7 @@ def intercept_page(request):
input.
"""
template = 'question/%02d_%s.html' % (template_step_order['orders'], 'orders')
responses_dict = get_responses_from_db(request.user)
responses_dict = get_data_for_user(request.user)
responses_dict['intercepted'] = True
return render(request, template_name=template, context=responses_dict)


+ 2
- 2
edivorce/apps/core/views/pdf.py View File

@ -10,7 +10,7 @@ import requests
from ..decorators import bceid_required
from ..utils.derived import get_derived_data
from ..utils.user_response import get_responses_from_db
from ..utils.user_response import get_data_for_user
EXHIBITS = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'[::-1])
@ -19,7 +19,7 @@ EXHIBITS = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'[::-1])
def form(request, form_number):
""" View for rendering PDF's and previews """
responses = get_responses_from_db(request.user)
responses = get_data_for_user(request.user)
if (form_number == '1' or form_number.startswith('37') or
form_number.startswith('38') or


+ 95
- 327
edivorce/fixtures/Question.json View File

@ -395,7 +395,7 @@
"name": "Where were you married? Prov",
"description": "For step 4, Form 1 2. Divorce section A, Form 52 Court orders that section",
"summary_order": 38,
"required": "Required"
"required": ""
},
"model": "core.question",
"pk": "where_were_you_married_prov"
@ -504,21 +504,12 @@
"model": "core.question",
"pk": "how_to_divide_property_debt"
},
{
"fields": {
"name": "Claimant 1 and Claimant 2 ask for an order respecting an interest in property or for compensation instead of an interest in that property, as follows",
"description": "For step 7, Form 1 6. Property and debt",
"summary_order": 49
},
"model": "core.question",
"pk": "want_other_property_claims"
},
{
"fields": {
"name": "Please list any other property claims.",
"description": "For step 7, Form 1 6. Property and debt",
"summary_order": 50,
"required": "Conditional"
"required": ""
},
"model": "core.question",
"pk": "other_property_claims"
@ -801,16 +792,6 @@
"model": "core.question",
"pk": "claimant_children"
},
{
"fields": {
"name": "Total monthly child support payment amount including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7 expenses",
"description": "For Step 6, Your children - What are you asking for",
"summary_order": 0,
"required": ""
},
"model": "core.question",
"pk": "total_child_support_payment"
},
{
"fields": {
"name": "Do you have a separation agreement that sets out what you've agreed to around parenting and child support?",
@ -880,7 +861,9 @@
"name": "Please indicate which act you are asking for support under.",
"description": "For Step 6, Your children - What are you asking for",
"summary_order": 0,
"required": "Required"
"required": "Conditional",
"conditional_target": "determine_child_support_act_requirement",
"reveal_response": "True"
},
"model": "core.question",
"pk": "child_support_act"
@ -911,8 +894,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_you",
"reveal_response": "True"
},
"model": "core.question",
"pk": "number_children_seeking_support_you"
@ -923,8 +906,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_spouse",
"reveal_response": "True"
},
"model": "core.question",
"pk": "number_children_seeking_support_spouse"
@ -935,8 +918,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_you",
"reveal_response": "True"
},
"model": "core.question",
"pk": "child_support_amount_under_high_income_you"
@ -947,8 +930,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_spouse",
"reveal_response": "True"
},
"model": "core.question",
"pk": "child_support_amount_under_high_income_spouse"
@ -959,8 +942,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_you",
"reveal_response": "True"
},
"model": "core.question",
"pk": "percent_income_over_high_income_limit_you"
@ -971,8 +954,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_spouse",
"reveal_response": "True"
},
"model": "core.question",
"pk": "percent_income_over_high_income_limit_spouse"
@ -983,8 +966,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_you",
"reveal_response": "True"
},
"model": "core.question",
"pk": "amount_income_over_high_income_limit_you"
@ -995,8 +978,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_spouse",
"reveal_response": "True"
},
"model": "core.question",
"pk": "amount_income_over_high_income_limit_spouse"
@ -1007,8 +990,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_you",
"reveal_response": "True"
},
"model": "core.question",
"pk": "total_guideline_amount_you"
@ -1019,8 +1002,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_spouse",
"reveal_response": "True"
},
"model": "core.question",
"pk": "total_guideline_amount_spouse"
@ -1031,8 +1014,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_you",
"reveal_response": "True"
},
"model": "core.question",
"pk": "agree_to_child_support_amount_you"
@ -1043,8 +1026,8 @@
"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"
"conditional_target": "determine_show_fact_sheet_f_spouse",
"reveal_response": "True"
},
"model": "core.question",
"pk": "agree_to_child_support_amount_spouse"
@ -1055,7 +1038,7 @@
"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",
"conditional_target": "agree_to_child_support_amount_you",
"reveal_response": "NO"
},
"model": "core.question",
@ -1067,7 +1050,7 @@
"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",
"conditional_target": "agree_to_child_support_amount_spouse",
"reveal_response": "NO"
},
"model": "core.question",
@ -1079,7 +1062,7 @@
"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",
"conditional_target": "agree_to_child_support_amount_you",
"reveal_response": "NO"
},
"model": "core.question",
@ -1091,7 +1074,7 @@
"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",
"conditional_target": "agree_to_child_support_amount_spouse",
"reveal_response": "NO"
},
"model": "core.question",
@ -1107,102 +1090,6 @@
"model": "core.question",
"pk": "spouse_annual_gross_income"
},
{
"fields": {
"name": "How many child(ren) are you asking for support?",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "spouse_number_children_seeking_support"
},
{
"fields": {
"name": "What is the Child Support Guidelines amount for $150,000?",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "spouse_child_support_amount_under_high_income"
},
{
"fields": {
"name": "What is the % of income over $150,000 from the Child Support Guidlines?",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "spouse_percent_income_over_high_income_limit"
},
{
"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 - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "spouse_amount_income_over_high_income_limit"
},
{
"fields": {
"name": "Guidelines table amount",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "spouse_total_guideline_amount"
},
{
"fields": {
"name": "What is the amount that you and your spouse have agreed to?",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_annual_gross_income",
"reveal_response": ">150000"
},
"model": "core.question",
"pk": "spouse_agree_to_child_support_amount"
},
{
"fields": {
"name": "What is the amount that you and your spouse have agreed to?",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_agree_to_child_support_amount",
"reveal_response": "NO"
},
"model": "core.question",
"pk": "spouse_agreed_child_support_amount"
},
{
"fields": {
"name": "Why do you think the court should approve your proposed amount?",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "spouse_agree_to_child_support_amount",
"reveal_response": "NO"
},
"model": "core.question",
"pk": "spouse_reason_child_support_amount"
},
{
"fields": {
"name": "Are you or your spouse claiming undue hardship?",
@ -1219,8 +1106,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"conditional_target": "determine_missing_undue_hardship_reasons",
"reveal_response": "True"
},
"model": "core.question",
"pk": "claimant_debts"
@ -1231,8 +1118,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"conditional_target": "determine_missing_undue_hardship_reasons",
"reveal_response": "True"
},
"model": "core.question",
"pk": "claimant_expenses"
@ -1243,8 +1130,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"conditional_target": "determine_missing_undue_hardship_reasons",
"reveal_response": "True"
},
"model": "core.question",
"pk": "supporting_non_dependents"
@ -1255,8 +1142,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"conditional_target": "determine_missing_undue_hardship_reasons",
"reveal_response": "True"
},
"model": "core.question",
"pk": "supporting_dependents"
@ -1267,8 +1154,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"conditional_target": "determine_missing_undue_hardship_reasons",
"reveal_response": "True"
},
"model": "core.question",
"pk": "supporting_disabled"
@ -1279,8 +1166,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"conditional_target": "determine_missing_undue_hardship_reasons",
"reveal_response": "True"
},
"model": "core.question",
"pk": "undue_hardship"
@ -1290,9 +1177,7 @@
"name": "Income of Other Persons in Household",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claiming_undue_hardship",
"reveal_response": "YES"
"required": ""
},
"model": "core.question",
"pk": "income_others"
@ -1313,8 +1198,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"conditional_target": "determine_missing_extraordinary_expenses",
"reveal_response": "True"
},
"model": "core.question",
"pk": "child_care_expenses"
@ -1335,8 +1220,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"conditional_target": "determine_missing_extraordinary_expenses",
"reveal_response": "True"
},
"model": "core.question",
"pk": "children_healthcare_premiums"
@ -1346,9 +1231,7 @@
"name": "Any annual healthcare premiums you pay to your employer or other provider to provide the coverage to your children rather than yourself",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "annual_children_healthcare_premiums"
@ -1359,8 +1242,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"conditional_target": "determine_missing_extraordinary_expenses",
"reveal_response": "True"
},
"model": "core.question",
"pk": "health_related_expenses"
@ -1370,9 +1253,7 @@
"name": "Annual health related expenses that exceed insurance reimbursement by at least $100",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "annual_health_related_expenses"
@ -1383,8 +1264,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"conditional_target": "determine_missing_extraordinary_expenses",
"reveal_response": "True"
},
"model": "core.question",
"pk": "extraordinary_educational_expenses"
@ -1394,9 +1275,7 @@
"name": "Annual extraordinary primary, secondary or other educational expenses",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "annual_extraordinary_educational_expenses"
@ -1407,8 +1286,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"conditional_target": "determine_missing_extraordinary_expenses",
"reveal_response": "True"
},
"model": "core.question",
"pk": "post_secondary_expenses"
@ -1418,9 +1297,7 @@
"name": "Annual Post-secondary school expenses",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "annual_post_secondary_expenses"
@ -1431,8 +1308,8 @@
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"conditional_target": "determine_missing_extraordinary_expenses",
"reveal_response": "True"
},
"model": "core.question",
"pk": "extraordinary_extracurricular_expenses"
@ -1442,9 +1319,7 @@
"name": "Annual extraordinary extracurricular activities expenses",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "annual_extraordinary_extracurricular_expenses"
@ -1454,9 +1329,7 @@
"name": "Total section 7 expenses",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "total_section_seven_expenses"
@ -1466,9 +1339,7 @@
"name": "Annual total section 7 expenses",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "annual_total_section_seven_expenses"
@ -1478,9 +1349,7 @@
"name": "Your proportionate share",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "your_proportionate_share_percent"
@ -1490,9 +1359,7 @@
"name": "Your proportionate share",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "your_proportionate_share_amount"
@ -1502,9 +1369,7 @@
"name": "Spouse's proportionate share",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "spouse_proportionate_share_percent"
@ -1514,9 +1379,7 @@
"name": "Spouse's proportionate share",
"description": "For Step 6, Your children - Income & expenses - Spouse Fact Sheet F",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "special_extraordinary_expenses",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "spouse_proportionate_share_amount"
@ -1539,8 +1402,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_shared_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "number_of_children"
@ -1551,8 +1414,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_shared_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "time_spent_with_you"
@ -1563,8 +1426,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_shared_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "time_spent_with_spouse"
@ -1575,8 +1438,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_shared_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "your_child_support_paid_b"
@ -1587,56 +1450,18 @@
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_shared_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "your_spouse_child_support_paid_b"
},
{
"fields": {
"name": "Difference between the Guidelines table amount of the claimant and the Guidelines table amount of the respondent",
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "difference_between_claimants"
},
{
"fields": {
"name": "Special or extraordinary expenses (as per Section 7 of the Federal Child Support Guidelines) to be paid annually",
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "extra_ordinary_expenses_you"
},
{
"fields": {
"name": "Special or extraordinary expenses (as per Section 7 of the Federal Child Support Guidelines) to be paid annually",
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "extra_ordinary_expenses_spouse"
},
{
"fields": {
"name": "Any other relevant information regarding the conditions, means, needs and other circumstances of each spouse or of any child for whom support is sought?",
"description": "For Step 6, Your children - Your children - Fact Sheet B Shared Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"required": ""
},
"model": "core.question",
"pk": "additional_relevant_spouse_children_info"
@ -1659,8 +1484,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_split_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "your_child_support_paid_c"
@ -1671,8 +1496,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_split_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "your_spouse_child_support_paid_c"
@ -1683,8 +1508,8 @@
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_split_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "number_of_children_claimant"
@ -1695,60 +1520,12 @@
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
"conditional_target": "determine_split_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "number_of_children_claimant_spouse"
},
{
"fields": {
"name": "How do I calculate annual income?",
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "spouse_annual_income"
},
{
"fields": {
"name": "What is the monthly amount for child support payable by your spouse (as per Federal Child Support Tables)?",
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "total_spouse_paid_child_support"
},
{
"fields": {
"name": "How do I calculate annual income?",
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "claimant_annual_income"
},
{
"fields": {
"name": "What is the monthly amount for child support payable by you (as per Federal Child Support Tables)?",
"description": "For Step 6, Your children - Your children - Fact Sheet C Split Custody",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "total_paid_child_support"
},
{
"fields": {
"name": "Difference between Guidelines table amounts",
@ -1761,25 +1538,14 @@
"model": "core.question",
"pk": "difference_payment_amounts_c"
},
{
"fields": {
"name": "How many child(ren) are 19 years or older for whom you are asking for support?",
"description": "For Step 6, Your children - Income & expenses - Fact Sheet D Child(ren) 19 Years or Older",
"summary_order": 0,
"required": "Conditional",
"conditional_target": "claimant_children",
"reveal_response": ""
},
"model": "core.question",
"pk": "number_children_over_19_need_support"
},
{
"fields": {
"name": "Do you and your spouse agree that the monthly Guidelines table amount for child support is appropriate?",
"description": "For Step 6, Your children - Income & expenses - Fact Sheet D Child(ren) 19 Years or Older",
"summary_order": 0,
"required": "Conditional",
"reveal_response": ""
"conditional_target": "determine_child_over_19_supported",
"reveal_response": "True"
},
"model": "core.question",
"pk": "agree_to_guideline_child_support_amount"
@ -1790,7 +1556,8 @@
"description": "For Step 6, Your children - Income & expenses - Fact Sheet D Child(ren) 19 Years or Older",
"summary_order": 0,
"required": "Conditional",
"reveal_response": ""
"conditional_target": "agree_to_guideline_child_support_amount",
"reveal_response": "NO"
},
"model": "core.question",
"pk": "appropriate_spouse_paid_child_support"
@ -1802,7 +1569,7 @@
"summary_order": 0,
"required": "Conditional",
"conditional_target": "agree_to_guideline_child_support_amount",
"reveal_response": "YES"
"reveal_response": "NO"
},
"model": "core.question",
"pk": "suggested_child_support"
@ -1823,7 +1590,8 @@
"description": "For Step 6, Your children - Income & expenses",
"summary_order": 0,
"required": "Conditional",
"reveal_response": ""
"conditional_target": "determine_sole_custody",
"reveal_response": "True"
},
"model": "core.question",
"pk": "payor_monthly_child_support_amount"


Loading…
Cancel
Save