Browse Source

DIV-578

pull/160/head
Justin Johnson 8 years ago
parent
commit
62650d616e
6 changed files with 462 additions and 100 deletions
  1. +43
    -0
      edivorce/apps/core/static/css/weasyprint.css
  2. +70
    -88
      edivorce/apps/core/templates/pdf/form37_we.html
  3. +126
    -0
      edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html
  4. +51
    -0
      edivorce/apps/core/templates/pdf/partials/notary_signature.html
  5. +3
    -3
      edivorce/apps/core/templatetags/format_utils.py
  6. +169
    -9
      edivorce/apps/core/utils/derived.py

+ 43
- 0
edivorce/apps/core/static/css/weasyprint.css View File

@ -163,6 +163,7 @@ ol.numbered-paragraphs li {
.notary-signature {
width: 100%;
margin-top: 4em;
}
.notary-signature td {
@ -177,3 +178,45 @@ ol.numbered-paragraphs li {
text-align: center;
width: 6%;
}
.new-paragraph {
margin-top: 0.5em;
}
.indented {
margin-left: 4em;
}
.user-entered {
white-space: pre-line;
}
.fact-sheet {
page-break-before: always;
}
.fact-sheet h3 {
text-align: center;
}
.fact-sheet .table.table-bordered tbody tr th {
text-align: center;
font-weight: normal;
}
.fact-sheet .table.table-bordered tbody tr .line-number {
text-align: center;
width: 2em;
}
.fact-sheet .table.table-bordered tbody tr .amount {
}
.fact-sheet .table.table-bordered tbody tr .amount .actual {
float: right;
}
.fact-sheet .table.table-bordered tbody tr .percentage,
.fact-sheet .table.table-bordered tbody tr .total {
text-align: right;
}

+ 70
- 88
edivorce/apps/core/templates/pdf/form37_we.html View File

@ -167,9 +167,13 @@
<li>
<ol style="list-style-type: lower-alpha">
<li>Claimant 1's annual income as determined under sections 15 to
20 of the Guidelines: $amount</li>
20 of the Guidelines:
{{ responses.annual_gross_income|money }}
</li>
<li>Claimant 2's annual income as determined under sections 15 to
20 of the Guidelines: $amount</li>
20 of the Guidelines:
{{ responses.spouse_annual_gross_income|money }}
</li>
<li>Claimant 1 and Claimant 2 have entered into an agreement as
to income pursuant to section 15(2) of the Guidelines, a copy
of which agreement is attached.</li>
@ -179,12 +183,14 @@
<li> <!-- 5 -->
{% if derived.has_fact_sheets %}
I have completed and attached to this Affidavit:<br>
{% if derived.show_fact_sheet_b %}Supplementary Child Support Fact Sheet B<br>{% endif %}
{% if derived.show_fact_sheet_c %}Supplementary Child Support Fact Sheet C<br>{% endif %}
{% if derived.show_fact_sheet_d %}Supplementary Child Support Fact Sheet D<br>{% endif %}
{% if derived.show_fact_sheet_e %}Supplementary Child Support Fact Sheet E<br>{% endif %}
{% if derived.show_fact_sheet_f %}Supplementary Child Support Fact Sheet F<br>{% endif %}
I have completed and attached to this Affidavit:
<div class="new-paragraph indented">
{% if derived.show_fact_sheet_b %}Supplementary Child Support Fact Sheet B<br>{% endif %}
{% if derived.show_fact_sheet_c %}Supplementary Child Support Fact Sheet C<br>{% endif %}
{% if derived.show_fact_sheet_d %}Supplementary Child Support Fact Sheet D<br>{% endif %}
{% if derived.show_fact_sheet_e %}Supplementary Child Support Fact Sheet E<br>{% endif %}
{% if derived.show_fact_sheet_f %}Supplementary Child Support Fact Sheet F<br>{% endif %}
</div>
{% else %}
The monthly amount in Schedule 1 of the Guidelines is
{{ derived.schedule_1_amount|money }}, payable by
@ -193,28 +199,45 @@
</li>
<li> <!-- 6 -->
The proposed order sets out that $amount is the amount of child
support payable by Claimant 1 or Claimant 2 which amount accords
with the Guidelines.
<br><br>
{% if responses.have_separation_agreement == 'YES' %} <!-- 6d -->
The proposed order sets out that
{{ responses.order_monthly_child_support_amount|money }}
is the amount of child support payable by
{{ derived.child_support_payor }},
in accordance with the agreement referred to in section 4(c) of
this Affidavit.
{% elif responses.child_support_in_order == 'NO' %} <!-- 6e -->
The proposed order does not include child support but the following
arrangements have been made for the support of the child:
<div class="new-paragraph user-entered"
>{{ responses.child_support_in_order_reason }}</div>
{% elif responses.does_payour_amount_match_guidelines == 'YES' %} <!-- 6a -->
The proposed order sets out that
{{ responses.order_monthly_child_support_amount|money }}
is the amount of child support payable by
{{ derived.child_support_payor }},
which amount accords with the Guidelines.
{% elif responses.claimants_agree_to_child_support_amount == 'YES' %} <!-- 6b -->
The proposed order by consent, pursuant to section 15.1(7) of the
Divorce Act (Canada) or section 150(2) of the Family Law Act,
sets out that $amount is the amount of child support payable by
Claimant 1 orClaimant 2, which amount is different than the amount
required by the Guidelines.
<br><br>
The proposed order sets out that $amount is the amount of child
support payable by Claimant 1 or Claimant 2, which amount is
different than the amount required by the Guidelines, but the
following special provisions, within the meaning of section 15.1(5)
of the Divorce Act(Canada), have been made: describe
<br><br>
The proposed order sets out that $amount is the amount of child
support payable by Claimant 1 or Claimant 2, in accordance with the
agreement referred to in section 4(c) of this Affidavit.
<br><br>
The proposed order does not include child support but the following
arrangements have been made for the support of the child: describe
sets out that
{{ responses.order_monthly_child_support_amount|money }}
is the amount of child support payable by
{{ derived.child_support_payor }},
which amount is different than the amount required by the
Guidelines.
{% else %} <!-- 6c -->
The proposed order sets out that
{{ responses.order_monthly_child_support_amount|money }}
is the amount of child support payable by
{{ derived.child_support_payor }},
which amount is different than the amount required by the
Guidelines, but the following special provisions, within the
meaning of section 15.1(5) of the Divorce Act(Canada), have been
made:
<div class="new-paragraph user-entered"
>{{ responses.child_support_payment_special_provisions }}</div>
{% endif %}
</li>
<li> <!-- 7 -->
@ -225,19 +248,22 @@
I have completed and attached to this affidavit Supplementary
Child Support Fact Sheet A (special expenses), and the amount set
out in the proposed order for the expenses under section 7 of the
Guidelines is $amount.
Guidelines is
{{ responses.total_section_seven_expenses|money }}.
{% endif %}
</li>
<li> <!-- 8 -->
{% if responses.medical_coverage_available %}
Medical coverage is not available for the children under either of
the party’s medical insurance plans.
{% elif responses.whose_plan_is_coverage_under == 'My plan' %}
Medical coverage is available for the children under Claimant 1's
medical insurance plan.
<br><br>
{% else %}
Medical coverage is available for the children under Claimant 2's
medical insurance plan.
<br><br>
Medical coverage is not available for the children under either of
the party’s medical insurance plans.
{% endif %}
</li>
<li> <!-- 9 -->
@ -260,65 +286,21 @@
</li>
<li class="force-break"> <!-- 11 -->
The amount of arrears of child support, as at date, under any
existing order or written agreement is nil or$amount.
The amount of arrears of child support, as at
{% now "M j, Y" %},
under any existing order or written agreement is
{% if responses.child_support_payments_in_arrears == 'YES' %}
{{ responses.child_support_arrears_amount|money }}
{% else %}
nil
{% endif %}.
</li>
</ol>
<p>&nbsp;</p>
<table class="notary-signature">
<tbody>
<tr>
<td class=""> SWORN (OR AFFIRMED) BEFORE ME</td>
<td class="parens"> ) </td>
<td class=""> </td>
</tr>
<tr>
<td class="">at <span class="form-entry not-complete">&nbsp;</span>, British Columbia</td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class="">on</td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class="signature-above">A commissioner for taking</td>
<td class="parens"> ) </td>
<td class="signature-above">{{ responses.name_you|upper }}</td>
</tr>
<tr>
<td class="">affidavits for British Columbia</td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
{% include 'pdf/partials/notary_signature.html' with name=responses.name_you %}
{% include 'pdf/partials/notary_signature.html' with name=responses.name_spouse %}
{% include 'pdf/partials/fact_sheet_a.html' %}
<small>Printed on {% now "F jS, Y" %} from https://justice.gov.bc.ca/divorce</small>
</div>


