Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12777 - Add in details field for invoice. This allows us to move some LEAR sp… #1881

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,9 @@ def create_invoice(business: Business, # pylint: disable=too-many-locals,too-ma
},
'filingInfo': {
'filingTypes': filing_types
}
},
'details': ListFilingResource.details_for_invoice(business.identifier, corp_type)
}

folio_number = filing.json['filing']['header'].get('folioNumber', None)
if folio_number:
payload['filingInfo']['folioNumber'] = folio_number
Expand Down Expand Up @@ -911,3 +911,16 @@ def delete_from_minio(filing):
.get('courtOrder', {})
.get('fileKey', None)):
MinioService.delete_file(file_key)

@staticmethod
def details_for_invoice(business_identifier: str, corp_type: str):
"""Generate details for invoice."""
# Avoid temporary identifiers.
if not business_identifier or business_identifier.startswith('T'):
return []
return [
{
'label': 'Registration Number:' if corp_type in ('SP', 'GP') else 'Incorporation Number:',
'value': f'{business_identifier}'
}
]