Skip to content

Commit 7ea2ce3

Browse files
Merge pull request #4045 from bcgov/feat/hamed-calculator-label-compliance-units-4038
Feat: Update calculator label to compliance units - 4038
2 parents 5ee3503 + 6eb37d4 commit 7ea2ce3

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

frontend/src/assets/locales/en/reports.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@
308308
"Low carbon fuel requirement only"
309309
],
310310
"changeInUnits": "Projected change in compliance units balance",
311-
"generatedLabel": "Credits generated",
311+
"generatedLabel": "Compliance units generated",
312+
"selectedFuelType": "Selected fuel type",
313+
"quantitySupplied": "Quantity supplied",
312314
"allRecordsDeleted": "All previous records deleted.",
313315
"notSubjectToAssessment": "Not Subject to Assessment",
314316
"notSubjectToAssessmentDescription": "This report is not subject to assessment under the Low Carbon Fuels Act. No action will be taken on the contents of this report, and the summary result will not impact the organization's compliance unit balance. Please add any specific information to the supplier in the director statement above.",

frontend/src/views/ComplianceReports/CreditCalculator.jsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -451,27 +451,32 @@ export const CreditCalculator = () => {
451451

452452
const handleCopy = async () => {
453453
try {
454-
const copyText = `Compliance Year: ${complianceYear}
455-
Selected fuel type: ${fuelType || 'N/A'}
456-
End use: ${endUseType || 'N/A'}
457-
Determining carbon intensity: ${provisionDisplayLabel}
458-
Fuel code: ${fuelCode || 'N/A'}
454+
const ciEntries = Object.entries(ciParameterLabels)
455+
const ciLabels = ciEntries.map(([key, label]) => `${key.toUpperCase()} - ${label}`)
456+
const maxLabelLen = Math.max(...ciLabels.map((l) => l.length))
457+
const ciRows = ciEntries
458+
.map(([, ], i) => {
459+
const value = Object.values(resultData.formulaValues)[i]
460+
return `${ciLabels[i].padEnd(maxLabelLen + 2)}${value}`
461+
})
462+
.join('\n')
463+
464+
const copyText = `${t('report:complianceYear')}: ${complianceYear}
465+
${t('report:selectedFuelType')}: ${fuelType || 'N/A'}
466+
${t('report:endUse')}: ${endUseType || 'N/A'}
467+
${t('report:ciLabel')}: ${provisionDisplayLabel}
468+
${t('report:fuelCodeLabel')}: ${fuelCode || 'N/A'}
459469
460-
Quantity supplied: ${quantity?.toLocaleString() || 0} ${unit}
470+
${t('report:quantitySupplied')}: ${quantity?.toLocaleString() || 0} ${unit}
461471
462-
Compliance units = (TCI * EER - (RCI + UCI)) * EC / 1,000,000
472+
${t('report:formulaAfter2024')}
463473
${t('report:formulaECDefinition')}
464474
465-
TCI - Target carbon intensity ${resultData.formulaValues.carbonIntensity}
466-
EER - Energy effectiveness ratio ${resultData.formulaValues.eer}
467-
RCI - Recorded carbon intensity ${resultData.formulaValues.ci}
468-
UCI - Additional carbon intensity ${resultData.formulaValues.uci}
469-
EC - Energy content ${resultData.formulaValues.energyContent}
470-
ED - Energy density ${resultData.formulaValues.energyDensity}
475+
${ciRows}
471476
472477
${resultData.formulaDisplay}
473478
474-
Credits generated: ${resultData.credits.toLocaleString()}`
479+
${t('report:generatedLabel')}: ${resultData.credits.toLocaleString()}`
475480

476481
const success = await copyToClipboard(copyText)
477482
if (success) {

0 commit comments

Comments
 (0)