diff --git a/legal-api/report-templates/annualReport.html b/legal-api/report-templates/annualReport.html index 812d944153..de4e167833 100644 --- a/legal-api/report-templates/annualReport.html +++ b/legal-api/report-templates/annualReport.html @@ -1,67 +1,65 @@ [[macros.html]] - - {{ meta_title }} + Annual Report - - -[[style.html]] - + [[common/style.html]] + {% if enable_sandbox %} + [[common/watermark.html]] + {% endif %} - - - [[logo.html]] - -
-
-
- {{ header.ARFilingYear }} BC COOPERATIVE ANNUAL REPORT -
-
- BC Cooperative • Cooperative Association Act -
- -
-
- {{ business.legalName }} -
- - -
- - - - - - - - - - - - - - - - - -
Incorporation Number:{{ business.identifier }}
Business Number:{{ business.tax_id }}
Filing Date and Time:{{ filing_date_time }}
Annual General Meeting (AGM) Date:{{ agm_date }}
-
- {% if effective_date is defined %} -[[addresses.html]] - -[[directors.html]] -{% endif %} -[[certification.html]] - +
+ + + + + + +
+
+ [[common/businessDetails.html]] + {% if business.legalType == 'CP' %} +
+ + + + + + +
+
+
+ {% if effective_date is defined %} + [[addresses.html]] +
-[[footer.html]] - + [[directors.html]] + {% endif %} + [[certification.html]] +
+ {% else %} +
+
+ [[bc-annual-report/legalObligations.html]] +
+ {% endif %} diff --git a/legal-api/report-templates/bcAddressChange.html b/legal-api/report-templates/bcAddressChange.html deleted file mode 100644 index 17a5c2d329..0000000000 --- a/legal-api/report-templates/bcAddressChange.html +++ /dev/null @@ -1,38 +0,0 @@ -[[macros.html]] - - - - Address Change - - - [[common/style.html]] - {% if enable_sandbox %} - [[common/watermark.html]] - {% endif %} - - -
- - - - - - -
- -
-
- [[common/businessDetails.html]] -
-
- [[bc-address-change/addresses.html]] -
- - diff --git a/legal-api/report-templates/bcAnnualReport.html b/legal-api/report-templates/bcAnnualReport.html deleted file mode 100644 index 8962c6ced4..0000000000 --- a/legal-api/report-templates/bcAnnualReport.html +++ /dev/null @@ -1,38 +0,0 @@ -[[macros.html]] - - - - Annual Report - - - [[common/style.html]] - {% if enable_sandbox %} - [[common/watermark.html]] - {% endif %} - - -
- - - - - - -
- -
-
- [[common/businessDetails.html]] -
-
- [[bc-annual-report/legalObligations.html]] -
- - diff --git a/legal-api/report-templates/bcDirectorChange.html b/legal-api/report-templates/bcDirectorChange.html deleted file mode 100644 index c35b898f52..0000000000 --- a/legal-api/report-templates/bcDirectorChange.html +++ /dev/null @@ -1,38 +0,0 @@ -[[macros.html]] - - - - Director Change - - - [[common/style.html]] - {% if enable_sandbox %} - [[common/watermark.html]] - {% endif %} - - -
- - - - - - -
- -
-
- [[common/businessDetails.html]] -
-
- [[bc-director-change/directors.html]] -
- - diff --git a/legal-api/report-templates/changeOfAddress.html b/legal-api/report-templates/changeOfAddress.html index f59cc97590..0ffacaac71 100644 --- a/legal-api/report-templates/changeOfAddress.html +++ b/legal-api/report-templates/changeOfAddress.html @@ -1,65 +1,40 @@ [[macros.html]] - - {{ meta_title }} + Address Change - - -[[style.html]] - + [[common/style.html]] + {% if enable_sandbox %} + [[common/watermark.html]] + {% endif %} - - - [[logo.html]] - -
-
-
- BC COOPERATIVE ADDRESS CHANGE -
-
- BC Cooperative • Cooperative Association Act -
- -
-
- {{ business.legalName }} -
- - -
- - - - - - - - - - - - - - - - - -
Incorporation Number:{{ business.identifier }}
Business Number:{{ business.tax_id }}
Filing Date and Time:{{ filing_date_time }}
Date of Change:{{ effective_date }}
-
- -[[addresses.html]] - -[[certification.html]] - +
+ + + + + + +
+
- -[[footer.html]] - + [[common/businessDetails.html]] +
+ [[addresses.html]] + {% if business.legalType == 'CP' %} + [[certification.html]] + {% endif %} +
diff --git a/legal-api/report-templates/changeOfDirectors.html b/legal-api/report-templates/changeOfDirectors.html index f21276a126..e19937b22b 100644 --- a/legal-api/report-templates/changeOfDirectors.html +++ b/legal-api/report-templates/changeOfDirectors.html @@ -1,66 +1,40 @@ [[macros.html]] - - {{ meta_title }} + Director Change - - -[[style.html]] - + [[common/style.html]] + {% if enable_sandbox %} + [[common/watermark.html]] + {% endif %} - - - [[logo.html]] - -
-
-
- BC COOPERATIVE DIRECTOR CHANGE -
-
- BC Cooperative • Cooperative Association Act -
- -
-
- {{ business.legalName }} -
- - -
- - - - - - - - - - - - - - - - - -
Incorporation Number:{{ business.identifier }}
Business Number:{{ business.tax_id }}
Filing Date and Time:{{ filing_date_time }}
Effective Date of Change:{{ effective_date }}
-
- -[[directors.html]] - -[[certification.html]] - - +
+ + + + + + +
+
- -[[footer.html]] - + [[common/businessDetails.html]] +
+ [[directors.html]] + {% if business.legalType == 'CP' %} + [[certification.html]] + {% endif %} +
diff --git a/legal-api/report-templates/template-parts/addresses.html b/legal-api/report-templates/template-parts/addresses.html index cb0ecdcf3b..9eb78e2c0c 100644 --- a/legal-api/report-templates/template-parts/addresses.html +++ b/legal-api/report-templates/template-parts/addresses.html @@ -1,30 +1,74 @@ {% if registeredOfficeAddress is defined %} -
REGISTERED OFFICE ADDRESS
+
Registered Office Information
+ + + + + + +{% endif %} -
- - - - - -
-
Delivery Address {% if 'addressChanged' in registeredOfficeAddress.deliveryAddress.actions %}{{ labelNew() }}{% endif %}
-
{{ registeredOfficeAddress.deliveryAddress.streetAddress }}
-
{{ registeredOfficeAddress.deliveryAddress.streetAddressAdditional }}
-
{{ registeredOfficeAddress.deliveryAddress.addressCity }} - {{ registeredOfficeAddress.deliveryAddress.addressRegion }} -  {{ registeredOfficeAddress.deliveryAddress.postalCode }}
-
{{ registeredOfficeAddress.deliveryAddress.addressCountry }}
-
{{ registeredOfficeAddress.deliveryAddress.deliveryInstructions }}
-
-
Mailing Address {% if 'addressChanged' in registeredOfficeAddress.mailingAddress.actions %}{{ labelNew() }}{% endif %}
-
{{ registeredOfficeAddress.mailingAddress.streetAddress }}
-
{{ registeredOfficeAddress.mailingAddress.streetAddressAdditional }}
-
{{ registeredOfficeAddress.mailingAddress.addressCity }} - {{ registeredOfficeAddress.mailingAddress.addressRegion }} -  {{ registeredOfficeAddress.mailingAddress.postalCode }}
-
{{ registeredOfficeAddress.mailingAddress.addressCountry }}
-
{{ registeredOfficeAddress.mailingAddress.deliveryInstructions }}
-
-
+{% if recordsOfficeAddress is defined %} +
+
+
Records Office Information
+
+ + + + + + {% endif %} diff --git a/legal-api/report-templates/template-parts/bc-address-change/addresses.html b/legal-api/report-templates/template-parts/bc-address-change/addresses.html deleted file mode 100644 index 7def33c8f4..0000000000 --- a/legal-api/report-templates/template-parts/bc-address-change/addresses.html +++ /dev/null @@ -1,74 +0,0 @@ -{% if registeredOfficeAddress is defined %} -
Registered Office Information
- - - - - - -{% endif %} - -{% if recordsOfficeAddress is defined %} -
-
-
Records Office Information
-
- - - - - - -{% endif %} diff --git a/legal-api/report-templates/template-parts/bc-director-change/directors.html b/legal-api/report-templates/template-parts/bc-director-change/directors.html deleted file mode 100644 index e84c23b22c..0000000000 --- a/legal-api/report-templates/template-parts/bc-director-change/directors.html +++ /dev/null @@ -1,169 +0,0 @@ -{% if listOfDirectors is defined %} -
New Directors Appointed or Elected
- - {% for director in listOfDirectors.directorsAppointed %} - - - - - - {% else %} - - - - {% endfor %} - - -
-
-
Ceased Directors
-
- - {% for director in listOfDirectors.directorsCeased %} - - - - - - {% else %} - - - - {% endfor %} - - -
-
-
All Directors as of {{ effective_date }}
-
- - {% for director in listOfDirectors.directors %} - {% if not director.cessationDate %} - - - - - - {% endif %} - {% else %} - - - - {% endfor %} - -{% endif %} diff --git a/legal-api/report-templates/template-parts/common/businessDetails.html b/legal-api/report-templates/template-parts/common/businessDetails.html index f981e20481..29401a7f7a 100644 --- a/legal-api/report-templates/template-parts/common/businessDetails.html +++ b/legal-api/report-templates/template-parts/common/businessDetails.html @@ -205,14 +205,22 @@
Incorporation Number:
Filed Date and Time:
{% if header.status == 'COMPLETED' %} -
Address Effective Date and Time:
+ {% if business.legalType == 'CP' %} +
Address Change Date:
+ {% else %} +
Address Effective Date and Time:
+ {% endif %} {% endif %}
{{business.identifier}}
{{filing_date_time}}
{% if header.status == 'COMPLETED' %} -
{{effective_date_time}}
+ {% if business.legalType == 'CP' %} +
{{effective_date}}
+ {% else %} +
{{effective_date_time}}
+ {% endif %} {% endif %} {% elif header.name == 'changeOfDirectors' %} @@ -238,7 +246,9 @@ {% endif %}
Filed Date and Time:
Recognition Date and Time:
+ {% if business.legalType != 'CP' %}
Annual Report Date:
+ {% endif %}
{{business.identifier}}
@@ -247,7 +257,9 @@ {% endif %}
{{filing_date_time}}
{{recognition_date_time}}
+ {% if business.legalType != 'CP' %}
{{effective_date}}
+ {% endif %} {% elif header.name == 'transition' %} diff --git a/legal-api/report-templates/template-parts/common/style.html b/legal-api/report-templates/template-parts/common/style.html index c3e4a9b30b..bae34bb51a 100644 --- a/legal-api/report-templates/template-parts/common/style.html +++ b/legal-api/report-templates/template-parts/common/style.html @@ -199,6 +199,7 @@ td.col-22 { width: 22% !important; } td.col-33 { width: 33% !important; } + td.col-35 { width: 35% !important; } td.col-67 { width: 67% !important; } td.col-50 { width: 50% !important; } diff --git a/legal-api/report-templates/template-parts/directors.html b/legal-api/report-templates/template-parts/directors.html index 64bc2e01fe..bd9d371a06 100644 --- a/legal-api/report-templates/template-parts/directors.html +++ b/legal-api/report-templates/template-parts/directors.html @@ -1,102 +1,182 @@ {% if listOfDirectors is defined %} - -{# only show Appointed and Ceased directors if filing did not come from Colin #} -{% if not source == 'COLIN' %} - - {# APPOINTED #} - -
- NEW DIRECTORS APPOINTED OR ELECTED +
New Directors Appointed or Elected
+ + {% for director in listOfDirectors.directorsAppointed %} + + + + + + {% else %} + + + + {% endfor %} + -
- CEASED DIRECTORS +
+
+
Ceased Directors
+
+ + {% for director in listOfDirectors.directorsCeased %} + + + + + + {% else %} + + + + {% endfor %} + -
- ALL DIRECTORS AS OF {{ effective_date.upper() }} -
-{% for director in listOfDirectors.directors %} -{% if not director.cessationDate %} -
-
- {{ director.officer.lastName }}, - {{ director.officer.firstName }} - {% if director.officer.middleInitial is defined %}{{ director.officer.middleInitial }}{% endif %} - {% if 'appointed' in director.actions %}{{ labelNew() }}{% endif %} - {% if 'nameChanged' in director.actions %} - - (Formerly {{ director.officer.prevLastName }}, - {{ director.officer.prevFirstName }} {{ director.officer.prevMiddleInitial }} - ) - +
+
+
All Directors as of {{ effective_date }}
+
+ + {% for director in listOfDirectors.directors %} + {% if not director.cessationDate %} + + + + + + {% endif %} + {% else %} + + + + {% endfor %} + {% endif %} diff --git a/legal-api/src/legal_api/reports/report.py b/legal-api/src/legal_api/reports/report.py index 9299f730a5..591f984f47 100644 --- a/legal-api/src/legal_api/reports/report.py +++ b/legal-api/src/legal_api/reports/report.py @@ -123,6 +123,13 @@ def _get_report(self, regenerate: bool = False): if response.status_code != HTTPStatus.OK: return jsonify(message=str(response.content)), response.status_code + elif self._filing.status not in [Filing.Status.WITHDRAWN.value, Filing.Status.COMPLETED.value]: + # some sections are available only when filing is completed. + return current_app.response_class( + response=response.content, + status=response.status_code, + mimetype="application/pdf" + ) if regenerate: response_drs = self._document_service.replace_filing_report( @@ -184,8 +191,6 @@ def _substitute_template_parts(template_code): "amalgamation/approvalType", "amalgamation/effectiveDate", "bc-annual-report/legalObligations", - "bc-address-change/addresses", - "bc-director-change/directors", "common/certificateFooter", "common/certificateLogo", "common/certificateRegistrarSignature", @@ -1608,37 +1613,19 @@ class ReportMeta: # pylint: disable=too-few-public-methods "reportType": ReportTypes.FILING.value }, "changeOfAddress": { - "hasDifferentTemplates": True, "filingDescription": "Change of Address", "reportType": ReportTypes.FILING.value, - "default": { - "fileName": "bcAddressChange" - }, - "CP": { - "fileName": "changeOfAddress" - } + "fileName": "changeOfAddress" }, "changeOfDirectors": { - "hasDifferentTemplates": True, "filingDescription": "Change of Directors", "reportType": ReportTypes.FILING.value, - "default": { - "fileName": "bcDirectorChange" - }, - "CP": { - "fileName": "changeOfDirectors" - } + "fileName": "changeOfDirectors" }, "annualReport": { - "hasDifferentTemplates": True, "filingDescription": "Annual Report", "reportType": ReportTypes.FILING.value, - "default": { - "fileName": "bcAnnualReport" - }, - "CP": { - "fileName": "annualReport" - } + "fileName": "annualReport" }, "changeOfName": { "filingDescription": "Change of Name", diff --git a/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py b/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py index 6feb9615d9..3b2f0805da 100644 --- a/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py +++ b/legal-api/src/legal_api/resources/v2/business/business_filings/business_documents.py @@ -105,7 +105,7 @@ def get_documents(identifier: str, # noqa: PLR0911, PLR0912 ), HTTPStatus.NOT_FOUND if _should_regenerate(legal_filing_name): - if jwt.validate_roles([UserRoles.staff, UserRoles.system]): + if jwt.contains_role([UserRoles.staff, UserRoles.system]): return get_pdf(filing.storage, legal_filing_name, True) else: return jsonify(