From f78af66ea51c69a39d42b7e85eb3a74368c383fe Mon Sep 17 00:00:00 2001 From: Prashanth Date: Wed, 16 Aug 2023 14:07:45 -0700 Subject: [PATCH] System converts credits to compliance units when accepting a complicance report prior to 2023 --- .../test/test_carbon_intensity_limits.json | 39 +- .../api/fixtures/test/test_fuel_codes.json | 24 + .../test_pre_compliance_unit_reporting.json | 378 ++++++++ .../payloads/compliance_unit_payloads.py | 57 ++ ...t_compliance_unit_reporting_before_2023.py | 849 ++++++++++++++++++ .../ScheduleSummaryContainer.js | 4 +- .../schedule_summary/LCFSSummaryContainer.js | 29 - .../schedule_summary/Part3SummaryContainer.js | 6 + .../schedule_summary/ScheduleSummaryLCFS.js | 137 --- .../schedule_summary/ScheduleSummaryPart3.js | 2 +- 10 files changed, 1355 insertions(+), 170 deletions(-) create mode 100644 backend/api/fixtures/test/test_pre_compliance_unit_reporting.json create mode 100644 backend/api/tests/payloads/compliance_unit_payloads.py create mode 100644 backend/api/tests/test_compliance_unit_reporting_before_2023.py delete mode 100644 frontend/src/schedule_summary/LCFSSummaryContainer.js delete mode 100644 frontend/src/schedule_summary/ScheduleSummaryLCFS.js diff --git a/backend/api/fixtures/test/test_carbon_intensity_limits.json b/backend/api/fixtures/test/test_carbon_intensity_limits.json index 44bdd22f5..beec13ceb 100644 --- a/backend/api/fixtures/test/test_carbon_intensity_limits.json +++ b/backend/api/fixtures/test/test_carbon_intensity_limits.json @@ -70,4 +70,41 @@ }, "model": "api.carbonintensitylimit", "pk": null -}] \ No newline at end of file +}, { + "fields": { + "compliance_period": ["2023"], + "fuel_class": ["Diesel"], + "density": "79.64", + "effective_date": "2023-01-01" + }, + "model": "api.carbonintensitylimit", + "pk": null +}, { + "fields": { + "compliance_period": ["2023"], + "fuel_class": ["Gasoline"], + "density": "74.08", + "effective_date": "2023-01-01" + }, + "model": "api.carbonintensitylimit", + "pk": null +}, { + "fields": { + "compliance_period": ["2022"], + "fuel_class": ["Diesel"], + "density": "79.64", + "effective_date": "2022-01-01" + }, + "model": "api.carbonintensitylimit", + "pk": null +}, { + "fields": { + "compliance_period": ["2022"], + "fuel_class": ["Gasoline"], + "density": "74.08", + "effective_date": "2022-01-01" + }, + "model": "api.carbonintensitylimit", + "pk": null +} +] \ No newline at end of file diff --git a/backend/api/fixtures/test/test_fuel_codes.json b/backend/api/fixtures/test/test_fuel_codes.json index 9f54f969f..28746280b 100644 --- a/backend/api/fixtures/test/test_fuel_codes.json +++ b/backend/api/fixtures/test/test_fuel_codes.json @@ -21,6 +21,30 @@ "model": "api.fuelcode", "pk": 1 }, + { + "model": "api.fuelcode", + "pk": 21, + "fields": { + "fuel_code": "BCLCF", + "fuel_code_version": "114", + "fuel_code_version_minor": "0", + "company": "ETH Alco", + "carbon_intensity": "38.12", + "application_date": "2021-09-01", + "effective_date": "2021-09-02", + "expiry_date": "2024-09-01", + "fuel": ["LNG"], + "feedstock": "MSW", + "feedstock_location": "Test", + "feedstock_misc": "", + "facility_location": "Test", + "facility_nameplate": "654", + "former_company": "", + "approval_date": "2021-09-02", + "status": ["Approved"], + "renewable_percentage": "50.00" + } + }, { "fields": { "fuel_code": 1, diff --git a/backend/api/fixtures/test/test_pre_compliance_unit_reporting.json b/backend/api/fixtures/test/test_pre_compliance_unit_reporting.json new file mode 100644 index 000000000..eacbd745b --- /dev/null +++ b/backend/api/fixtures/test/test_pre_compliance_unit_reporting.json @@ -0,0 +1,378 @@ +[ + { + "fields": { + "fuel_supplier_status": "Draft", + "analyst_status": "Unreviewed", + "director_status": "Unreviewed", + "manager_status": "Unreviewed" + }, + "model": "api.compliancereportworkflowstate", + "pk": 1 + }, + { + "fields": { + "fuel_supplier_status": "Submitted", + "analyst_status": "Unreviewed", + "director_status": "Unreviewed", + "manager_status": "Unreviewed" + }, + "model": "api.compliancereportworkflowstate", + "pk": 2 + }, + { + "fields": { + "fuel_supplier_status": "Draft", + "analyst_status": "Unreviewed", + "director_status": "Unreviewed", + "manager_status": "Unreviewed" + }, + "model": "api.compliancereportworkflowstate", + "pk": 3 + }, + { + "fields": { + "status": 1, + "type": [ + "Compliance Report" + ], + "organization": [ + "Test Org 1" + ], + "compliance_period": [ + "2018" + ], + "create_timestamp": "2019-01-01", + "update_timestamp": "2019-01-01", + "root_report": 1, + "latest_report": 1, + "traversal": 0 + }, + "model": "api.compliancereport", + "pk": 1 + }, + { + "fields": { + "status": 2, + "type": [ + "Exclusion Report" + ], + "organization": [ + "Test Org 1" + ], + "compliance_period": [ + "2018" + ], + "create_timestamp": "2019-01-01", + "update_timestamp": "2019-01-01", + "root_report": 2, + "latest_report": 2, + "traversal": 0 + }, + "model": "api.compliancereport", + "pk": 2 + }, + { + "fields": { + "status": 3, + "type": [ + "Compliance Report" + ], + "organization": [ + "Test Org 1" + ], + "compliance_period": [ + "2019" + ], + "create_timestamp": "2019-01-01", + "update_timestamp": "2019-01-01", + "root_report": 3, + "latest_report": 3, + "traversal": 0 + }, + "model": "api.compliancereport", + "pk": 3 + }, + { + "fields": { + "role": [ + "ComplianceReporting" + ], + "user": [ + "fs_user_1" + ] + }, + "model": "api.userrole", + "pk": null + }, + { + "fields": { + "description": "Other", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.expecteduse", + "pk": 3 + }, + { + "fields": { + "the_type": "Received", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.notionaltransfertype", + "pk": 1 + }, + { + "fields": { + "the_type": "Carbon Intensity", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.carbonintensitydeterminationtype", + "pk": 1 + }, + { + "fields": { + "the_type": "Fuel Code", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.carbonintensitydeterminationtype", + "pk": 2 + }, + { + "fields": { + "the_type": "Default Carbon Intensity", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.carbonintensitydeterminationtype", + "pk": 3 + }, + { + "fields": { + "the_type": "GHGenius", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.carbonintensitydeterminationtype", + "pk": 4 + }, + { + "fields": { + "the_type": "Alternative", + "display_order": 99, + "effective_date": "2017-01-01" + }, + "model": "api.carbonintensitydeterminationtype", + "pk": 5 + }, + { + "model": "api.provisionoftheact", + "pk": 5, + "fields": { + "display_order": 5, + "effective_date": "2017-01-01", + "provision": "Section 6 (5) (a)", + "description": "Prescribed carbon intensity" + } + }, + { + "model": "api.provisionoftheact", + "pk": 6, + "fields": { + "display_order": 6, + "effective_date": "2017-01-01", + "provision": "Section 6 (5) (b)", + "description": "Prescribed carbon intensity" + } + }, + { + "model": "api.provisionoftheact", + "pk": 2, + "fields": { + "display_order": 99, + "effective_date": "2017-01-01", + "provision": "Section 6 (5) (c)", + "description": "Approved fuel code" + } + }, + { + "model": "api.provisionoftheact", + "pk": 4, + "fields": { + "display_order": 4, + "effective_date": "2017-01-01", + "provision": "Section 6 (5) (d) (i)", + "description": "Default Carbon Intensity Value" + } + }, + { + "model": "api.provisionoftheact", + "pk": 3, + "fields": { + "display_order": 99, + "effective_date": "2017-01-01", + "provision": "Section 6 (5) (d) (ii) (A)", + "description": "GHGenius modelled" + } + }, + { + "model": "api.provisionoftheact", + "pk": 1, + "fields": { + "display_order": 99, + "effective_date": "2017-01-01", + "provision": "Section 6 (5) (d) (ii) (B)", + "description": "Alternative Method" + } + }, + { + "model": "api.approvedfuelprovision", + "pk": 11, + "fields": { + "fuel": ["LNG"], + "provision_act": 2, + "determination_type": ["Carbon Intensity"] + } + }, + { + "model": "api.approvedfuelprovision", + "pk": 12, + "fields": { + "fuel": ["CNG"], + "provision_act": 2, + "determination_type": ["Fuel Code"] + } + }, + { + "model": "api.approvedfuelprovision", + "pk": 13, + "fields": { + "fuel": ["LNG"], + "provision_act": 6, + "determination_type": ["Fuel Code"] + } + }, + { + "model": "api.approvedfuelprovision", + "pk": 14, + "fields": { + "fuel": ["CNG"], + "provision_act": 6, + "determination_type": ["Carbon Intensity"] + } + }, + { + "model": "api.energyeffectivenessratiocategory", + "pk": 6, + "fields": { + "display_order": 6, + "name": "Petroleum-based gasoline, natural gas-based gasoline or renewable fuel in relation to gasoline class fuel" + } + }, + { + "model": "api.energyeffectivenessratiocategory", + "pk": 5, + "fields": { + "display_order": 5, + "name": "'Petroleum-based diesel fuel or renewable fuel in relation to diesel class fuel'" + } + }, + { + "model": "api.energyeffectivenessratio", + "pk": 1, + "fields": { + "effective_date": "2016-01-01", + "expiration_date": "2023-12-31", + "category": 6, + "fuel_class": ["Gasoline"], + "ratio": "1.00" + } + }, + { + "model": "api.energyeffectivenessratio", + "pk": 2, + "fields": { + "effective_date": "2016-01-01", + "expiration_date": "2023-12-31", + "category": 5, + "fuel_class": ["Diesel"], + "ratio": "1.00" + } + }, + { + "model": "api.energydensity", + "pk": 4, + "fields": { + "effective_date": "2017-01-01", + "category": 4, + "density": "23.58" + } + }, + { + "model": "api.energydensity", + "pk": 9, + "fields": { + "effective_date": "2017-01-01", + "category": 9, + "density": "38.65" + } + }, + { + "model": "api.approvedfuel", + "pk": 4, + "fields": { + "effective_date": "2017-01-01", + "name": "Ethanol", + "description": "Ethanol produced from biomass", + "credit_calculation_only": false, + "default_carbon_intensity_category": 10, + "energy_density_category": 4, + "energy_effectiveness_ratio_category": 6, + "unit_of_measure": ["L"], + "is_partially_renewable": true + } + }, + { + "model": "api.approvedfuel", + "pk": 19, + "fields": { + "effective_date": "2017-01-01", + "name": "'Petroleum-based diesel'", + "description": "'Diesel fuel, diesel, petroleum-based diesel'", + "credit_calculation_only": true, + "default_carbon_intensity_category": 6, + "energy_density_category": 9, + "energy_effectiveness_ratio_category": 5, + "unit_of_measure": ["L"], + "is_partially_renewable": false + } + }, + { + "fields": { + "determination_type": ["Carbon Intensity"], + "provision_act": 1, + "fuel": ["CNG"] + }, + "model": "api.approvedfuelprovision", + "pk": 500 + }, + { + "fields": { + "determination_type": ["GHGenius"], + "provision_act": 3, + "fuel": ["LNG"] + }, + "model": "api.approvedfuelprovision" + }, + { + "fields": { + "determination_type": ["Carbon Intensity"], + "provision_act": 1, + "fuel": ["LNG"] + }, + "model": "api.approvedfuelprovision", + "pk": 500 + } +] diff --git a/backend/api/tests/payloads/compliance_unit_payloads.py b/backend/api/tests/payloads/compliance_unit_payloads.py new file mode 100644 index 000000000..7c28ac797 --- /dev/null +++ b/backend/api/tests/payloads/compliance_unit_payloads.py @@ -0,0 +1,57 @@ +compliance_unit_initial_payload = { + 'status': { + 'fuelSupplierStatus': 'Draft' + }, + "scheduleB": { + "records": [ + { + "fuelCode": "21", + "fuelType": "Ethanol", + "fuelClass": "Gasoline", + "provisionOfTheAct": "Section 6 (5) (c)", + "quantity": 117933500 + }, + { + "fuelCode": None, + "fuelType": "Petroleum-based diesel", + "fuelClass": "Diesel", + "provisionOfTheAct": "Section 6 (5) (b)", + "quantity": 136896000 + } + ] + }, + 'summary': { + 'creditsOffset': 0, + } +} + +compliance_unit_supplemental_payload = { + 'status': { + 'fuelSupplierStatus': 'Submitted' + }, + "scheduleB": { + "records": [ + { + "fuelCode": "21", + "fuelType": "Ethanol", + "fuelClass": "Gasoline", + "provisionOfTheAct": "Section 6 (5) (c)", + "quantity": 117933500 + }, + { + "fuelCode": None, + "fuelType": "Petroleum-based diesel", + "fuelClass": "Diesel", + "provisionOfTheAct": "Section 6 (5) (b)", + "quantity": 136896000 + } + ] + }, + 'summary': { + 'creditsOffset': 0, + 'creditOffsetA': 0, + 'creditOffsetB': 0, + 'creditOffsetC': 0, + }, + 'supplemental_note': 'test compliance units' +} \ No newline at end of file diff --git a/backend/api/tests/test_compliance_unit_reporting_before_2023.py b/backend/api/tests/test_compliance_unit_reporting_before_2023.py new file mode 100644 index 000000000..27c7c0a96 --- /dev/null +++ b/backend/api/tests/test_compliance_unit_reporting_before_2023.py @@ -0,0 +1,849 @@ +# -*- coding: utf-8 -*- +# pylint: disable=no-member,invalid-name +""" + REST API Documentation for the NRsS TFRS Credit Trading Application + The Transportation Fuels Reporting System is being designed to streamline + compliance reporting for transportation fuel suppliers in accordance with + the Renewable & Low Carbon Fuel Requirements Regulation. + OpenAPI spec version: v1 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" +import json +import logging + +from django.utils import timezone +from rest_framework import status + +from api.models.CompliancePeriod import CompliancePeriod +from api.models.ComplianceReport import ComplianceReport, ComplianceReportStatus, ComplianceReportType, \ + ComplianceReportWorkflowState +from api.models.Organization import Organization +from .base_test_case import BaseTestCase +from .payloads.compliance_unit_payloads import * +from ..services.OrganizationService import OrganizationService + +logger = logging.getLogger('supplemental_reporting') +logger.setLevel(logging.INFO) +handler = logging.StreamHandler() +formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') +handler.setFormatter(formatter) +logger.addHandler(handler) + + +class TestComplianceUnitReporting(BaseTestCase): + """Tests for the compliance unit reporting and supplemental reporting endpoints""" + extra_fixtures = [ + 'test/test_pre_compliance_unit_reporting.json', + 'test/test_fuel_codes.json', + 'test/test_unit_of_measures.json', + 'test/test_carbon_intensity_limits.json', + 'test/test_default_carbon_intensities.json', + 'test/test_petroleum_carbon_intensities.json', + 'test/test_transaction_types.json' + ] + + def _create_draft_compliance_report(self, report_type="Compliance Report"): + report = ComplianceReport() + report.status = ComplianceReportWorkflowState.objects.create( + fuel_supplier_status=ComplianceReportStatus.objects.get_by_natural_key('Draft') + ) + report.organization = Organization.objects.get_by_natural_key( + "Test Org 1") + report.compliance_period = CompliancePeriod.objects.get_by_natural_key('2022') + report.type = ComplianceReportType.objects.get_by_natural_key(report_type) + report.create_timestamp = timezone.now() + report.update_timestamp = timezone.now() + + report.save() + report.refresh_from_db() + return report.id + + def _add_part3_awards_to_org(self, add_credits): + # Create a recommended credit trade request + payload = { + "compliancePeriod": CompliancePeriod.objects.get_by_natural_key('2022').id, + "initiator": self.users['gov_director'].organization.id, + "numberOfCredits": add_credits, + "respondent": self.users['fs_user_1'].organization.id, + "status": self.statuses['recommended'].id, + "tradeEffectiveDate": "2021-01-01", + "type": self.credit_trade_types['part3award'].id, + "is_rescinded": False, + "zeroReason": None, + "comment": "testing" + } + response = self.clients['gov_multi_role'].post( + '/api/credit_trades', + content_type='application/json', + data=json.dumps(payload)) + self.assertEqual(response.status_code, status.HTTP_201_CREATED) + ct_id = response.data['id'] + # Approve the credit trade + payload['status'] = self.statuses['approved'].id + response = self.clients['gov_multi_role'].put( + '/api/credit_trades/{}'.format(ct_id), + content_type='application/json', + data=json.dumps(payload)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + + def _create_supplemental_report(self, rid): + payload = { + 'supplements': rid, + 'status': {'fuelSupplierStatus': 'Draft'}, + 'type': 'Compliance Report', + 'compliancePeriod': '2022' + } + response = self.clients['fs_user_1'].post( + '/api/compliance_reports', + content_type='application/json', + data=json.dumps(payload) + ) + self.assertEqual(response.status_code, status.HTTP_201_CREATED) + sid = response.data['id'] + return sid + + def _patch_fs_user_for_compliance_report(self, payload, cr_id): + response = self.clients['fs_user_1'].patch( + '/api/compliance_reports/{id}'.format(id=cr_id), + content_type='application/json', + data=json.dumps(payload) + ) + self.assertEqual(response.status_code, status.HTTP_200_OK) + return response + + def _acceptance_from_director(self, cr_id): + # we are only allowed to change one status at a time so this + # loops the statuses in order to get to accepted by director + status_payloads = [ + {'user': 'gov_analyst', 'payload': {'status': {'analystStatus': 'Recommended'}}}, + {'user': 'gov_manager', 'payload': {'status': {'managerStatus': 'Recommended'}}}, + {'user': 'gov_director', 'payload': {'status': {'directorStatus': 'Accepted'}}} + ] + for obj in status_payloads: + response = self.clients[obj['user']].patch( + '/api/compliance_reports/{id}'.format(id=cr_id), + content_type='application/json', + data=json.dumps(obj['payload']) + ) + self.assertEqual(response.status_code, 200) + + """ + | Scenario 0: Initial Report in a net credit position | + |--------------------------------------------------------------------------------------------------| + | Line | Description | Units | Example Value | + |------|-------------------------------------------------------------|-------------|---------------| + | 23 | Total credits from fuel supplied (from Schedule B) | Credits | 100,000 | + | 24 | Total debits from fuel supplied (from Schedule B) | (Debits) | 80,000 | + | 25 | Net credit or debit balance for the compliance period | Credits | 20,000 | + | 26 | Total banked credits used to offset outstanding debits | Credits | | + | 27 | Outstanding debit balance | (Debits) | | + | 28 | Part 3 non-compliance penalty payable | $CAD | | + |------|-------------------------------------------------------------|-------------|---------------| + | | Corresponding Compliance Unit conversion / transaction | | +20,000 | + """ + def test_initial_report_in_net_credit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload.copy() + payload['status']['fuelSupplierStatus'] = 'Submitted' + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 20000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), 20000.0) + + """ + | Scenario 1: Initial Report in a net debit position | + |--------------------------------------------------------------------------------------------------| + | Line | Description | Units | Example Value | + |------|-------------------------------------------------------------|-------------|---------------| + | 23 | Total credits from fuel supplied (from Schedule B) | Credits | 105,000 | + | 24 | Total debits from fuel supplied (from Schedule B) | (Debits) | 150,000 | + | 25 | Net credit or debit balance for the compliance period | (Debits) | -45,000 | + | 26 | Total banked credits used to offset outstanding debits | Credits | 45,000 | + | 27 | Outstanding debit balance | (Debits) | 0 | + | 28 | Part 3 non-compliance penalty payable | $CAD | | + |------|-------------------------------------------------------------|-------------|---------------| + | | Corresponding Compliance Unit conversion / transaction | | -45,000 | + """ + def test_initial_report_in_net_debit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 123830000 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256679000 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(50000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 45000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check (50,000 - 45,000) [50,000 from org balance) + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 5000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -45000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 45000.0) + + """ + | Scenario 2: Supplemental Report Submission #1 that increases debit obligation | + |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Example Values - Initial Submission | Example Values - Supplemental #1 | + |---------------------------------------------------------------------------|---------|--------------|-------------------------------------|-------------------------------------|----------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 100,000 | 100,000 | + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 145,000 | 150,000 | + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits) | -45,000 | -50,000 | + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B | Credits | 45,000 | 50,000 | + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a| A | Credits | n/a | 45,000 | + | Banked credits used to offset outstanding debits - Supplemental Report #1 | Line 26b| B (editable) | Credits | n/a | 5,000 | + | Outstanding debit balance | Line 27 | Z - (A+B) | (Debits) | 0 | 0 | + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | | | + |---------------------------------------------------------------------------|---------|--------------|-------------------------------------|-------------------------------------|----------------------------------| + | Report Status (for compliance units conversion) | | | | Accepted | Accepted | + | Corresponding Compliance Unit conversion / transaction | | | | -45,000 | -5,000 | + """ + def test_supplemental_report_submission_increasing_debit_obligation(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 248122823 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(50000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 45000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check (50,000 - 45,000) [50,000 from org balance) + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 5000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -45000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 45000.0) + # Create supplemental report #1 + sid = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 50000 + payload['summary']['creditsOffsetA'] = 45000 + payload['summary']['creditsOffsetB'] = 5000 + self._patch_fs_user_for_compliance_report(payload, sid) + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid)) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check (5000 - 5000) [5000 from org balance) + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 0) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 50000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 45000.0) + self.assertEqual(response.data['summary']['lines']['26B'], 5000.0) + + """ + | Scenario 3: Supplemental Report Submission #2 that increases debit obligation - Example 1 | + |--------------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Initial Submission - Accepted | Example 1 - Supplemental #1 - Accepted | Example 1 - Supplemental #2 - Accepted | + |---------------------------------------------------------------------------|----------|---------------|-------------------------------|----------------------------------------|----------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 100,000 | 100,000 | 100,000 | + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 145,000 | 148,000 | 150,000 | + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits) | -45,000 | -48,000 | -50,000 | + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B+C+D | Credits | 45,000 | 48,000 | 50,000 | + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A+B+C | Credits | n/a | 45,000 | 48,000 | + | Banked credits used to offset outstanding debits - Supplemental Report #2 | Line 26b | D (editable) | Credits | n/a | 3,000 | 2,000 | + | Outstanding debit balance | Line 27 | Z - (A+B+C+D) | (Debits) | 0 | 0 | 0 | + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | $- | $- | $- | + | Report Status (for compliance units conversion) | | | | Accepted | Accepted | Accepted | + | Corresponding Compliance Unit conversion / transaction | | | | -45,000 | -3,000 | -2,000 | + """ + def test_supplemental_report_submission_2_ex1_increasing_debit_obligation(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 248122823 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(50000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 45000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check (50,000 - 45,000) [50,000 from org balance] + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 5000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -45000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 45000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 253256398 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 48000 + payload['summary']['creditsOffsetA'] = 45000 + payload['summary']['creditsOffsetB'] = 3000 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -48000.0) + self.assertEqual(response.data['summary']['lines']['26'], 48000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 45000.0) + self.assertEqual(response.data['summary']['lines']['26B'], 3000.0) + # compliance unit balance check (5000 - 3000) [5000 from org balance] + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 2000) + # Create supplemental report #2 + sid2 = self._create_supplemental_report(sid1) + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 50000 + payload['summary']['creditsOffsetA'] = 48000 + payload['summary']['creditsOffsetB'] = 2000 + self._patch_fs_user_for_compliance_report(payload, sid2) + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid2)) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid2) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid2)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 50000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 48000.0) + self.assertEqual(response.data['summary']['lines']['26B'], 2000.0) + # compliance unit balance check (2000 - 2000) [2000 from org balance] + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 0) + + """ + | Scenario 3: Supplemental Report Submission #2 that increases debit obligation - Example 2 | + |--------------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Initial Submission - Accepted | Example 2 - Supplemental #1 - Submitted | Example 2 - Supplemental #2 - Accepted | + |---------------------------------------------------------------------------|----------|---------------|-------------------------------|--------------------------------|-----------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 100,000 | 100,000 | 100,000 + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 144,000 | 148,000 | 150,000 + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits) | -44,000 | -48,000 | -50,000 + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B+C+D | Credits | 44,000 | 46,000 | 46,000 + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A+B+C | Credits | n/a | 44,000 | 44,000 + | Banked credits used to offset outstanding debits - Supplemental Report #2 | Line 26b | D (editable) | Credits | n/a | 2,000 | 2,000 + | Outstanding debit balance | Line 27 | Z - (A+B+C+D) | (Debits) | 0 | 2,000 | 4,000 + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | $- | $400,000 | $800,000 + |---------------------------------------------------------------------------|----------|---------------|-------------------------------|--------------------------------|-----------------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | | Accepted | Submitted (not Accepted) | Accepted + |---------------------------------------------------------------------------|----------|---------------|-------------------------------|--------------------------------|-----------------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | | -44,000 | | -2,000 + """ + def test_supplemental_report_submission_2_ex2_increasing_debit_obligation(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 246411631 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(50000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 44000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -44000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 44000.0) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 6000) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 253256398 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 46000 + payload['summary']['creditsOffsetA'] = 44000 + payload['summary']['creditsOffsetB'] = 2000 + self._patch_fs_user_for_compliance_report(payload, sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -48000.0) + self.assertEqual(response.data['summary']['lines']['26'], 46000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 44000.0) + self.assertEqual(response.data['summary']['lines']['26B'], 2000.0) + self.assertEqual(response.data['summary']['lines']['27'], -2000.0) + self.assertEqual(response.data['summary']['lines']['28'], 400000.0) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 6000) + # Create supplemental report #2 + sid2 = self._create_supplemental_report(sid1) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 46000 + payload['summary']['creditsOffsetA'] = 44000 + payload['summary']['creditsOffsetB'] = 2000 + self._patch_fs_user_for_compliance_report(payload, sid2) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid2) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid2)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 46000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 44000.0) + self.assertEqual(response.data['summary']['lines']['26B'], 2000.0) + self.assertEqual(response.data['summary']['lines']['27'], -4000.0) + self.assertEqual(response.data['summary']['lines']['28'], 800000.0) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 4000) + + """ + | Scenario 4: Supplemental Report Submission #1 that decreases debit obligation and still in a net debit position overall (Line 25) | + |-----------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Initial Submission - Accepted | Example 1 - Supplemental #1 - Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 100,000 | 100,000 | + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 160,000 | 150,000 | + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits)| -60,000 | -50,000 | + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A-R | Credits | 60,000 | 50,000 | + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A | Credits | n/a | 60,000 | + | Banked credits used to offset outstanding debits - Supplemental Report #1 | Line 26b | Not editable | Credits | n/a | n/a | + | Outstanding debit balance | Line 27 | | (Debits) | 0 | 0 | + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | | | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------|----------------------------------------| + | Banked credits to be returned as a result of supplemental reporting (if applicable) | | R | | | 10,000 | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | | Accepted | Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | | -60,000 | +10,000 | + """ + def test_supplemental_report_submission_1_ex1_decreasing_debit_obligation_under_net_debit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 273790701 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(100000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 60000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 40000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -60000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 60000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 50000 + payload['summary']['creditsOffsetA'] = 60000 + payload['summary']['creditsOffsetB'] = 0 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 50000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 60000.0) + self.assertEqual(response.data['summary']['lines']['27'], 0) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 50000) + + """ + | Scenario 4: Supplemental Report Submission #1 that decreases debit obligation and still in a net debit position overall (Line 25) | + |-----------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Example 2 - Initial Submission - Accepted | Example 2 - Supplemental #1 - Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 100,000 | 100,000 + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 160,000 | 150,000 + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits)| -60,000 | -50,000 + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A-R | Credits | 60,000 | 50,000 + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A | Credits | n/a | 60,000 + | Banked credits used to offset outstanding debits - Supplemental Report #1 | Line 26b | Not editable | Credits | n/a | + | Outstanding debit balance | Line 27 | | (Debits) | 0 | 0 + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------------------|----------------------------------------| + | Banked credits to be returned as a result of supplemental reporting (if applicable) | | R | | | + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | | Submitted (not Accepted) | Accepted + |-------------------------------------------------------------------------------------|----------|--------------|-----------------|-------------------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | | | -50,000 + """ + def test_supplemental_report_submission_1_ex2_decreasing_debit_obligation_under_net_debit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 273790701 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(100000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 60000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 40000) + # exclude the reserved amount as in this case report is not submitted. + self.assertEqual(response.data.get('max_credit_offset_exclude_reserved'), 100000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -60000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 60000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 50000 + payload['summary']['creditsOffsetA'] = 60000 + payload['summary']['creditsOffsetB'] = 0 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 50000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 60000.0) + self.assertEqual(response.data['summary']['lines']['27'], 0) + # compliance unit balance check + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 50000) + + """ + | Scenario 5: Supplemental Report Submission #2 that decreases debit obligation and still in a net debit position overall (Line 25) | + |-----------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | Units | Example 1 - Initial Submission - Accepted | Example 1 - Supplemental #1 - Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 100,000 | + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 170,000 | + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits) | -70,000 | + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B+C-R | Credits | 70,000 | + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A+B+C | Credits | n/a | + | Banked credits used to offset outstanding debits - Supplemental Report #2 | Line 26b | Not editable | Credits | n/a | + | Outstanding debit balance | Line 27 | | (Debits) | 0 | + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Banked credits to be returned as a result of supplemental reporting (if applicable) | | R | | | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | Accepted | Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | | -70,000 | + """ + def test_supplemental_report_submission_2_ex1_decreasing_debit_obligation_under_net_debit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 290902619 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(100000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 70000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 30000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -70000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 70000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 50000 + payload['summary']['creditsOffsetA'] = 70000 + payload['summary']['creditsOffsetB'] = 0 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 50000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 70000.0) + self.assertEqual(response.data['summary']['lines']['27'], 0) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 50000) + + """ + | Scenario 5: Supplemental Report Submission #2 that decreases debit obligation and still in a net debit position overall (Line 25) | + |-----------------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | Units | Example 2 - Initial Submission - Accepted | Example 2 - Supplemental #1 - Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | 100,000 | 100,000 | + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | 150,000 | 170,000 | + | Net credit or debit balance for compliance period | Line 25 | Z | -50,000 | -70,000 | + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B+C-R | 50,000 | 70,000 | + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A+B+C | 70,000 | n/a | + | Banked credits used to offset outstanding debits - Supplemental Report #2 | Line 26b | Not editable | 0 | n/a | + | Outstanding debit balance | Line 27 | | 0 | 0 | + | Part 3 non-compliance penalty payable | Line 28 | | | | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Banked credits to be returned as a result of supplemental reporting (if applicable) | | R | 20,000 | | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | Submitted (not Accepted) | Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | +20,000 | | + """ + def test_supplemental_report_submission_2_ex2_decreasing_debit_obligation_under_net_debit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 290902619 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(100000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 70000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 30000) + # exclude the reserved amount as in this case report is not submitted. + self.assertEqual(response.data.get('max_credit_offset_exclude_reserved'), 100000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -70000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 70000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 117933318 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 256678782 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 50000 + payload['summary']['creditsOffsetA'] = 70000 + payload['summary']['creditsOffsetB'] = 0 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], -50000.0) + self.assertEqual(response.data['summary']['lines']['26'], 50000.0) + self.assertEqual(response.data['summary']['lines']['26A'], 70000.0) + self.assertEqual(response.data['summary']['lines']['27'], 0) + # compliance unit balance check + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 50000) + + """ + | Scenario 6: Supplemental Report Submission #2 that decreases debit obligation and is now in a net credit position (Line 25) | + |-----------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Example 1 - Initial Submission - Accepted | Example 1 - Supplemental #1 - Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 80,000 | 105,000 | + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 100,000 | 100,000 | + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits) | -20,000 | 5,000 | + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B+C-R | Credits | 20,000 | 0 | + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A+B+C | Credits | n/a | 20,000 | + | Banked credits used to offset outstanding debits - Supplemental Report #2 | Line 26b | Not editable | Credits | n/a | 0 | + | Outstanding debit balance | Line 27 | | (Debits) | | | + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | | | + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Banked credits to be returned as a result of supplemental reporting (if applicable) | | R | | | 25,000 | + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | | Accepted | Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | | -20,000 | +25,000 | + """ + def test_supplemental_report_submission_2_ex1_decreasing_debit_obligation_now_in_net_credit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 94346654 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 171119188 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(100000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 20000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # Successful director acceptance + self._acceptance_from_director(rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 80000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -20000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 20000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 123829984 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 171119188 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 0 + payload['summary']['creditsOffsetA'] = 20000 + payload['summary']['creditsOffsetB'] = 0 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], 5000.0) + self.assertEqual(response.data['summary']['lines']['26'], 0) + self.assertEqual(response.data['summary']['lines']['26A'], 20000.0) + self.assertEqual(response.data['summary']['lines']['27'], 0) + # compliance unit balance check + self.assertEqual(min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 105000) + + """ + | Scenario 6: Supplemental Report Submission #2 that decreases debit obligation and is now in a net credit position (Line 25) | + |-----------------------------------------------------------------------------------------------------------------------------| + | Part 3 - Low Carbon Fuel Requirement Summary | Line | | Units | Example 2 - Initial Submission - Accepted | Example 2 - Supplemental #1 - Accepted | + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Total credits from fuel supplied (from Schedule B) | Line 23 | X | Credits | 80,000 | 105,000 + | Total debits from fuel supplied (from Schedule B) | Line 24 | Y | (Debits) | 100,000 | 100,000 + | Net credit or debit balance for compliance period | Line 25 | Z | Credits (Debits) | -20,000 | 5,000 + | Total banked credits used to offset outstanding debits (if applicable) | Line 26 | A+B+C-R | Credits | 20,000 | 0 + | Banked credits used to offset outstanding debits - Previous Reports | Line 26a | A+B+C | Credits | n/a | 20,000 + | Banked credits used to offset outstanding debits - Supplemental Report #2 | Line 26b | Not editable | Credits | n/a | 0 + | Outstanding debit balance | Line 27 | | (Debits) | | + | Part 3 non-compliance penalty payable | Line 28 | | $CAD | | + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Banked credits to be returned as a result of supplemental reporting (if applicable) | | R | | | 5,000 + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Report Status (for compliance units conversion) | | | | Submitted (not Accepted) | Accepted + |-------------------------------------------------------------------------------------|----------|--------------|------------------|-------------------------------------------|----------------------------------------| + | Corresponding Compliance Unit conversion / transaction | | | | | +5,000 + """ + def test_supplemental_report_submission_2_ex2_decreasing_debit_obligation_now_in_net_credit_position(self): + rid = self._create_draft_compliance_report() + # patch compliance report info + payload = compliance_unit_initial_payload + payload['status']['fuelSupplierStatus'] = 'Draft' + payload['scheduleB']['records'][0]['quantity'] = 94346654 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 171119188 # debits of fuel supplied (from Schedule B) + self._patch_fs_user_for_compliance_report(payload, rid) + self._add_part3_awards_to_org(100000) + # Submit the compliance report + payload = { + 'status': {'fuelSupplierStatus': 'Submitted'}, + 'summary': { + 'creditsOffset': 20000, + } + } + self._patch_fs_user_for_compliance_report(payload, rid) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=rid)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + # compliance unit balance check + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 80000) + # exclude the reserved amount as in this case report is not submitted. + self.assertEqual(response.data.get('max_credit_offset_exclude_reserved'), 100000) + self.assertEqual(response.data.get('summary').get('lines').get('25'), -20000.0) + self.assertEqual(response.data.get('summary').get('lines').get('26'), 20000.0) + # Create supplemental report #1 + sid1 = self._create_supplemental_report(rid) + payload = compliance_unit_supplemental_payload + payload['scheduleB']['records'][0]['quantity'] = 123829984 # credits of fuel supplied (from Schedule B) + payload['scheduleB']['records'][1]['quantity'] = 171119188 # debits of fuel supplied (from Schedule B) + payload['summary']['creditsOffset'] = 0 + payload['summary']['creditsOffsetA'] = 20000 + payload['summary']['creditsOffsetB'] = 0 + self._patch_fs_user_for_compliance_report(payload, sid1) + # Successful director acceptance for supplemental report #1 + self._acceptance_from_director(sid1) + # retrieve the compliance report and validate the Summary report fields + response = self.clients['fs_user_1'].get('/api/compliance_reports/{id}'.format(id=sid1)) + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data['summary']['lines']['25'], 5000.0) + self.assertEqual(response.data['summary']['lines']['26'], 0) + self.assertEqual(response.data['summary']['lines']['26A'], 20000) + self.assertEqual(response.data['summary']['lines']['27'], 0) + # compliance unit balance check + self.assertEqual( + min(response.data.get('max_credit_offset'), response.data.get('max_credit_offset_exclude_reserved')), 105000) diff --git a/frontend/src/compliance_reporting/ScheduleSummaryContainer.js b/frontend/src/compliance_reporting/ScheduleSummaryContainer.js index a85fb95fb..bf2133587 100644 --- a/frontend/src/compliance_reporting/ScheduleSummaryContainer.js +++ b/frontend/src/compliance_reporting/ScheduleSummaryContainer.js @@ -237,7 +237,7 @@ class ScheduleSummaryContainer extends Component { value: numericValue } - grid = (Number(this.props.period) >= COMPLIANCE_YEAR) ? Part3SummaryContainer.calculatePart3PayableLCFS(grid, complianceReport) : Part3SummaryContainer.calculatePart3Payable(grid, period) + grid = (Number(this.props.period) >= COMPLIANCE_YEAR) ? Part3SummaryContainer.calculatePart3PayableLCFS(grid, complianceReport) : Part3SummaryContainer.calculatePart3Payable(grid, this.props.period) penalty[SCHEDULE_PENALTY.LINE_28][2] = { ...penalty[SCHEDULE_PENALTY.LINE_28][2], @@ -265,7 +265,7 @@ class ScheduleSummaryContainer extends Component { grid[SCHEDULE_SUMMARY.LINE_26][2].value = creditOffsetA + numericValue - grid = (Number(this.props.period) >= COMPLIANCE_YEAR) ? Part3SummaryContainer.calculatePart3PayableLCFS(grid, complianceReport) : Part3SummaryContainer.calculatePart3Payable(grid, period) + grid = (Number(this.props.period) >= COMPLIANCE_YEAR) ? Part3SummaryContainer.calculatePart3PayableLCFS(grid, complianceReport) : Part3SummaryContainer.calculatePart3Payable(grid, this.props.period) penalty[SCHEDULE_PENALTY.LINE_28][2] = { ...penalty[SCHEDULE_PENALTY.LINE_28][2], diff --git a/frontend/src/schedule_summary/LCFSSummaryContainer.js b/frontend/src/schedule_summary/LCFSSummaryContainer.js deleted file mode 100644 index 3b35e4995..000000000 --- a/frontend/src/schedule_summary/LCFSSummaryContainer.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SCHEDULE_SUMMARY } from '../constants/schedules/scheduleColumns' -import { cellFormatCurrencyTotal, cellFormatNegativeNumber } from '../utils/functions' - -function tableData ( - part3, - summary, - complianceReport -) { - part3[SCHEDULE_SUMMARY.LCFS_LINE_25][2] = cellFormatNegativeNumber(summary.lines['25']) - part3[SCHEDULE_SUMMARY.LCFS_LINE_29_A][2] = cellFormatNegativeNumber(summary.lines['29A']) // Available compliance Unit on March 31, YYYY - part3[SCHEDULE_SUMMARY.LCFS_LINE_29_B][2] = cellFormatNegativeNumber(summary.lines['29B']) // Compliance unit balance change from assessment - part3[SCHEDULE_SUMMARY.LCFS_LINE_28][2] = cellFormatCurrencyTotal(summary.lines['28']) // Non compliance penalty payable - part3[SCHEDULE_SUMMARY.LCFS_LINE_29_C][2] = cellFormatNegativeNumber(summary.lines['29C']) // Available compliance unit balance after assessment - - if (summary.lines['28'] <= 0) { - // if there is no compliane penalty to pay then hide line 28 - part3[SCHEDULE_SUMMARY.LCFS_LINE_28][0].className = 'hidden' - part3[SCHEDULE_SUMMARY.LCFS_LINE_28][1].className = 'hidden' - part3[SCHEDULE_SUMMARY.LCFS_LINE_28][2] = { - className: 'hidden', - value: '' - } - } - return part3 -} - -export { - tableData -} diff --git a/frontend/src/schedule_summary/Part3SummaryContainer.js b/frontend/src/schedule_summary/Part3SummaryContainer.js index 6015a18f7..f80db1db4 100644 --- a/frontend/src/schedule_summary/Part3SummaryContainer.js +++ b/frontend/src/schedule_summary/Part3SummaryContainer.js @@ -58,6 +58,12 @@ function tableData ( value: '' } } + for (let i = SCHEDULE_SUMMARY.LINE_23; i < SCHEDULE_SUMMARY.LINE_28 + 1; i++) { + if (i != SCHEDULE_SUMMARY.LINE_25) { + // Hide lines from 23 to 28 excluding line 25 + part3[i][2].className = 'hidden' + } + } } return part3 diff --git a/frontend/src/schedule_summary/ScheduleSummaryLCFS.js b/frontend/src/schedule_summary/ScheduleSummaryLCFS.js deleted file mode 100644 index ac453f134..000000000 --- a/frontend/src/schedule_summary/ScheduleSummaryLCFS.js +++ /dev/null @@ -1,137 +0,0 @@ -import React from 'react' -import FontAwesomeIcon from '@fortawesome/react-fontawesome' -import { numericInput, numericCurrency } from '../compliance_reporting/components/Columns' -import Tooltip from '../app/components/Tooltip' - -class ScheduleSummaryLCFS { - constructor (period) { - period = Number(period) - return [ - [{ // line 25 - className: 'text', - readOnly: true, - value: 'Net compliance unit balance for compliance period' - }, { - className: 'line', - readOnly: true, - value: ( -
- {'Line 25 '} - - - -
- ) - }, { - ...numericInput, - attributes: { - addCommas: true, - additionalTooltip: '', - dataNumberToFixed: 0, - maxLength: '20', - placement: 'right', - step: '1' - }, - className: 'tooltip-large number', - readOnly: true - }], // line 25 - [{ // line 29a - className: 'text', - readOnly: true, - value: `Available compliance unit balance on March 31, ${period + 1}` - }, { - className: 'line', - readOnly: true - }, { - ...numericInput, - attributes: { - addCommas: true, - additionalTooltip: '', - dataNumberToFixed: 0, - maxLength: '20', - placement: 'right', - step: '1' - }, - className: 'tooltip-large number', - readOnly: true - }], // line 29a - [{ // line 29b - className: 'text', - readOnly: true, - value: 'Compliance unit balance change from assessment' - }, { - className: 'line', - readOnly: true - }, { - ...numericInput, - attributes: { - addCommas: true, - dataNumberToFixed: 0, - maxLength: '20', - placement: 'right', - step: '1' - }, - className: 'tooltip-large number', - readOnly: true - }], // line 29b - [{ // line 28 - className: 'text total', - readOnly: true, - value: 'Non-compliance penalty payable (CAD)' - }, { - className: 'line total', - readOnly: true, - value: ( -
- {'Line 28 '} - - - -
- ) - }, { - ...numericCurrency, - ttributes: { - addCommas: true, - dataNumberToFixed: 0, - maxLength: '20', - placement: 'right', - step: '1' - }, - className: 'total numeric' - }], // line 28 - [{ // line 29c - className: 'text', - readOnly: true, - value: `Available compliance unit balance after assessment on March 31, ${period + 1}` - }, { - className: 'line', - readOnly: true - }, { - ...numericInput, - attributes: { - addCommas: true, - dataNumberToFixed: 0, - maxLength: '20', - placement: 'right', - step: '1' - }, - className: 'tooltip-large number', - readOnly: true - }] // line 29c - ] - } -} - -export default ScheduleSummaryLCFS diff --git a/frontend/src/schedule_summary/ScheduleSummaryPart3.js b/frontend/src/schedule_summary/ScheduleSummaryPart3.js index 567d5a46b..9c01dd00c 100644 --- a/frontend/src/schedule_summary/ScheduleSummaryPart3.js +++ b/frontend/src/schedule_summary/ScheduleSummaryPart3.js @@ -410,7 +410,7 @@ class ScheduleSummaryPart3 { } part3[0][3].className = 'hidden' for (let i = SCHEDULE_SUMMARY.LINE_23; i < SCHEDULE_SUMMARY.LINE_28 + 1; i++) { - if (i != 3) { + if (i != SCHEDULE_SUMMARY.LINE_25) { // Hide lines from 23 to 28 excluding line 25 part3[i][0].className = 'hidden' part3[i][1].className = 'hidden'