From bcbfee60107d51678e17b9d7aaa4ddb3d69c6447 Mon Sep 17 00:00:00 2001 From: Doug Lovett Date: Mon, 11 Mar 2024 15:40:15 -0700 Subject: [PATCH 1/4] UXA transport permit/amend permit updates. Signed-off-by: Doug Lovett --- .../report-templates/transportPermitV2.html | 27 ++++++++++--------- mhr_api/src/mhr_api/models/db2/utils.py | 8 ++++-- .../src/mhr_api/models/registration_utils.py | 2 +- mhr_api/src/mhr_api/reports/v2/report.py | 3 ++- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/mhr_api/report-templates/transportPermitV2.html b/mhr_api/report-templates/transportPermitV2.html index 17b745651..dcb974c0f 100644 --- a/mhr_api/report-templates/transportPermitV2.html +++ b/mhr_api/report-templates/transportPermitV2.html @@ -87,23 +87,13 @@ [[registration/location.html]] - {% if messages is defined %} - {% for message in messages %} -
- {% if message.messageType == 'WIDTH' %} - SPECIAL TRANSPORT RESTRICTIONS APPLY TO THIS MANUFACTURED HOME DUE TO THE WIDTH. PLEASE CONTACT THE PROVINCIAL PERMIT CENTRE 1-800-559-9688 FOR FURTHER DETAILS. - {% endif %} -
- {% endfor %} - {% endif %} -
Transport Permit Conditions
@@ -133,16 +123,27 @@ [[registration/submittingParty.html]]
+ {% if messages is defined %} + {% for message in messages %} +
+ {% if message.messageType == 'WIDTH' %} + A manufactured home may be subject to routing restrictions in accordance with the requirements of the Ministry + of Transportation and Infrastructure. You are responsible for confirming any such restrictions and you may visit + onRouteBC - Home (gov.bc.ca) or contact the Provincial Permit Centre for details. + {% endif %} +
+ {% endfor %} + {% endif %} {% if location.address.region != 'BC' %}
The Manufactured Home Registry now records this manufactured home as moving to the location outside of British Columbia (BC) specified in the permit. Upon leaving BC, this home is exempt from the Manufactured Home Act. If it re-enters BC, the home must be - re-registered under the same manufactured home registation number. + re-registered under the same manufactured home registration number.
- A report must be submitted to the Registrar within 3 days of expiry if either of the following apply: + A report must be submitted to the Registrar within 3 days if either of the following apply:
  • The manufactured home is not moved before the transport permit expires
  • The home is permanently moved to a different location than what is specified on the tranpsort permit
  • diff --git a/mhr_api/src/mhr_api/models/db2/utils.py b/mhr_api/src/mhr_api/models/db2/utils.py index a365f2087..c22b0f955 100755 --- a/mhr_api/src/mhr_api/models/db2/utils.py +++ b/mhr_api/src/mhr_api/models/db2/utils.py @@ -596,7 +596,8 @@ def __update_summary_info(result, results, reg_summary_list, staff, account_id): result['registrationType'] = TO_REGISTRATION_TYPE.get('DEFAULT') else: result['registrationType'] = summary_result.get('registration_type') - if result['registrationType'] == MhrRegistrationTypes.REG_STAFF_ADMIN and summary_result.get('doc_description'): + if result['registrationType'] in (MhrRegistrationTypes.REG_STAFF_ADMIN, + MhrRegistrationTypes.AMENDMENT) and summary_result.get('doc_description'): result['registrationDescription'] = summary_result.get('doc_description') elif result['registrationType'] == MhrRegistrationTypes.REG_NOTE: doc_type = result.get('documentType') @@ -654,6 +655,8 @@ def __build_summary(row, add_in_user_list: bool = True, mhr_list=None): } if add_in_user_list: summary['inUserList'] = False + if summary['documentType'] == Db2Document.DocumentTypes.CORRECTION and row[12]: + summary['documentType'] = MhrDocumentTypes.AMEND_PERMIT.value if mhr_list and summary['documentType'] in (Db2Document.DocumentTypes.CONV, Db2Document.DocumentTypes.MHREG_TRIM): summary['lienRegistrationType'] = __get_lien_registration_type(mhr_number, mhr_list) elif summary['documentType'] in (MhrDocumentTypes.NCAN, MhrDocumentTypes.NRED, MhrDocumentTypes.EXRE): @@ -661,7 +664,8 @@ def __build_summary(row, add_in_user_list: bool = True, mhr_list=None): elif summary['documentType'] in (MhrDocumentTypes.CAU, MhrDocumentTypes.CAUC, MhrDocumentTypes.CAUE): summary = __get_caution_info(summary, row) elif summary['documentType'] in (Db2Document.DocumentTypes.PERMIT, - Db2Document.DocumentTypes.PERMIT_TRIM) and row[12]: + Db2Document.DocumentTypes.PERMIT_TRIM, + MhrDocumentTypes.AMEND_PERMIT.value) and row[12]: expiry = row[12] summary['expireDays'] = model_utils.expiry_date_days(expiry) summary = __set_frozen_status(summary, row) diff --git a/mhr_api/src/mhr_api/models/registration_utils.py b/mhr_api/src/mhr_api/models/registration_utils.py index 183bf45f8..f43aa4277 100644 --- a/mhr_api/src/mhr_api/models/registration_utils.py +++ b/mhr_api/src/mhr_api/models/registration_utils.py @@ -771,7 +771,7 @@ def __build_summary(row, account_id: str, staff: bool, add_in_user_list: bool = summary = __get_cancel_info(summary, row) elif doc_type in (MhrDocumentTypes.CAU, MhrDocumentTypes.CAUC, MhrDocumentTypes.CAUE): summary = __get_caution_info(summary, row, doc_type) - elif doc_type == MhrDocumentTypes.REG_103 and row[12]: + elif doc_type in (MhrDocumentTypes.REG_103, MhrDocumentTypes.AMEND_PERMIT) and row[12]: expiry = row[12] summary['expireDays'] = model_utils.expiry_ts_days(expiry) summary = __set_frozen_status(summary, row, staff) diff --git a/mhr_api/src/mhr_api/reports/v2/report.py b/mhr_api/src/mhr_api/reports/v2/report.py index 01782df90..6da5967d6 100755 --- a/mhr_api/src/mhr_api/reports/v2/report.py +++ b/mhr_api/src/mhr_api/reports/v2/report.py @@ -566,7 +566,8 @@ def _set_registration_additional_message(self): self._report_data['description'].get('sections'): sections = self._report_data['description'].get('sections') for section in sections: - if section.get('widthFeet', 0) >= 16: + if section.get('widthFeet', 0) > 14 or \ + (section.get('widthFeet', 0) == 14 and section.get('widthInches', 0) > 6): messages.append({'messageType': 'WIDTH'}) break if messages: From 3893be14b1c8a298c04596713a80da1a6f8273a6 Mon Sep 17 00:00:00 2001 From: Doug Lovett Date: Tue, 12 Mar 2024 09:21:56 -0700 Subject: [PATCH 2/4] UXA transport permit/amend permit more updates. Signed-off-by: Doug Lovett --- .../report-templates/transportPermitV2.html | 23 ++++++++++--------- mhr_api/src/mhr_api/reports/v2/report.py | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mhr_api/report-templates/transportPermitV2.html b/mhr_api/report-templates/transportPermitV2.html index dcb974c0f..af816b6c3 100644 --- a/mhr_api/report-templates/transportPermitV2.html +++ b/mhr_api/report-templates/transportPermitV2.html @@ -87,6 +87,18 @@ [[registration/location.html]] + {% if messages is defined %} + {% for message in messages %} +
    + {% if message.messageType == 'WIDTH' %} + A manufactured home may be subject to routing restrictions in accordance with the requirements of the Ministry + of Transportation and Infrastructure. You are responsible for confirming any such restrictions and you may visit + onRouteBC - Home (gov.bc.ca) or contact the Provincial Permit Centre for details. + {% endif %} +
    + {% endfor %} + {% endif %} +
    Transport Permit Conditions
@@ -123,17 +135,6 @@ [[registration/submittingParty.html]]
- {% if messages is defined %} - {% for message in messages %} -
- {% if message.messageType == 'WIDTH' %} - A manufactured home may be subject to routing restrictions in accordance with the requirements of the Ministry - of Transportation and Infrastructure. You are responsible for confirming any such restrictions and you may visit - onRouteBC - Home (gov.bc.ca) or contact the Provincial Permit Centre for details. - {% endif %} -
- {% endfor %} - {% endif %} {% if location.address.region != 'BC' %}
diff --git a/mhr_api/src/mhr_api/reports/v2/report.py b/mhr_api/src/mhr_api/reports/v2/report.py index 6da5967d6..a47ffd27f 100755 --- a/mhr_api/src/mhr_api/reports/v2/report.py +++ b/mhr_api/src/mhr_api/reports/v2/report.py @@ -567,7 +567,7 @@ def _set_registration_additional_message(self): sections = self._report_data['description'].get('sections') for section in sections: if section.get('widthFeet', 0) > 14 or \ - (section.get('widthFeet', 0) == 14 and section.get('widthInches', 0) > 6): + (section.get('widthFeet', 0) == 14 and section.get('widthInches', 0) >= 6): messages.append({'messageType': 'WIDTH'}) break if messages: From e76378ad0ddc607894b0dbd647cf23ec1a7d0adb Mon Sep 17 00:00:00 2001 From: Doug Lovett Date: Tue, 12 Mar 2024 09:24:51 -0700 Subject: [PATCH 3/4] Update amendment reports debtor former name logic. Signed-off-by: Doug Lovett --- ppr-api/src/ppr_api/models/registration.py | 11 ++++++----- ppr-api/src/ppr_api/reports/v2/report.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ppr-api/src/ppr_api/models/registration.py b/ppr-api/src/ppr_api/models/registration.py index d278c7294..21fb780bf 100644 --- a/ppr-api/src/ppr_api/models/registration.py +++ b/ppr-api/src/ppr_api/models/registration.py @@ -922,15 +922,16 @@ def get_former_party_name(self, new_party: Party): address2 = new_party.client_code.address if address1 and address2 and address1.json != address2.json: return former_name + # Could only be changing a birthdate (names are identical). if new_party.previous_party_id and new_party.previous_party_id == party.id: - if party.client_code and party.client_code.name: + if party.client_code and party.client_code.name and new_party.business_name and \ + new_party.business_name != party.client_code.name: former_name = party.client_code.name - elif party.business_name: + elif party.business_name and new_party.business_name and \ + new_party.business_name != party.business_name: former_name = party.business_name else: - former_name = party.last_name + ', ' + party.first_name - if party.middle_initial: - former_name += ' ' + party.middle_initial + former_name = self.__get_matching_party_name(new_party, party) return former_name if address1 and address2 and address1.json == address2.json: if party.client_code and party.client_code.name: diff --git a/ppr-api/src/ppr_api/reports/v2/report.py b/ppr-api/src/ppr_api/reports/v2/report.py index e05b1fb9c..6e0061965 100755 --- a/ppr-api/src/ppr_api/reports/v2/report.py +++ b/ppr-api/src/ppr_api/reports/v2/report.py @@ -667,7 +667,7 @@ def _set_modified_party(add_party, delete_parties): if add_party.get('amendPartyId', 0) > 0 and add_party['amendPartyId'] == delete_party.get('partyId'): report_utils.set_party_change_type(add_party, delete_party, True) if 'amendPartyId' not in add_party: - report_utils.set_party_change_type(add_party, delete_party, True) + report_utils.set_party_change_type(add_party, delete_party, False) if delete_party.get('edit'): break From d401922a6c260a38a777b94b6f4ecf40744d8bef Mon Sep 17 00:00:00 2001 From: Doug Lovett Date: Tue, 12 Mar 2024 13:51:12 -0700 Subject: [PATCH 4/4] Update amendment reports debtor former name logic. Signed-off-by: Doug Lovett --- ppr-api/src/ppr_api/models/registration.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ppr-api/src/ppr_api/models/registration.py b/ppr-api/src/ppr_api/models/registration.py index 21fb780bf..dc659f506 100644 --- a/ppr-api/src/ppr_api/models/registration.py +++ b/ppr-api/src/ppr_api/models/registration.py @@ -920,7 +920,9 @@ def get_former_party_name(self, new_party: Party): address1 = party.client_code.address if address2 is None and new_party.client_code: address2 = new_party.client_code.address - if address1 and address2 and address1.json != address2.json: + if address1 and address2 and address1.json != address2.json and \ + (not new_party.previous_party_id or + (new_party.previous_party_id and new_party.previous_party_id == party.id)): return former_name # Could only be changing a birthdate (names are identical). if new_party.previous_party_id and new_party.previous_party_id == party.id: @@ -934,9 +936,11 @@ def get_former_party_name(self, new_party: Party): former_name = self.__get_matching_party_name(new_party, party) return former_name if address1 and address2 and address1.json == address2.json: - if party.client_code and party.client_code.name: + if party.client_code and party.client_code.name and new_party.business_name and \ + new_party.business_name != party.client_code.name: former_name = party.client_code.name - elif party.business_name: + elif party.business_name and new_party.business_name and \ + new_party.business_name != party.business_name: former_name = party.business_name else: # match if only 1 name is different in addition to same address.