Skip to content

Commit

Permalink
20249 20244 20251 mhr reports (#1779)
Browse files Browse the repository at this point in the history
* UXA transport permit/amend permit updates.

Signed-off-by: Doug Lovett <[email protected]>

* UXA transport permit/amend permit more updates.

Signed-off-by: Doug Lovett <[email protected]>

* Update amendment reports debtor former name logic.

Signed-off-by: Doug Lovett <[email protected]>

* Update amendment reports debtor former name logic.

Signed-off-by: Doug Lovett <[email protected]>

---------

Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Mar 13, 2024
1 parent a15999c commit 7a5d1b8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
12 changes: 7 additions & 5 deletions mhr_api/report-templates/transportPermitV2.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@

{% if messages is defined %}
{% for message in messages %}
<div class="no-page-break section-data pt-5">
<div class="no-page-break section-data mt-5">
{% 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.
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 %}
</div>
{% endfor %}
Expand All @@ -103,7 +105,7 @@
<tr>
<td>1.</td>
<td class="pl-2">
<div>A report must be submitted to the Registrar within 3 days of expiry if either of the following apply:
<div>A report must be submitted to the Registrar within 3 days if either of the following apply:
<div class="pl-3">(a) The manufactured home is not moved before the transport permit expires, or</div>
<div class="pl-3">(b) The home is permanently moved to a different location than what is specified on the tranpsort permit.</div>
</td>
Expand Down Expand Up @@ -138,11 +140,11 @@
<div class="section-data mt-5">
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.
</div>

<div class="section-data mt-5">
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:
<ul>
<li>The manufactured home is not moved before the transport permit expires</li>
<li>The home is permanently moved to a different location than what is specified on the tranpsort permit</li>
Expand Down
8 changes: 6 additions & 2 deletions mhr_api/src/mhr_api/models/db2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -654,14 +655,17 @@ 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):
summary = __get_cancel_info(summary, row)
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)
Expand Down
2 changes: 1 addition & 1 deletion mhr_api/src/mhr_api/models/registration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion mhr_api/src/mhr_api/reports/v2/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 13 additions & 8 deletions ppr-api/src/ppr_api/models/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,22 +920,27 @@ 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:
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:
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.
Expand Down
2 changes: 1 addition & 1 deletion ppr-api/src/ppr_api/reports/v2/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7a5d1b8

Please sign in to comment.