Skip to content

Commit

Permalink
22494 update furnishing document style (#2913)
Browse files Browse the repository at this point in the history
* 22494 update furnishing document style

* fix the text position

* add EP case

* fix lint issue

* update the letter content

* fix lint issue

* update business legal type value

* update test
  • Loading branch information
kzdev420 authored Aug 16, 2024
1 parent 4e3b1cd commit a424337
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 38 deletions.
20 changes: 15 additions & 5 deletions legal-api/report-templates/noticeOfDissolutionCommencement.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@
{% endif %}
<div class="container letter-container ml-3">
<div class="mt-5"><span class="bold">No Annual Reports Filed Since {{ furnishing.lastARDate }} for {{ furnishing.businessIdentifier }}</span></div>
<div class="mt-5">To file an annual report online, log in to your Business Page at <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/<wbr>{{ furnishing.businessIdentifier }}</a> to file any outstanding annual reports listed.</div>
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your company has for two years failed to file the annual reports required under section 51 of the Act. A company must annually, within two months after each anniversary of the date on which the company was recognized, file an annual report with the Registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website www.bclaws.ca. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company will be dissolved, unless cause is shown to the contrary; I am satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
<div class="mt-4">To file an annual report online, log in to your Business Page at <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/<wbr>{{ furnishing.businessIdentifier }}</a> to file any outstanding annual reports listed.</div>
{% if furnishing.businessLegalType == 'A' %}
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your extraprovincial company has for two years failed to file the annual reports required under section 51 of the Act. A company must annually, within two months after each anniversary of the date on which the company was recognized, file an annual report with the Registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company will be cancelled, unless cause is shown to the contrary; I am satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
{% else %}
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your company has for two years failed to file the annual reports required under section 51 of the Act. A company must annually, within two months after each anniversary of the date on which the company was recognized, file an annual report with the Registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company will be dissolved, unless cause is shown to the contrary; I am satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
{% endif %}

{% if furnishing.foreignRegistrations %}
<div class="mt-5">
Expand All @@ -58,8 +63,13 @@
</div>
{% endif %}

<div class="mt-5">To request a delay of the dissolution, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the dissolution of the company.</div>
<div class="mt-5">If your company is dissolved under section 422(1)(a) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is dissolved continues and may be enforced as if the company had not been dissolved.</div>
{% if furnishing.businessLegalType == 'A' %}
<div class="mt-5">To request a delay of the cancellation, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the dissolution of the company.</div>
<div class="mt-5">If your company is cancelled under section 422(1)(a) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is cancelled continues and may be enforced as if the company had not been cancelled.</div>
{% else %}
<div class="mt-5">To request a delay of the dissolution, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the dissolution of the company.</div>
<div class="mt-5">If your company is dissolved under section 422(1)(a) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is dissolved continues and may be enforced as if the company had not been dissolved.</div>
{% endif %}
<div class="mt-5">If you have filed the outstanding annual reports, no further action is required.</div>
<div class="mt-5">If you need help with setting up an account or managing a business, please visit our Resources and Help page at <a href="https://bcreg.ca/resources" class="break-url">bcreg.ca/resources</a></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.footer {
width: 97%;
margin-top: 0px !important;
padding-top: 0px;
padding: 0px 20rem;
}

.footer-table {
Expand All @@ -31,7 +31,7 @@

.footer-text {
font-family: 'BC Sans' !important;
color: #003366 !important;
color: #234075 !important;
font-size: 8px; /* 10 */
text-align: right;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.footer {
width: 97%;
margin-top: 0px !important;
padding-top: 0px;
padding: 0px 20rem;
}

.footer-table {
Expand Down
12 changes: 7 additions & 5 deletions legal-api/report-templates/template-parts/common/v2/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
width: 100%;
margin-right: 3rem !important;
margin-left: 3rem;
margin-top: 0 !important;
margin-top: 3px !important;
margin-bottom: 0 !important;
padding-left: 17rem;
padding-right: 15rem;
}
.header-table tr {
margin-top: 0px !important;
Expand All @@ -39,30 +41,30 @@
.header-table td:nth-child(2) {
width: 75%;
padding-right: 4px;
padding-top: 16px; /* 24 */
padding-top: 30px; /* 24 */
}

.separator {
border-bottom: 2px solid #234075;
width: 94%;
margin-left: 34px !important;
margin-top: 7px !important; /* 16 */
margin-top: 12px !important; /* 16 */
margin-right: 0px !important;
margin-bottom: 0 !important; /* 0 */
}

.report-type {
font-family: 'BC Sans' !important;
color: #234075;
font-size: 12pt !important;
font-size: 11pt !important;
font-weight: bold;
text-align: right;
}

.report-type-desc {
font-family: 'BC Sans' !important;
color: #1A5A96;
font-size: 9pt !important;
font-size: 8pt !important;
text-align: right;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
width: 100%;
margin-right: 3rem !important;
margin-left: 3rem;
margin-top: 0 !important;
margin-top: 3px !important;
margin-bottom: 0 !important;
padding-left: 17rem;
padding-right: 15rem;
}
.header-table tr {
margin-top: 0px !important;
Expand All @@ -39,30 +41,30 @@
.header-table td:nth-child(2) {
width: 75%;
padding-right: 4px;
padding-top: 16px; /* 24 */
padding-top: 30px; /* 24 */
}

.separator {
border-bottom: 2px solid #000000;
width: 94%;
margin-left: 34px !important;
margin-top: 7px !important; /* 16 */
margin-top: 12px !important; /* 16 */
margin-right: 0px !important;
margin-bottom: 0 !important; /* 0 */
}

.report-type {
font-family: 'Calibri' !important;
color: #000000;
font-size: 12pt !important;
font-size: 11pt !important;
font-weight: bold;
text-align: right;
}

.report-type-desc {
font-family: 'Calibri' !important;
color: #000000;
font-size: 9pt !important;
font-size: 8pt !important;
text-align: right;
}

Expand Down
10 changes: 6 additions & 4 deletions legal-api/report-templates/template-parts/common/v2/style.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@
color: #313132;
font-family: 'BCSans-Regular', sans-serif !important;
font-size: 14.66px; /*approx 11px after render*/
line-height: 20px; /*approx 15px after render */
line-height: 19.72px; /*approx 15px after render */
/* margin-top: 60px; */
text-align: left;
padding-left: 0.5rem;
padding-right: 1.2rem;
}

.section-title {
Expand Down Expand Up @@ -586,18 +588,18 @@
}

.address-container-additional-info {
margin-top: 3.25rem !important;
margin-top: 3.3rem !important;
}

.address-container-no-additional-info {
margin-top: 4.5rem;
}

.address-container {
margin-top: -3.25rem;
margin-top: -3.2rem;
}

.letter-container {
margin-top: 5.5rem;
margin-top: 4.75rem;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@
/* font-family: 'BCSans-Regular', sans-serif !important; */
font-family: 'Calibri'!important;
font-size: 14.66px; /*approx 11px after render*/
line-height: 20px; /*approx 15px after render */
line-height: 19.72px; /*approx 15px after render */
/* margin-top: 60px; */
text-align: left;
padding-left: 0.5rem;
padding-right: 1.2rem;
}

.section-title {
Expand Down Expand Up @@ -618,18 +620,18 @@
}

.address-container-additional-info {
margin-top: 3.25rem !important;
margin-top: 3.3rem !important;
}

.address-container-no-additional-info {
margin-top: 4.5rem;
}

.address-container {
margin-top: -3.25rem;
margin-top: -3.2rem;
}

.letter-container {
margin-top: 5.5rem;
margin-top: 4.75rem;
}
</style>
16 changes: 12 additions & 4 deletions legal-api/src/legal_api/reports/report_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from flask import current_app, jsonify
from jinja2 import Template

from legal_api.models import Address
from legal_api.models import Address, Business
from legal_api.reports.registrar_meta import RegistrarInfo
from legal_api.services import MrasService
from legal_api.utils.base import BaseEnum
Expand Down Expand Up @@ -133,7 +133,8 @@ def _get_template_data(self):
def _format_furnishing_data(self):
self._report_data['furnishing'] = {
'businessName': self._furnishing.business_name,
'businessIdentifier': self._furnishing.business_identifier
'businessIdentifier': self._furnishing.business_identifier,
'businessLegalType': self._business.legal_type
}

if self._furnishing.last_ar_date:
Expand All @@ -153,7 +154,14 @@ def _set_meta_info(self):
self._report_data['variant'] = self._variant
else:
self._report_data['variant'] = 'default'
self._report_data['title'] = ReportMeta.reports[self._document_key]['reportDescription'].upper()

title = ReportMeta.reports[self._document_key]['reportDescription']
if self._document_key == ReportTypes.DISSOLUTION:
if self._business.legal_type in [Business.LegalTypes.EXTRA_PRO_A.value]:
title = title.replace('{{REPORT_TYPE}}', 'CANCELLATION')
else:
title = title.replace('{{REPORT_TYPE}}', 'DISSOLUTION')
self._report_data['title'] = title.upper()

def _set_address(self):
if (furnishing_address := Address.find_by(furnishings_id=self._furnishing.id)):
Expand Down Expand Up @@ -244,6 +252,6 @@ class ReportMeta:
ReportTypes.DISSOLUTION: {
'reportName': 'dissoluion',
'templateName': 'noticeOfDissolutionCommencement',
'reportDescription': 'Notice of Commencement of Dissolution'
'reportDescription': 'Notice of Commencement of {{REPORT_TYPE}}'
}
}
4 changes: 2 additions & 2 deletions legal-api/tests/unit/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ def factory_furnishing(business_id,
return furnishing


def factory_business_with_stage_one_furnishing():
def factory_business_with_stage_one_furnishing(legal_type=None):
"""Create a business with a stage one furnishing entry."""
business = factory_business('BC1234567')
business = factory_business(identifier='BC1234567', entity_type=legal_type)
factory_business_mailing_address(business)
batch = factory_batch()
furnishing = factory_furnishing(business_id=business.id,
Expand Down
17 changes: 11 additions & 6 deletions legal-api/tests/unit/reports/test_report_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@


@pytest.mark.parametrize(
'test_name, variant', [
('COMMENCEMENT_DEFAULT', 'default'),
('COMMENCEMENT_GREYSCALE', 'greyscale'),
'test_name, variant, legal_type', [
('COMMENCEMENT_DEFAULT_DISSOLUTION', 'default', 'BEN'),
('COMMENCEMENT_GREYSCALE_DISSOLUTION', 'greyscale', 'BC'),
('COMMENCEMENT_DEFAULT_CANCELLATION', 'default', 'A'),
('COMMENCEMENT_GREYSCALE_CANCELLATION', 'greyscale', 'A'),
]
)
def test_get_pdf(session, test_name, variant):
def test_get_pdf(session, test_name, variant, legal_type):
"""Assert that furnishing can be returned as a Gotenberg PDF."""
business, furnishing = factory_business_with_stage_one_furnishing()
business, furnishing = factory_business_with_stage_one_furnishing(legal_type=legal_type)
with patch.object(MrasService, 'get_jurisdictions', return_value=[]):
report = ReportV2(business, furnishing, ReportTypes.DISSOLUTION, variant)
filename = report._get_report_filename()
Expand All @@ -40,7 +42,10 @@ def test_get_pdf(session, test_name, variant):
assert template_data['furnishing']
assert template_data['variant'] == variant
assert template_data['registrarInfo']
assert template_data['title'] == 'NOTICE OF COMMENCEMENT OF DISSOLUTION'
if legal_type == 'A':
assert template_data['title'] == 'NOTICE OF COMMENCEMENT OF CANCELLATION'
else:
assert template_data['title'] == 'NOTICE OF COMMENCEMENT OF DISSOLUTION'
report_files = report._get_report_files(template_data)
assert report_files
assert 'header.html' in report_files
Expand Down

0 comments on commit a424337

Please sign in to comment.