From b80f56368af0e0912727e813decb3d0940fd2a19 Mon Sep 17 00:00:00 2001 From: Benard Ebinu Date: Tue, 6 Mar 2018 14:18:08 -0800 Subject: [PATCH] DIV-799: moving proposed child support amount to 'what asking for' page --- edivorce/apps/core/static/js/main.js | 15 ++++++------ .../pdf/partials/fact_sheet_f_table.html | 6 ++--- .../question/06_children_what_for.html | 16 +++++++++++++ .../apps/core/templatetags/format_utils.py | 8 ++----- edivorce/fixtures/Question.json | 24 +++++++++++++++++++ 5 files changed, 53 insertions(+), 16 deletions(-) diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 9e9b24df..4b89754f 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -138,7 +138,7 @@ $(function () { // and claimantTwo. The result is a value between [0,claimantOne] inclusive. var scale = function (targetElement, claimantAmount, proportionFactor) { var amount = parseFloat(proportionFactor) / 100 * parseFloat(claimantAmount); - targetElement.val(amount.toFixed(2)); + targetElement.val(amount.toFixed(2)).change(); }; scale(self, quantityElement.val(), scaleFactorElement.val()); @@ -195,8 +195,10 @@ $(function () { // Dynamically calculate total child support payment for payor var calcTotalChildSupportPayment = function() { 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; if (payor === 'Myself (Claimant 1)') { @@ -209,7 +211,7 @@ $(function () { 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()); @@ -1014,8 +1016,7 @@ var sumFields = function(addendSelector, sumSelector) { $(sumSelector).text(total); } else { - $(sumSelector).val(total); - $(sumSelector).trigger("change"); + $(sumSelector).val(total).change(); } } }; @@ -1030,7 +1031,7 @@ var deltaFieldOnChange = function() { delta = Math.abs($(this).val() - delta); }); $(deltaTargetSelector).each(function() { - $(this).val(delta); + $(this).val(delta).change(); }); }; diff --git a/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html b/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html index a5635ec2..8ee3323f 100644 --- a/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html +++ b/edivorce/apps/core/templates/pdf/partials/fact_sheet_f_table.html @@ -18,7 +18,7 @@ Income Over $150,000 Guidelines table amount for $150,000 $ - {% lookup responses 'child_support_amount_under_high_income_'|add:claimant_id True %} + {% lookup responses 'child_support_amount_under_high_income_'|add:claimant_id %} @@ -31,7 +31,7 @@ Income Over $150,000 $ - {% lookup responses 'amount_income_over_high_income_limit_'|add:claimant_id True %} + {% lookup responses 'amount_income_over_high_income_limit_'|add:claimant_id %} @@ -40,7 +40,7 @@ Income Over $150,000 Guidelines table amount $ - {% lookup responses 'total_guideline_amount_'|add:claimant_id True %} + {% lookup responses 'total_guideline_amount_'|add:claimant_id %} diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index 65f256e4..2cd5981e 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -12,6 +12,22 @@ {% block content %}

Step {% step_order step="children" %}:Children - What are you asking for

+
+

Total monthly child support payment amount including the monthly Guidelines table amount under Schedule 1 of the Guidelines and the section 7 + expenses is: + + + + + + $ +

+

+ + Please note: The value above is based on the information you entered in Fact Sheet A - Special or Extraordinary Expenses. + +

+

What is the monthly child support amount