Browse Source

DIV-799: moving proposed child support amount to 'what asking for' page

pull/160/head
Benard Ebinu 7 years ago
parent
commit
b80f56368a
5 changed files with 53 additions and 16 deletions
  1. +8
    -7
      edivorce/apps/core/static/js/main.js
  2. +3
    -3
      edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html
  3. +16
    -0
      edivorce/apps/core/templates/question/06_children_what_for.html
  4. +2
    -6
      edivorce/apps/core/templatetags/format_utils.py
  5. +24
    -0
      edivorce/fixtures/Question.json

+ 8
- 7
edivorce/apps/core/static/js/main.js View File

@ -138,7 +138,7 @@ $(function () {
// and claimantTwo. The result is a value between [0,claimantOne] inclusive. // and claimantTwo. The result is a value between [0,claimantOne] inclusive.
var scale = function (targetElement, claimantAmount, proportionFactor) { var scale = function (targetElement, claimantAmount, proportionFactor) {
var amount = parseFloat(proportionFactor) / 100 * parseFloat(claimantAmount); var amount = parseFloat(proportionFactor) / 100 * parseFloat(claimantAmount);
targetElement.val(amount.toFixed(2));
targetElement.val(amount.toFixed(2)).change();
}; };
scale(self, quantityElement.val(), scaleFactorElement.val()); scale(self, quantityElement.val(), scaleFactorElement.val());
@ -195,8 +195,10 @@ $(function () {
// Dynamically calculate total child support payment for payor // Dynamically calculate total child support payment for payor
var calcTotalChildSupportPayment = function() { var calcTotalChildSupportPayment = function() {
var payor = $('#child_support_payor').text(); var payor = $('#child_support_payor').text();
var yourShare = parseFloat($('#your_proportionate_share_amount').val());
var spouseShare = parseFloat($('#spouse_proportionate_share_amount').val());
var yourShare = parseFloat($('#your_proportionate_share_amount').text()) || 0;
var spouseShare = parseFloat($('#spouse_proportionate_share_amount').text()) || 0;
var fact_sheet_b_proposed_amount = parseFloat($('#fact_sheet_b_proposed_amount').text()) || 0;
var fact_sheet_c_proposed_amount = parseFloat($('#fact_sheet_c_proposed_amount').text()) || 0;
var payorShare = 0; var payorShare = 0;
if (payor === 'Myself (Claimant 1)') { if (payor === 'Myself (Claimant 1)') {
@ -209,7 +211,7 @@ $(function () {
payorShare = yourShare + spouseShare; payorShare = yourShare + spouseShare;
} }
return payorShare + parseFloat($('#schedule_one_amount').text() || 0);
return (payorShare + fact_sheet_b_proposed_amount + fact_sheet_c_proposed_amount).toFixed(2);
}; };
$('#total_child_support_payment').text(calcTotalChildSupportPayment()); $('#total_child_support_payment').text(calcTotalChildSupportPayment());
@ -1014,8 +1016,7 @@ var sumFields = function(addendSelector, sumSelector) {
$(sumSelector).text(total); $(sumSelector).text(total);
} }
else { else {
$(sumSelector).val(total);
$(sumSelector).trigger("change");
$(sumSelector).val(total).change();
} }
} }
}; };
@ -1030,7 +1031,7 @@ var deltaFieldOnChange = function() {
delta = Math.abs($(this).val() - delta); delta = Math.abs($(this).val() - delta);
}); });
$(deltaTargetSelector).each(function() { $(deltaTargetSelector).each(function() {
$(this).val(delta);
$(this).val(delta).change();
}); });
}; };


+ 3
- 3
edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html View File

