diff --git a/edivorce/apps/core/static/css/weasyprint.css b/edivorce/apps/core/static/css/weasyprint.css index 8cecc6be..06578c8a 100644 --- a/edivorce/apps/core/static/css/weasyprint.css +++ b/edivorce/apps/core/static/css/weasyprint.css @@ -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; +} diff --git a/edivorce/apps/core/templates/pdf/form37_we.html b/edivorce/apps/core/templates/pdf/form37_we.html index 68e86cfa..8387e6e8 100644 --- a/edivorce/apps/core/templates/pdf/form37_we.html +++ b/edivorce/apps/core/templates/pdf/form37_we.html @@ -167,9 +167,13 @@
    1. Claimant 1's annual income as determined under sections 15 to - 20 of the Guidelines: $amount
    2. + 20 of the Guidelines: + {{ responses.annual_gross_income|money }} +
    3. Claimant 2's annual income as determined under sections 15 to - 20 of the Guidelines: $amount
    4. + 20 of the Guidelines: + {{ responses.spouse_annual_gross_income|money }} +
    5. 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.
    6. @@ -179,12 +183,14 @@
    7. {% if derived.has_fact_sheets %} - I have completed and attached to this Affidavit:
      - {% if derived.show_fact_sheet_b %}Supplementary Child Support Fact Sheet B
      {% endif %} - {% if derived.show_fact_sheet_c %}Supplementary Child Support Fact Sheet C
      {% endif %} - {% if derived.show_fact_sheet_d %}Supplementary Child Support Fact Sheet D
      {% endif %} - {% if derived.show_fact_sheet_e %}Supplementary Child Support Fact Sheet E
      {% endif %} - {% if derived.show_fact_sheet_f %}Supplementary Child Support Fact Sheet F
      {% endif %} + I have completed and attached to this Affidavit: +
      + {% if derived.show_fact_sheet_b %}Supplementary Child Support Fact Sheet B
      {% endif %} + {% if derived.show_fact_sheet_c %}Supplementary Child Support Fact Sheet C
      {% endif %} + {% if derived.show_fact_sheet_d %}Supplementary Child Support Fact Sheet D
      {% endif %} + {% if derived.show_fact_sheet_e %}Supplementary Child Support Fact Sheet E
      {% endif %} + {% if derived.show_fact_sheet_f %}Supplementary Child Support Fact Sheet F
      {% endif %} +
      {% else %} The monthly amount in Schedule 1 of the Guidelines is {{ derived.schedule_1_amount|money }}, payable by @@ -193,28 +199,45 @@
    8. - 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. -

      + {% if responses.have_separation_agreement == 'YES' %} + 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' %} + The proposed order does not include child support but the following + arrangements have been made for the support of the child: +
      {{ responses.child_support_in_order_reason }}
      + {% elif responses.does_payour_amount_match_guidelines == 'YES' %} + 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' %} 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. -

      - 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 -

      - 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. -

      - 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 %} + 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: +
      {{ responses.child_support_payment_special_provisions }}
      + {% endif %}
    9. @@ -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 %}
    10. + {% 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. -

      + {% else %} Medical coverage is available for the children under Claimant 2's medical insurance plan. -

      - Medical coverage is not available for the children under either of - the party’s medical insurance plans. + {% endif %}
    11. @@ -260,65 +286,21 @@
    12. - 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 %}.
    -

     

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SWORN (OR AFFIRMED) BEFORE ME )
    at  , British Columbia )
    on )
    )
    )
    )
    )
    A commissioner for taking ) {{ responses.name_you|upper }}
    affidavits for British Columbia )
    - -

     

    + {% 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' %} Printed on {% now "F jS, Y" %} from https://justice.gov.bc.ca/divorce diff --git a/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html b/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html new file mode 100644 index 00000000..838ecabb --- /dev/null +++ b/edivorce/apps/core/templates/pdf/partials/fact_sheet_a.html @@ -0,0 +1,126 @@ +{% load format_utils %} +
    +

    + Supplementary Child Support Fact Sheet A
    + Special or Extraordinary Expenses +

    + +

    Section 7 expenses (net of tax credits and contribution from child, etc.):

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AnnualMonthly
    AChild Care Expenses$ + {{ derived.annual_child_care_expenses|money:False }} + $ + {{ responses.child_care_expenses|money:False }} +
    BPortion of medical and dental premiums attributable to the child(ren)$ + {{ derived.annual_children_healthcare_premiums|money:False }} + $ + {{ responses.children_healthcare_premiums|money:False }} +
    CHealth related expenses that exceed insurance reimbursement by at least $100$ + {{ derived.annual_health_related_expenses|money:False }} + $ + {{ responses.health_related_expenses|money:False }} +
    DExtraordinary primary, secondary or other educational expenses$ + {{ derived.annual_extraordinary_educational_expenses|money:False }} + $ + {{ responses.extraordinary_educational_expenses|money:False }} +
    EPost-secondary school expenses$ + {{ derived.annual_post_secondary_expenses|money:False }} + $ + {{ responses.post_secondary_expenses|money:False }} +
    FExtraordinary extracurricular activities expenses$ + {{ derived.annual_extraordinary_extracurricular_expenses|money:False }} + $ + {{ responses.extraordinary_extracurricular_expenses|money:False }} +
    GTotal section 7 expenses$ + {{ derived.annual_total_section_seven_expenses|money:False }} + $ + {{ responses.total_section_seven_expenses|money:False }} +
    + +

    + Parties’ respective proportionate shares of the total net monthly section 7 + expenses referred to at Line G above: +

    + + + + + + + + + + + + + + + + + + + +
    PercentageMonthly
    Claimant 1's proportionate share{{ derived.claimant_1_share_proportion|stringformat:".1f" }} %$ + {{ derived.claimant_1_share|money:False }} +
    Claimant 2's proportionate share{{ derived.claimant_2_share_proportion|stringformat:".1f" }} %$ + {{ derived.claimant_2_share|money:False }} +
    + +

    + 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 }} +

    +
    diff --git a/edivorce/apps/core/templates/pdf/partials/notary_signature.html b/edivorce/apps/core/templates/pdf/partials/notary_signature.html new file mode 100644 index 00000000..a6bb07a0 --- /dev/null +++ b/edivorce/apps/core/templates/pdf/partials/notary_signature.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    SWORN (OR AFFIRMED) BEFORE ME )
    at  , British Columbia )
    on )
    )
    )
    )
    )
    A commissioner for taking ) {{ name|upper }}
    affidavits for British Columbia )
    + + diff --git a/edivorce/apps/core/templatetags/format_utils.py b/edivorce/apps/core/templatetags/format_utils.py index c9edc7b4..a9eabd8f 100644 --- a/edivorce/apps/core/templatetags/format_utils.py +++ b/edivorce/apps/core/templatetags/format_utils.py @@ -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 diff --git a/edivorce/apps/core/utils/derived.py b/edivorce/apps/core/utils/derived.py index fd5d06c0..9f970b25 100644 --- a/edivorce/apps/core/utils/derived.py +++ b/edivorce/apps/core/utils/derived.py @@ -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