Skip to content

Commit

Permalink
chore: show zeroes in calculated fields for new entrants compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
dleard committed Dec 17, 2024
1 parent 01d09bc commit 68b330a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bc_obps/reporting/service/compliance_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def calculate_product_emission_limit(
@classmethod
def get_calculated_compliance_data(cls, report_version_id: int) -> ComplianceDataSchemaOut:
naics_data = ComplianceService.get_regulatory_values_by_naics_code(report_version_id)
registration_purpose = ReportVersion.objects.get(pk=report_version_id).report.operation.registration_purpose
##### Don't use schemas, use classes or dicts
compliance_product_list: List[ReportProductComplianceSchema] = []
total_allocated_reporting_only = Decimal(0)
Expand Down Expand Up @@ -188,6 +189,12 @@ def get_calculated_compliance_data(cls, report_version_id: int) -> ComplianceDat
excess_emissions = total_allocated_for_compliance_2024 - emissions_limit_total
else:
credited_emissions = emissions_limit_total - total_allocated_for_compliance_2024

if registration_purpose == 'New Entrant Operation':
total_allocated_for_compliance_2024 = Decimal(0)
emissions_limit_total = Decimal(0)
excess_emissions = Decimal(0)
credited_emissions = Decimal(0)
# Craft return object with all data
return_object = ComplianceDataSchemaOut(
emissions_attributable_for_reporting=attributable_for_reporting_total,
Expand Down

0 comments on commit 68b330a

Please sign in to comment.