+ 126
- 0
edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html View File

@ -0,0 +1,126 @@
{% load format_utils %}
<div class="fact-sheet">
<h3>
Supplementary Child Support Fact Sheet A<br>
Special or Extraordinary Expenses
</h3>
<p>Section 7 expenses (net of tax credits and contribution from child, etc.):</p>
<table class="table table-bordered">
<tbody>
<tr>
<th></th>
<th></th>
<th>Annual</th>
<th>Monthly</th>
</tr>
<tr>
<td class="line-number">A</td>
<td>Child Care Expenses</td>
<td class="amount">$
<span class="actual">{{ derived.annual_child_care_expenses|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.child_care_expenses|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">B</td>
<td>Portion of medical and dental premiums attributable to the child(ren)</td>
<td class="amount">$
<span class="actual">{{ derived.annual_children_healthcare_premiums|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.children_healthcare_premiums|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">C</td>
<td>Health related expenses that exceed insurance reimbursement by at least $100</td>
<td class="amount">$
<span class="actual">{{ derived.annual_health_related_expenses|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.health_related_expenses|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">D</td>
<td>Extraordinary primary, secondary or other educational expenses</td>
<td class="amount">$
<span class="actual">{{ derived.annual_extraordinary_educational_expenses|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.extraordinary_educational_expenses|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">E</td>
<td>Post-secondary school expenses</td>
<td class="amount">$
<span class="actual">{{ derived.annual_post_secondary_expenses|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.post_secondary_expenses|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">F</td>
<td>Extraordinary extracurricular activities expenses</td>
<td class="amount">$
<span class="actual">{{ derived.annual_extraordinary_extracurricular_expenses|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.extraordinary_extracurricular_expenses|money:False }}</span>
</td>
</tr>
<tr>
<td class="line-number">G</td>
<td class="total">Total section 7 expenses</td>
<td class="amount">$
<span class="actual">{{ derived.annual_total_section_seven_expenses|money:False }}</span>
</td>
<td class="amount">$
<span class="actual">{{ responses.total_section_seven_expenses|money:False }}</span>
</td>
</tr>
</tbody>
</table>
<p>
Parties’ respective proportionate shares of the total net monthly section 7
expenses referred to at Line G above:
</p>
<table class="table table-bordered">
<tbody>
<tr>
<th></th>
<th>Percentage</th>
<th>Monthly</th>
</tr>
<tr>
<td>Claimant 1's proportionate share</td>
<td class="percentage">{{ derived.claimant_1_share_proportion|stringformat:".1f" }} %</td>
<td class="amount">$
<span class="actual">{{ derived.claimant_1_share|money:False }}</span>
</td>
</tr>
<tr>
<td>Claimant 2's proportionate share</td>
<td class="percentage">{{ derived.claimant_2_share_proportion|stringformat:".1f" }} %</td>
<td class="amount">$
<span class="actual">{{ derived.claimant_2_share|money:False }}</span>
</td>
</tr>
</tbody>
</table>
<p>
Total monthly child support payable by {{ derived.child_support_payor }},
including the monthly Guidelines table amount under Schedule 1 of the
Guidelines and the section 7 expenses, is
{{ derived.total_monthly_support_1_and_a|money }}
</p>
</div>

+ 51
- 0
edivorce/apps/core/templates/pdf/partials/notary_signature.html View File

@ -0,0 +1,51 @@
<table class="notary-signature">
<tbody>
<tr>
<td class=""> SWORN (OR AFFIRMED) BEFORE ME</td>
<td class="parens"> ) </td>
<td class=""> </td>
</tr>
<tr>
<td class="">at <span class="form-entry not-complete">&nbsp;</span>, British Columbia</td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class="">on</td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class=""></td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
<tr>
<td class="signature-above">A commissioner for taking</td>
<td class="parens"> ) </td>
<td class="signature-above">{{ name|upper }}</td>
</tr>
<tr>
<td class="">affidavits for British Columbia</td>
<td class="parens"> ) </td>
<td class=""></td>
</tr>
</tbody>
</table>

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

@ -22,7 +22,7 @@ def linebreaksli(value):
@register.filter
def date_formatter(value):
""" Changes date format from dd/mm/yyyy to dd/mmm/yyyy """
""" Changes date format from dd/mm/yyyy to dd mmm yyyy """
if value is None or value == '':
return ''
@ -111,11 +111,11 @@ def age(date):
@register.filter
def money(amount):
def money(amount, symbol=True):
""" Return a properly formatted currency string including symbol """
try:
return locale.currency(float(amount), grouping=True)
return locale.currency(float(amount), symbol, grouping=True)
except ValueError:
pass


+ 169
- 9
edivorce/apps/core/utils/derived.py View File

@ -31,8 +31,21 @@ DERIVED_DATA = [
'show_fact_sheet_f',
'has_fact_sheets',
'schedule_1_amount',
'schedule_1_payor',
'fact_sheet_a_total',
'child_support_payor',
'annual_child_care_expenses',
'annual_children_healthcare_premiums',
'annual_health_related_expenses',
'annual_extraordinary_educational_expenses',
'annual_post_secondary_expenses',
'annual_extraordinary_extracurricular_expenses',
'total_section_seven_expenses',
'annual_total_section_seven_expenses',
'total_gross_income',
'claimant_1_share_proportion',
'claimant_1_share',
'claimant_2_share_proportion',
'claimant_2_share',
'total_monthly_support_1_and_a',
]
@ -178,19 +191,166 @@ def has_fact_sheets(responses, derived):
def schedule_1_amount(responses, derived):
""" Return the amount as defined in schedule 1 for child support """
return 155689.333
try:
return float(responses.get('order_monthly_child_support_amount', 0))
except ValueError:
return 0
def schedule_1_payor(responses, derived):
""" Return the amount as defined in schedule 1 for child support """
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 ''
def annual_child_care_expenses(responses, derived):
""" Return the annual cost of the monthly cost of child care expense """
try:
return 12 * float(responses.get('child_care_expenses', 0))
except ValueError:
return 0
def annual_children_healthcare_premiums(responses, derived):
""" Return the annual cost of the monthly cost of child health care premiums """
try:
return 12 * float(responses.get('children_healthcare_premiums', 0))
except ValueError:
return 0
def annual_health_related_expenses(responses, derived):
""" Return the annual cost of the monthly cost of health related expense """
try:
return 12 * float(responses.get('health_related_expenses', 0))
except ValueError:
return 0
def annual_extraordinary_educational_expenses(responses, derived):
""" Return the annual cost of the monthly cost of educational expense """
try:
return 12 * float(responses.get('extraordinary_educational_expenses', 0))
except ValueError:
return 0
def annual_post_secondary_expenses(responses, derived):
""" Return the annual cost of the monthly cost of post secondary expense """
try:
return 12 * float(responses.get('post_secondary_expenses', 0))
except ValueError:
return 0
return 'Claimant 1'
def annual_extraordinary_extracurricular_expenses(responses, derived):
""" Return the annual cost of the monthly cost of education expense """
def fact_sheet_a_total(responses, derived):
""" Return the total amount of special expenses from Fact Sheet A """
try:
return 12 * float(responses.get('extraordinary_extracurricular_expenses', 0))
except ValueError:
return 0
def total_section_seven_expenses(responses, derived):
""" Return the monthly cost of section 7 expense """
try:
return float(responses.get('total_section_seven_expenses', 0))
except ValueError:
return 0
def annual_total_section_seven_expenses(responses, derived):
""" Return the annual cost of the monthly cost of section 7 expense """
return 12 * derived['total_section_seven_expenses']
def total_gross_income(responses, derived):
""" Return the total gross income of both claimants """
try:
claimant_1 = float(responses.get('annual_gross_income', 0))
except ValueError:
claimant_1 = 0
try:
claimant_2 = float(responses.get('spouse_annual_gross_income', 0))
except ValueError:
claimant_2 = 0
return claimant_1 + claimant_2
def claimant_1_share_proportion(responses, derived):
"""
Return the proportionate share of claimant 1 for child support, based on
annual income.
"""
try:
income = float(responses.get('annual_gross_income', 0))
except ValueError:
income = 0
if derived['total_gross_income'] == 0:
return 0
return income / derived['total_gross_income'] * 1000 // 1 / 10
def claimant_1_share(responses, derived):
"""
Return the proportionate share of claimant 1 for child support, based on
annual income.
"""
proportion = derived['claimant_1_share_proportion'] / 100
return derived['total_section_seven_expenses'] * proportion
def claimant_2_share_proportion(responses, derived):
"""
Return the proportionate share of claimant 2 for child support, based on
annual income.
"""
if derived['total_gross_income'] == 0:
return 0
return 100 - derived['claimant_1_share_proportion'] * 10 // 1 / 10
def claimant_2_share(responses, derived):
"""
Return the proportionate share of claimant 2 for child support, based on
annual income.
"""
return 0
proportion = derived['claimant_2_share_proportion'] / 100
return derived['total_section_seven_expenses'] * proportion
def total_monthly_support_1_and_a(responses, derived):
""" Return the combined schedule 1 and section 7 monthly amounts """
total = derived['schedule_1_amount']
if derived['child_support_payor'] == 'Claimant 1':
total += derived['claimant_1_share']
elif derived['child_support_payor'] == 'Claimant 2':
total += derived['claimant_2_share']
else:
total += derived['total_section_seven_expenses']
return total

Loading…
Cancel
Save