@ -18,7 +18,7 @@ Income Over $150,000
<td>Guidelines table amount for $150,000</td> <td>Guidelines table amount for $150,000</td>
<td class="amount">$ <td class="amount">$
<span class="actual"> <span class="actual">
{% lookup responses 'child_support_amount_under_high_income_'|add:claimant_id True %}
{% lookup responses 'child_support_amount_under_high_income_'|add:claimant_id %}
</span> </span>
</td> </td>
</tr> </tr>
@ -31,7 +31,7 @@ Income Over $150,000
</td> </td>
<td class="amount">$ <td class="amount">$
<span class="actual"> <span class="actual">
{% lookup responses 'amount_income_over_high_income_limit_'|add:claimant_id True %}
{% lookup responses 'amount_income_over_high_income_limit_'|add:claimant_id %}
</span> </span>
</td> </td>
</tr> </tr>
@ -40,7 +40,7 @@ Income Over $150,000
<td class="total">Guidelines table amount</td> <td class="total">Guidelines table amount</td>
<td class="amount">$ <td class="amount">$
<span class="actual"> <span class="actual">
{% lookup responses 'total_guideline_amount_'|add:claimant_id True %}
{% lookup responses 'total_guideline_amount_'|add:claimant_id %}
</span> </span>
</td> </td>
</tr> </tr>


+ 16
- 0
edivorce/apps/core/templates/question/06_children_what_for.html View File

@ -12,6 +12,22 @@
{% block content %} {% block content %}
<h1><small>Step {% step_order step="children" %}:</small>Children - What are you asking for</h1> <h1><small>Step {% step_order step="children" %}:</small>Children - What are you asking for</h1>
<div class="question-well">
<p>Total monthly child support payment amount including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7
expenses is:
<span id="child_support_payor" hidden>{{ child_support_payor }}</span>
<span id="your_proportionate_share_amount" hidden>{{ your_proportionate_share_amount }}</span>
<span id="spouse_proportionate_share_amount" hidden>{{ spouse_proportionate_share_amount }}</span>
<span id="fact_sheet_b_proposed_amount" hidden>{{ difference_between_claimants }}</span>
<span id="fact_sheet_c_proposed_amount" hidden>{{ difference_payment_amounts }}</span>
$<span id="total_child_support_payment"></span>
</p>
<p>
<small>
Please note: The value above is based on the information you entered in <a href="{% url 'question_steps' 'children' 'income_expenses'%}">Fact Sheet A - Special or Extraordinary Expenses</a>.
</small>
</p>
</div>
<div class="question-well"> <div class="question-well">
<h3>What is the monthly child support amount <h3>What is the monthly child support amount
<span class="tooltip-link" <span class="tooltip-link"


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

@ -171,10 +171,6 @@ def integer(value):
@register.simple_tag() @register.simple_tag()
def lookup(obj, property, money_format=None):
def lookup(obj, property):
""" Return the value of a dynamic property within an object""" """ Return the value of a dynamic property within an object"""
val = obj.get(property, '')
# if money_format:
# return money(val)
# else:
return val
return obj.get(property, '')

+ 24
- 0
edivorce/fixtures/Question.json View File

@ -1517,6 +1517,18 @@
"model": "core.question", "model": "core.question",
"pk": "your_spouse_child_support_paid" "pk": "your_spouse_child_support_paid"
}, },
{
"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": { "fields": {
"name": "Special or extraordinary expenses (as per Section 7 of the Federal Child Support Guidelines) to be paid annually", "name": "Special or extraordinary expenses (as per Section 7 of the Federal Child Support Guidelines) to be paid annually",
@ -1625,6 +1637,18 @@
"model": "core.question", "model": "core.question",
"pk": "total_paid_child_support" "pk": "total_paid_child_support"
}, },
{
"fields": {
"name": "Difference between Guidelines table amounts",
"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": "difference_payment_amounts"
},
{ {
"fields": { "fields": {
"name": "How many child(ren) are 19 years or older for whom you are asking for support?", "name": "How many child(ren) are 19 years or older for whom you are asking for support?",


Loading…
Cancel
Save