Total Water Savings since Baseline Year (kGal)
diff --git a/src/app/account/account-reports/excel-writer-services/better-plants-excel-writer.service.ts b/src/app/account/account-reports/excel-writer-services/better-plants-excel-writer.service.ts
index 5ddb31732..104142320 100644
--- a/src/app/account/account-reports/excel-writer-services/better-plants-excel-writer.service.ts
+++ b/src/app/account/account-reports/excel-writer-services/better-plants-excel-writer.service.ts
@@ -198,8 +198,12 @@ export class BetterPlantsExcelWriterService {
worksheet.getCell('E34').value = betterPlantsSummary.percentTotalEnergyImprovement / 100;
//baseline adjustment notes
- if (report.betterPlantsReportSetup.baselineAdjustmentNotes) {
+ if (report.betterPlantsReportSetup.baselineAdjustmentNotes && !betterPlantsSummary.totalEnergySavingsBanked) {
worksheet.getCell('C39').value = report.betterPlantsReportSetup.baselineAdjustmentNotes;
+ } else if (!report.betterPlantsReportSetup.baselineAdjustmentNotes && betterPlantsSummary.totalEnergySavingsBanked) {
+ worksheet.getCell('C39').value = betterPlantsSummary.totalEnergySavingsBanked + ' MMBtu of banked savings included.';
+ } else if (report.betterPlantsReportSetup.baselineAdjustmentNotes && betterPlantsSummary.totalEnergySavingsBanked) {
+ worksheet.getCell('C39').value = report.betterPlantsReportSetup.baselineAdjustmentNotes + '; ' + betterPlantsSummary.totalEnergySavingsBanked + ' MMBtu of banked savings included.';
}
//modification notes
if (report.betterPlantsReportSetup.modificationNotes) {
@@ -368,9 +372,14 @@ export class BetterPlantsExcelWriterService {
worksheet.getCell('E51').value = betterPlantsSummary.percentTotalWaterImprovement
//baseline adjustment notes
- if (report.betterPlantsReportSetup.baselineAdjustmentNotes) {
+ if (report.betterPlantsReportSetup.baselineAdjustmentNotes && !betterPlantsSummary.totalWaterSavingsBanked) {
worksheet.getCell('D55').value = report.betterPlantsReportSetup.baselineAdjustmentNotes;
+ } else if (!report.betterPlantsReportSetup.baselineAdjustmentNotes && betterPlantsSummary.totalWaterSavingsBanked) {
+ worksheet.getCell('D55').value = betterPlantsSummary.totalWaterSavingsBanked + ' kGal of banked savings included.';
+ } else if (report.betterPlantsReportSetup.baselineAdjustmentNotes && betterPlantsSummary.totalWaterSavingsBanked) {
+ worksheet.getCell('D55').value = report.betterPlantsReportSetup.baselineAdjustmentNotes + '; ' + betterPlantsSummary.totalWaterSavingsBanked + ' kGal of banked savings included.';
}
+
//modification notes
if (report.betterPlantsReportSetup.modificationNotes) {
worksheet.getCell('D61').value = report.betterPlantsReportSetup.modificationNotes;
diff --git a/src/app/calculations/analysis-calculations/annualAccountAnalysisSummaryClass.ts b/src/app/calculations/analysis-calculations/annualAccountAnalysisSummaryClass.ts
index b8e926181..5286e26d2 100644
--- a/src/app/calculations/analysis-calculations/annualAccountAnalysisSummaryClass.ts
+++ b/src/app/calculations/analysis-calculations/annualAccountAnalysisSummaryClass.ts
@@ -80,7 +80,9 @@ export class AnnualAccountAnalysisSummaryClass {
newSavings: checkAnalysisValue(summaryDataClass.newSavings),
predictorUsage: summaryDataClass.predictorUsage,
isBanked: false,
- isIntermediateBanked: false
+ isIntermediateBanked: false,
+ savingsBanked: checkAnalysisValue(summaryDataClass.savingsBanked),
+ savingsUnbanked: checkAnalysisValue(summaryDataClass.savingsUnbanked)
}
})
}
diff --git a/src/app/calculations/analysis-calculations/annualAnalysisSummaryDataClass.ts b/src/app/calculations/analysis-calculations/annualAnalysisSummaryDataClass.ts
index 6f3a73803..6b14554ce 100644
--- a/src/app/calculations/analysis-calculations/annualAnalysisSummaryDataClass.ts
+++ b/src/app/calculations/analysis-calculations/annualAnalysisSummaryDataClass.ts
@@ -16,6 +16,8 @@ export class AnnualAnalysisSummaryDataClass {
baselineAdjustment: number;
SEnPI: number;
savings: number;
+ savingsBanked: number;
+ savingsUnbanked: number;
totalSavingsPercentImprovement: number;
annualSavingsPercentImprovement: number;
cummulativeSavings: number;
@@ -141,6 +143,12 @@ export class AnnualAnalysisSummaryDataClass {
this.savings = _.sumBy(this.yearAnalysisSummaryData, (data: MonthlyAnalysisSummaryData) => {
return data.savings;
});
+ this.savingsUnbanked = _.sumBy(this.yearAnalysisSummaryData, (data: MonthlyAnalysisSummaryData) => {
+ return data.savingsUnbanked;
+ });
+ this.savingsBanked = _.sumBy(this.yearAnalysisSummaryData, (data: MonthlyAnalysisSummaryData) => {
+ return data.savingsBanked;
+ });
}
setTotalSavingsPercentImprovement() {
@@ -160,7 +168,7 @@ export class AnnualAnalysisSummaryDataClass {
setAnnualSavingsPercentImprovement() {
this.annualSavingsPercentImprovement = this.totalSavingsPercentImprovement - this.previousYearPercentSavings;
- if(this.isIntermediateBanked){
+ if (this.isIntermediateBanked) {
this.annualSavingsPercentImprovement = 0;
}
}
@@ -168,8 +176,8 @@ export class AnnualAnalysisSummaryDataClass {
setCummulativeSavings(previousYearsSummaryData: Array) {
if (previousYearsSummaryData.length != 0 && !this.isIntermediateBanked) {
let previousYearData: Array = previousYearsSummaryData.filter(data => { return data.year < this.year })
- let sumSavings: number = _.sumBy(previousYearData, (data: AnnualAnalysisSummaryDataClass) => {return data.cummulativeSavings});
- this.cummulativeSavings = sumSavings + this.savings;
+ let sumSavings: number = _.sumBy(previousYearData, (data: AnnualAnalysisSummaryDataClass) => { return data.cummulativeSavings });
+ this.cummulativeSavings = sumSavings + this.savings;
} else {
this.cummulativeSavings = 0;
}
@@ -177,7 +185,7 @@ export class AnnualAnalysisSummaryDataClass {
setNewSavings() {
this.newSavings = this.savings - this.previousYearSavings;
- if(this.isIntermediateBanked){
+ if (this.isIntermediateBanked) {
this.newSavings = 0;
}
}
@@ -221,7 +229,9 @@ export class AnnualAnalysisSummaryDataClass {
newSavings: checkAnalysisValue(this.newSavings),
predictorUsage: this.predictorUsage,
isBanked: this.isBanked,
- isIntermediateBanked: this.isIntermediateBanked
+ isIntermediateBanked: this.isIntermediateBanked,
+ savingsBanked: checkAnalysisValue(this.savingsBanked),
+ savingsUnbanked: checkAnalysisValue(this.savingsUnbanked)
}
}
diff --git a/src/app/calculations/analysis-calculations/annualFacilityAnalysisSummaryClass.ts b/src/app/calculations/analysis-calculations/annualFacilityAnalysisSummaryClass.ts
index 1bde088c8..765231ae4 100644
--- a/src/app/calculations/analysis-calculations/annualFacilityAnalysisSummaryClass.ts
+++ b/src/app/calculations/analysis-calculations/annualFacilityAnalysisSummaryClass.ts
@@ -93,7 +93,9 @@ export class AnnualFacilityAnalysisSummaryClass {
newSavings: checkAnalysisValue(summaryDataClass.newSavings),
predictorUsage: summaryDataClass.predictorUsage,
isBanked: false,
- isIntermediateBanked: false
+ isIntermediateBanked: false,
+ savingsBanked: checkAnalysisValue(summaryDataClass.savingsBanked),
+ savingsUnbanked: checkAnalysisValue(summaryDataClass.savingsUnbanked)
}
})
}
diff --git a/src/app/calculations/analysis-calculations/annualGroupAnalysisSummaryClass.ts b/src/app/calculations/analysis-calculations/annualGroupAnalysisSummaryClass.ts
index db497f6f8..15edc08f5 100644
--- a/src/app/calculations/analysis-calculations/annualGroupAnalysisSummaryClass.ts
+++ b/src/app/calculations/analysis-calculations/annualGroupAnalysisSummaryClass.ts
@@ -131,7 +131,9 @@ export class AnnualGroupAnalysisSummaryClass {
newSavings: checkAnalysisValue(summaryDataClass.newSavings),
predictorUsage: summaryDataClass.predictorUsage,
isBanked: summaryDataClass.isBanked,
- isIntermediateBanked: summaryDataClass.isIntermediateBanked
+ isIntermediateBanked: summaryDataClass.isIntermediateBanked,
+ savingsUnbanked: checkAnalysisValue(summaryDataClass.savingsUnbanked),
+ savingsBanked: checkAnalysisValue(summaryDataClass.savingsBanked)
}
}
diff --git a/src/app/calculations/analysis-calculations/groupMonthlyAnalysisCalculatedValuesClass.ts b/src/app/calculations/analysis-calculations/groupMonthlyAnalysisCalculatedValuesClass.ts
index 3acb1f507..fc8061143 100644
--- a/src/app/calculations/analysis-calculations/groupMonthlyAnalysisCalculatedValuesClass.ts
+++ b/src/app/calculations/analysis-calculations/groupMonthlyAnalysisCalculatedValuesClass.ts
@@ -14,6 +14,7 @@ export class GroupMonthlyAnalysisCalculatedValues {
savings: number;
savingsUnbanked: number;
+ savingsBanked: number
percentSavingsComparedToBaseline: number;
@@ -46,7 +47,8 @@ export class GroupMonthlyAnalysisCalculatedValues {
baselineActualEnergyUse: number,
modelYearDataAdjusted: number,
dataAdjustment: number,
- lastBankedMonthSummaryData: MonthlyAnalysisSummaryDataClass
+ lastBankedMonthSummaryData: MonthlyAnalysisSummaryDataClass,
+ originalBaselineYearBaselineActualEnergyUse: number
) {
this.energyUse = energyUse;
this.modeledEnergy = modeledEnergy;
@@ -60,7 +62,7 @@ export class GroupMonthlyAnalysisCalculatedValues {
this.setAdjustedStarStar(dataAdjustment);
this.setAdjusted();
this.setBaselineAdjustmentForNormalization(baselineActualEnergyUse, modelYearDataAdjusted, dataAdjustment);
- this.setBaselineAdjustmentForOtherV2(baselineAdjustementInput, modelYearDataAdjusted, dataAdjustment, baselineActualEnergyUse);
+ this.setBaselineAdjustmentForOtherV2(baselineAdjustementInput, modelYearDataAdjusted, dataAdjustment, baselineActualEnergyUse, originalBaselineYearBaselineActualEnergyUse);
this.setBaselineAdjustment();
this.setSEnPI();
this.setSavings(baselineActualEnergyUse, baselineAdjustementInput, modelYearDataAdjusted, dataAdjustment, lastBankedMonthSummaryData);
@@ -145,7 +147,7 @@ export class GroupMonthlyAnalysisCalculatedValues {
this.yearToDateAdjustedEnergyUse = this.yearToDateAdjustedEnergyUse + this.adjusted;
}
- setBaselineAdjustmentForOtherV2(baselineAdjustementInput: number, modelYearDataAdjusted: number, dataAdjustment: number, baselineActualEnergyUse: number) {
+ setBaselineAdjustmentForOtherV2(baselineAdjustementInput: number, modelYearDataAdjusted: number, dataAdjustment: number, baselineActualEnergyUse: number, originalBaselineYearBaselineActualEnergyUse: number) {
if ((this.energyUse - dataAdjustment) == 0 && this.energyUse != 0) {
this.baselineAdjustmentForOtherV2 = baselineAdjustementInput;
} else {
@@ -164,6 +166,11 @@ export class GroupMonthlyAnalysisCalculatedValues {
this.baselineAdjustmentForOtherV2 = baselineAdjustementInput * ((this.modeledEnergy - modelYearDataAdjusted) / (this.baselineModeledEnergyUse - modelYearDataAdjusted)) * adjustedStarStarRatio;
}
}
+
+ //add (new baseline actual - original baseline actual)
+ if (isNaN(originalBaselineYearBaselineActualEnergyUse) == false && originalBaselineYearBaselineActualEnergyUse != baselineActualEnergyUse) {
+ this.baselineAdjustmentForOtherV2 = (this.baselineAdjustmentForOtherV2 + (baselineActualEnergyUse - originalBaselineYearBaselineActualEnergyUse));
+ }
}
setSEnPI() {
@@ -183,6 +190,7 @@ export class GroupMonthlyAnalysisCalculatedValues {
//TODO: handle banking here..
this.savings = this.savingsUnbanked;
}
+ this.savingsBanked = (this.savings - this.savingsUnbanked);
}
setPercentSavingsComparedToBaseline() {
@@ -256,6 +264,7 @@ export class GroupMonthlyAnalysisCalculatedValues {
this.adjusted = new ConvertValue(this.adjusted, startingUnit, endingUnit).convertedValue;
this.baselineAdjustment = new ConvertValue(this.baselineAdjustment, startingUnit, endingUnit).convertedValue;
this.savings = new ConvertValue(this.savings, startingUnit, endingUnit).convertedValue;
+ this.savingsBanked = new ConvertValue(this.savingsBanked, startingUnit, endingUnit).convertedValue;
this.yearToDateSavings = new ConvertValue(this.yearToDateSavings, startingUnit, endingUnit).convertedValue;
this.rollingSavings = new ConvertValue(this.rollingSavings, startingUnit, endingUnit).convertedValue;
}
diff --git a/src/app/calculations/analysis-calculations/monthlyAccountAnalysisClass.ts b/src/app/calculations/analysis-calculations/monthlyAccountAnalysisClass.ts
index d232033a3..b34f3139b 100644
--- a/src/app/calculations/analysis-calculations/monthlyAccountAnalysisClass.ts
+++ b/src/app/calculations/analysis-calculations/monthlyAccountAnalysisClass.ts
@@ -155,7 +155,9 @@ export class MonthlyAccountAnalysisClass {
// adjustedStarStar: summaryDataItem.monthlyAnalysisCalculatedValues.adjustedStarStar,
baselineAdjustmentInput: summaryDataItem.baselineAdjustmentInput,
isBanked: false,
- isIntermediateBanked: false
+ isIntermediateBanked: false,
+ savingsBanked: checkAnalysisValue(summaryDataItem.monthlyAnalysisCalculatedValues.savingsBanked),
+ savingsUnbanked: checkAnalysisValue(summaryDataItem.monthlyAnalysisCalculatedValues.savingsUnbanked)
}
})
diff --git a/src/app/calculations/analysis-calculations/monthlyAnalysisCalculatedValuesClassSummation.ts b/src/app/calculations/analysis-calculations/monthlyAnalysisCalculatedValuesClassSummation.ts
index 5518d9bf4..bdd193a2d 100644
--- a/src/app/calculations/analysis-calculations/monthlyAnalysisCalculatedValuesClassSummation.ts
+++ b/src/app/calculations/analysis-calculations/monthlyAnalysisCalculatedValuesClassSummation.ts
@@ -11,6 +11,8 @@ export class MonthlyAnalysisCalculatedValuesSummation {
fiscalYear: number;
SEnPI: number;
savings: number;
+ savingsBanked: number;
+ savingsUnbanked: number;
percentSavingsComparedToBaseline: number;
yearToDateSavings: number;
yearToDatePercentSavings: number;
@@ -115,6 +117,14 @@ export class MonthlyAnalysisCalculatedValuesSummation {
this.savings = _.sumBy(currentMonthData, (data: MonthlyAnalysisSummaryDataClass) => {
return data.monthlyAnalysisCalculatedValues.savings;
});
+
+ this.savingsUnbanked = _.sumBy(currentMonthData, (data: MonthlyAnalysisSummaryDataClass) => {
+ return data.monthlyAnalysisCalculatedValues.savingsUnbanked;
+ });
+
+ this.savingsBanked = _.sumBy(currentMonthData, (data: MonthlyAnalysisSummaryDataClass) => {
+ return data.monthlyAnalysisCalculatedValues.savingsBanked;
+ });
}
setPercentSavingsComparedToBaseline() {
@@ -145,9 +155,10 @@ export class MonthlyAnalysisCalculatedValuesSummation {
setRollingSavingsValues(previousMonthsValues: Array) {
if (this.summaryDataIndex > 11) {
let last11MonthsData: Array = previousMonthsValues.splice(this.summaryDataIndex - 11, this.summaryDataIndex);
- let total12MonthsEnergyUse: number = _.sumBy(last11MonthsData, (data: MonthlyAnalysisCalculatedValuesSummation) => { return data.energyUse }) + this.energyUse;
+ // let total12MonthsEnergyUse: number = _.sumBy(last11MonthsData, (data: MonthlyAnalysisCalculatedValuesSummation) => { return data.energyUse }) + this.energyUse;
let total12MonthsAdjusedBaseline: number = _.sumBy(last11MonthsData, (data: MonthlyAnalysisCalculatedValuesSummation) => { return data.adjusted }) + this.adjusted;
- this.rollingSavings = total12MonthsAdjusedBaseline - total12MonthsEnergyUse;
+ this.rollingSavings = _.sumBy(last11MonthsData, (data: MonthlyAnalysisCalculatedValuesSummation) => { return data.savings }) + this.savings;
+ // this.rollingSavings = total12MonthsAdjusedBaseline - total12MonthsEnergyUse;
this.rolling12MonthImprovement = this.rollingSavings / total12MonthsAdjusedBaseline;
} else {
this.rolling12MonthImprovement = 0;
diff --git a/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryClass.ts b/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryClass.ts
index 2b972c857..222399442 100644
--- a/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryClass.ts
+++ b/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryClass.ts
@@ -1,6 +1,6 @@
import { AnalysisGroup, MonthlyAnalysisSummary, MonthlyAnalysisSummaryData } from "src/app/models/analysis";
import { CalanderizedMeter } from "src/app/models/calanderization";
-import { checkAnalysisValue } from "../shared-calculations/calculationsHelpers";
+import { checkAnalysisValue, getMonthlyStartAndEndDate } from "../shared-calculations/calculationsHelpers";
import { MonthlyAnalysisSummaryDataClass } from "./monthlyAnalysisSummaryDataClass";
import { MonthlyGroupAnalysisClass } from "./monthlyGroupAnalysisClass";
import { IdbFacility } from "src/app/models/idbModels/facility";
@@ -8,7 +8,6 @@ import { IdbPredictorData } from "src/app/models/idbModels/predictorData";
import { IdbAnalysisItem } from "src/app/models/idbModels/analysisItem";
import { checkSameMonth } from "src/app/upload-data/upload-helper-functions";
import * as _ from 'lodash';
-import { getFiscalYear } from "../shared-calculations/calanderizationFunctions";
export class MonthlyAnalysisSummaryClass {
@@ -31,23 +30,40 @@ export class MonthlyAnalysisSummaryClass {
});
let bankedAnalysisCpy: IdbAnalysisItem = JSON.parse(JSON.stringify(bankedAnalysisItem));
bankedAnalysisCpy.reportYear = this.group.bankedAnalysisYear;
- this.bankedMonthlyAnalysisSummaryClass = new MonthlyAnalysisSummaryClass(bankedGroup, bankedAnalysisCpy, this.facility, calanderizedMeters, accountPredictorEntries, calculateAllMonthlyData, accountAnalysisItems);
+ this.bankedMonthlyAnalysisSummaryClass = new MonthlyAnalysisSummaryClass(bankedGroup, bankedAnalysisCpy, this.facility, calanderizedMeters, accountPredictorEntries, false, accountAnalysisItems);
this.setBankedMonthlyAnalysisSummaryData(this.bankedMonthlyAnalysisSummaryClass, selectedGroup.bankedAnalysisYear);
}
this.monthlyGroupAnalysisClass = new MonthlyGroupAnalysisClass(selectedGroup, analysisItem, this.facility, calanderizedMeters, accountPredictorEntries, calculateAllMonthlyData);
- this.setMonthlyAnalysisSummaryData();
+ this.setMonthlyAnalysisSummaryData(analysisItem);
}
- setMonthlyAnalysisSummaryData() {
+ setMonthlyAnalysisSummaryData(analysisItem: IdbAnalysisItem) {
+ let baselineActualSummaryData: Array;
+
this.monthlyAnalysisSummaryData = new Array();
let startDate: Date;
if (this.monthlyGroupAnalysisClass.bankedAnalysisDate) {
startDate = new Date(this.monthlyGroupAnalysisClass.bankedAnalysisDate);
+ //needed for baseline energy use or original baseline year
+ let tempAnalysisItem: IdbAnalysisItem = { ...analysisItem };
+ tempAnalysisItem.hasBanking = false;
+ let monthlyStartAndEndDate: { baselineDate: Date, endDate: Date, bankedAnalysisDate: Date } = getMonthlyStartAndEndDate(this.facility, tempAnalysisItem, this.group);
+ let baselineDate: Date = new Date(monthlyStartAndEndDate.baselineDate);
+ let baselineYearEndDate: Date = new Date(baselineDate);
+ baselineYearEndDate.setFullYear(baselineYearEndDate.getFullYear() + 1);
+ baselineActualSummaryData = new Array();
+ while (baselineDate < baselineYearEndDate) {
+ let monthlyAnalysisSummaryDataClass: MonthlyAnalysisSummaryDataClass = new MonthlyAnalysisSummaryDataClass(this.monthlyGroupAnalysisClass, baselineDate, baselineActualSummaryData, this.facility, this.lastBankedMonthSummaryData, undefined)
+ baselineActualSummaryData.push(monthlyAnalysisSummaryDataClass);
+ let currentMonth: number = baselineDate.getUTCMonth()
+ let nextMonth: number = currentMonth + 1;
+ baselineDate = new Date(baselineDate.getUTCFullYear(), nextMonth, 1);
+ }
} else {
startDate = new Date(this.monthlyGroupAnalysisClass.baselineDate);
}
while (startDate < this.monthlyGroupAnalysisClass.endDate) {
- let monthlyAnalysisSummaryDataClass: MonthlyAnalysisSummaryDataClass = new MonthlyAnalysisSummaryDataClass(this.monthlyGroupAnalysisClass, startDate, this.monthlyAnalysisSummaryData, this.facility, this.lastBankedMonthSummaryData)
+ let monthlyAnalysisSummaryDataClass: MonthlyAnalysisSummaryDataClass = new MonthlyAnalysisSummaryDataClass(this.monthlyGroupAnalysisClass, startDate, this.monthlyAnalysisSummaryData, this.facility, this.lastBankedMonthSummaryData, baselineActualSummaryData)
this.monthlyAnalysisSummaryData.push(monthlyAnalysisSummaryDataClass);
let currentMonth: number = startDate.getUTCMonth()
let nextMonth: number = currentMonth + 1;
@@ -129,7 +145,9 @@ export class MonthlyAnalysisSummaryClass {
adjustedStarStar: summaryDataItem.monthlyAnalysisCalculatedValues.adjustedStarStar,
baselineAdjustmentInput: summaryDataItem.baselineAdjustmentInput,
isBanked: summaryDataItem.isBankedAnalysis,
- isIntermediateBanked: summaryDataItem.isBankedAnalysis
+ isIntermediateBanked: summaryDataItem.isBankedAnalysis,
+ savingsBanked: summaryDataItem.monthlyAnalysisCalculatedValues.savingsBanked,
+ savingsUnbanked: summaryDataItem.monthlyAnalysisCalculatedValues.savingsUnbanked
}
})
}
diff --git a/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryDataClass.ts b/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryDataClass.ts
index 724792af5..45698ae07 100644
--- a/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryDataClass.ts
+++ b/src/app/calculations/analysis-calculations/monthlyAnalysisSummaryDataClass.ts
@@ -37,12 +37,14 @@ export class MonthlyAnalysisSummaryDataClass {
isBankedAnalysis: boolean;
baselineYear: number;
bankedAnalysisYear: number;
+ originalBaselineYearBaselineActualEnergyUse: number;
constructor(
monthlyGroupAnalysisClass: MonthlyGroupAnalysisClass,
monthDate: Date,
previousMonthsSummaryData: Array,
facility: IdbFacility,
- lastBankedMonthlyAnalysis: MonthlyAnalysisSummaryDataClass
+ lastBankedMonthlyAnalysis: MonthlyAnalysisSummaryDataClass,
+ baselineActualSummaryData: Array
) {
this.date = monthDate;
this.group = monthlyGroupAnalysisClass.selectedGroup;
@@ -57,7 +59,7 @@ export class MonthlyAnalysisSummaryDataClass {
this.setMonthIndex(previousMonthsSummaryData);
this.setEnergyUse(monthlyGroupAnalysisClass.analysisItem.analysisCategory);
this.setPredictorAndProductionUsage(monthlyGroupAnalysisClass.selectedGroup.predictorVariables);
- this.setBaselineActualEnergyUse(previousMonthsSummaryData);
+ this.setBaselineActualEnergyUse(previousMonthsSummaryData, baselineActualSummaryData);
this.setModeledEnergy(monthlyGroupAnalysisClass.selectedGroup.analysisType, monthlyGroupAnalysisClass.predictorVariables, monthlyGroupAnalysisClass.baselineYearEnergyIntensity);
this.setAnnualEnergyUse(monthlyGroupAnalysisClass.annualMeterDataUsage);
this.setBaselineAdjustmentInput();
@@ -104,7 +106,10 @@ export class MonthlyAnalysisSummaryDataClass {
}
}
- setBaselineActualEnergyUse(previousMonthsSummaryData: Array) {
+ setBaselineActualEnergyUse(previousMonthsSummaryData: Array, baselineActualSummaryData: Array) {
+ if (baselineActualSummaryData) {
+ this.originalBaselineYearBaselineActualEnergyUse = baselineActualSummaryData[this.monthIndex].energyUse;
+ }
if (this.isBaselineYear || this.isBankedAnalysis) {
this.baselineActualEnergyUse = this.energyUse;
} else {
@@ -244,7 +249,8 @@ export class MonthlyAnalysisSummaryDataClass {
this.baselineActualEnergyUse,
this.modelYearDataAdjustment,
this.dataAdjustment,
- lastBankedMonthlyAnalysis
+ lastBankedMonthlyAnalysis,
+ this.originalBaselineYearBaselineActualEnergyUse
);
}
diff --git a/src/app/calculations/analysis-calculations/monthlyFacilityAnalysisClass.ts b/src/app/calculations/analysis-calculations/monthlyFacilityAnalysisClass.ts
index c61e44194..9dfb6306f 100644
--- a/src/app/calculations/analysis-calculations/monthlyFacilityAnalysisClass.ts
+++ b/src/app/calculations/analysis-calculations/monthlyFacilityAnalysisClass.ts
@@ -31,7 +31,7 @@ export class MonthlyFacilityAnalysisClass {
this.analysisItem = analysisItem;
if (analysisItem.hasBanking) {
let bankedAnalysisItem: IdbAnalysisItem = accountAnalysisItems.find(item => { return item.guid == analysisItem.bankedAnalysisItemId });
- this.bankedFacilityAnalysisClass = new MonthlyFacilityAnalysisClass(bankedAnalysisItem, facility, calanderizedMeters, accountPredictorEntries, calculateAllMonthlyData, accountPredictors, accountAnalysisItems);
+ this.bankedFacilityAnalysisClass = new MonthlyFacilityAnalysisClass(bankedAnalysisItem, facility, calanderizedMeters, accountPredictorEntries, false, accountPredictors, accountAnalysisItems);
}
let calanderizedFacilityMeters: Array = calanderizedMeters.filter(cMeter => { return cMeter.meter.facilityId == facility.guid })
this.setFacilityPredictorEntries(accountPredictorEntries, facility);
@@ -140,7 +140,9 @@ export class MonthlyFacilityAnalysisClass {
modelYearDataAdjustment: summaryDataItem.modelYearDataAdjustment,
baselineAdjustmentInput: summaryDataItem.baselineAdjustmentInput,
isBanked: false,
- isIntermediateBanked: false
+ isIntermediateBanked: false,
+ savingsBanked: summaryDataItem.monthlyAnalysisCalculatedValues.savingsBanked,
+ savingsUnbanked: summaryDataItem.monthlyAnalysisCalculatedValues.savingsUnbanked
}
})
}
diff --git a/src/app/calculations/better-plants-calculations/betterPlantsReportClass.ts b/src/app/calculations/better-plants-calculations/betterPlantsReportClass.ts
index c3bea436d..02070393f 100644
--- a/src/app/calculations/better-plants-calculations/betterPlantsReportClass.ts
+++ b/src/app/calculations/better-plants-calculations/betterPlantsReportClass.ts
@@ -29,8 +29,12 @@ export class BetterPlantsReportClass {
baselineYearWaterSummaryClass: BetterPlantsWaterSummaryClass;
adjustedBaselinePrimaryEnergy: number;
totalEnergySavings: number;
+ totalUnbankedEnergySavings: number;
+ totalBankedEnergySavings: number;
percentTotalEnergyImprovement: number;
totalWaterSavings: number;
+ totalUnbankedWaterSavings: number;
+ totalBankedWaterSavings: number;
percentTotalWaterImprovement: number;
adjustedBaselinePrimaryWater: number;
reportYear: number;
@@ -53,7 +57,7 @@ export class BetterPlantsReportClass {
this.setReportAndBaselineYearSummaries(selectedAnalysisItem, account, facilities, accountPredictorEntries, accountAnalysisItems, baselineYear, reportYear, meters, meterData, accountPredictors);
let neededUnits: 'MMBtu' | 'kgal' = 'MMBtu';
- if(selectedAnalysisItem.analysisCategory == 'water'){
+ if (selectedAnalysisItem.analysisCategory == 'water') {
neededUnits = 'kgal';
}
@@ -138,7 +142,9 @@ export class BetterPlantsReportClass {
}
setTotalEnergySavings() {
- this.totalEnergySavings = this.adjustedBaselinePrimaryEnergy - this.reportYearEnergySummaryClass.totalEnergyUse;
+ this.totalBankedEnergySavings = this.reportYearAnalysisSummary.savingsBanked;
+ this.totalUnbankedEnergySavings = this.adjustedBaselinePrimaryEnergy - this.reportYearEnergySummaryClass.totalEnergyUse;
+ this.totalEnergySavings = this.totalUnbankedEnergySavings + this.totalBankedEnergySavings;
}
setPercentTotalEnergyImprovement() {
@@ -159,7 +165,9 @@ export class BetterPlantsReportClass {
}
setTotalWaterSavings() {
- this.totalWaterSavings = this.adjustedBaselinePrimaryWater - this.reportYearWaterSummaryClass.totalWaterIntake;
+ this.totalBankedWaterSavings = this.reportYearAnalysisSummary.savingsBanked;
+ this.totalUnbankedWaterSavings = this.adjustedBaselinePrimaryWater - this.reportYearWaterSummaryClass.totalWaterIntake;
+ this.totalWaterSavings = this.totalUnbankedWaterSavings + this.totalBankedWaterSavings;
}
setPercentTotalWaterImprovement() {
@@ -182,14 +190,18 @@ export class BetterPlantsReportClass {
baselineYearEnergyResults: this.baselineYearEnergySummaryClass.getBetterPlantsEnergySummary(),
reportYearEnergyResults: this.reportYearEnergySummaryClass.getBetterPlantsEnergySummary(),
baselineYearWaterResults: this.baselineYearWaterSummaryClass.getBetterPlantsWaterSummary(),
- reportYearWaterResults: this.reportYearWaterSummaryClass.getBetterPlantsWaterSummary()
+ reportYearWaterResults: this.reportYearWaterSummaryClass.getBetterPlantsWaterSummary(),
+ totalEnergySavingsBanked: this.totalBankedEnergySavings,
+ totalWaterSavingsBanked: this.totalBankedWaterSavings,
+ totalEnergySavingsUnbanked: this.totalUnbankedEnergySavings,
+ totalWaterSavingsUnbanked: this.totalUnbankedWaterSavings
}
}
convertAnnualAnalysisSummary(summary: AnnualAnalysisSummary, analysisItem: IdbAccountAnalysisItem): AnnualAnalysisSummary {
let startingUnit: string = analysisItem.energyUnit;
let neededUnits: 'MMBtu' | 'kgal' = 'MMBtu';
- if(analysisItem.analysisCategory == 'water'){
+ if (analysisItem.analysisCategory == 'water') {
neededUnits = 'kgal';
startingUnit = analysisItem.waterUnit;
}
diff --git a/src/app/calculations/shared-calculations/calanderizationFunctions.ts b/src/app/calculations/shared-calculations/calanderizationFunctions.ts
index d99a2a41c..532cd9c00 100644
--- a/src/app/calculations/shared-calculations/calanderizationFunctions.ts
+++ b/src/app/calculations/shared-calculations/calanderizationFunctions.ts
@@ -147,6 +147,7 @@ export function getYearlyUsageNumbers(calanderizedMeters: Array(analysisTableColumns);
diff --git a/src/app/facility/analysis/run-analysis/group-analysis/group-analysis-options/banked-group-results-table/banked-group-results-table.component.html b/src/app/facility/analysis/run-analysis/group-analysis/group-analysis-options/banked-group-results-table/banked-group-results-table.component.html
index 50912a382..f53ae7ff1 100644
--- a/src/app/facility/analysis/run-analysis/group-analysis/group-analysis-options/banked-group-results-table/banked-group-results-table.component.html
+++ b/src/app/facility/analysis/run-analysis/group-analysis/group-analysis-options/banked-group-results-table/banked-group-results-table.component.html
@@ -59,7 +59,7 @@
= summary.year">
-
+
{{summary.year | yearDisplay: facility.fiscalYear}}
@@ -155,7 +155,7 @@
Banked Analysis Year
-
Intermediate Analysis Year
+
Transition Year
Banked Model Year
diff --git a/src/app/facility/facility-home/facility-home.component.ts b/src/app/facility/facility-home/facility-home.component.ts
index 7e6c5ca47..17bb33e4c 100644
--- a/src/app/facility/facility-home/facility-home.component.ts
+++ b/src/app/facility/facility-home/facility-home.component.ts
@@ -136,6 +136,7 @@ export class FacilityHomeComponent implements OnInit {
let annualAnalysisSummaries: Array
= annualAnalysisSummaryClass.getAnnualAnalysisSummaries();
let monthlyAnalysisSummaryData: Array = annualAnalysisSummaryClass.monthlyAnalysisSummaryData;
this.setEnergyBehaviorSubjects(annualAnalysisSummaries, monthlyAnalysisSummaryData);
+ this.facilityHomeService.calculatingEnergy.next(false);
}
}
@@ -189,6 +190,7 @@ export class FacilityHomeComponent implements OnInit {
let annualAnalysisSummaries: Array = annualAnalysisSummaryClass.getAnnualAnalysisSummaries();
let monthlyAnalysisSummaryData: Array = annualAnalysisSummaryClass.monthlyAnalysisSummaryData;
this.setWaterBehaviorSubjects(annualAnalysisSummaries, monthlyAnalysisSummaryData);
+ this.facilityHomeService.calculatingWater.next(false);
}
}
diff --git a/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.html b/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.html
index 6ef9413ca..405b67250 100644
--- a/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.html
+++ b/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.html
@@ -313,6 +313,16 @@
(change)="save()" id="SEnPI">
SEnPI
+
+
+ Banked Savings
+
+
+
+ Unbanked Savings
+
@@ -320,7 +330,7 @@
-
+
diff --git a/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.ts b/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.ts
index 722f20c85..265b91c02 100644
--- a/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.ts
+++ b/src/app/facility/facility-reports/facility-report-setup/facility-analysis-report-setup/facility-analysis-report-setup.component.ts
@@ -102,9 +102,11 @@ export class FacilityAnalysisReportSetupComponent {
if (this.analysisTableColumns.incrementalImprovement == false) {
this.analysisTableColumns.SEnPI = false;
this.analysisTableColumns.savings = false;
- this.analysisTableColumns.percentSavingsComparedToBaseline = false;
- this.analysisTableColumns.yearToDateSavings = false;
- this.analysisTableColumns.yearToDatePercentSavings = false;
+ // this.analysisTableColumns.percentSavingsComparedToBaseline = false;
+ // this.analysisTableColumns.yearToDateSavings = false;
+ // this.analysisTableColumns.yearToDatePercentSavings = false;
+ this.analysisTableColumns.bankedSavings = false;
+ this.analysisTableColumns.savingsUnbanked = false;
this.analysisTableColumns.rollingSavings = false;
this.analysisTableColumns.rolling12MonthImprovement = false;
this.analysisTableColumns.totalSavingsPercentImprovement = false;
@@ -114,9 +116,11 @@ export class FacilityAnalysisReportSetupComponent {
} else {
this.analysisTableColumns.SEnPI = true;
this.analysisTableColumns.savings = true;
- this.analysisTableColumns.percentSavingsComparedToBaseline = true;
- this.analysisTableColumns.yearToDateSavings = true;
- this.analysisTableColumns.yearToDatePercentSavings = true;
+ // this.analysisTableColumns.percentSavingsComparedToBaseline = true;
+ // this.analysisTableColumns.yearToDateSavings = true;
+ // this.analysisTableColumns.yearToDatePercentSavings = true;
+ this.analysisTableColumns.bankedSavings = true;
+ this.analysisTableColumns.savingsUnbanked = true;
this.analysisTableColumns.rollingSavings = true;
this.analysisTableColumns.rolling12MonthImprovement = true;
this.analysisTableColumns.totalSavingsPercentImprovement = true;
@@ -141,17 +145,19 @@ export class FacilityAnalysisReportSetupComponent {
this.analysisTableColumns.incrementalImprovement = (
this.analysisTableColumns.SEnPI ||
this.analysisTableColumns.savings ||
- this.analysisTableColumns.percentSavingsComparedToBaseline ||
- this.analysisTableColumns.yearToDateSavings ||
- this.analysisTableColumns.yearToDatePercentSavings ||
+ // this.analysisTableColumns.percentSavingsComparedToBaseline ||
+ // this.analysisTableColumns.yearToDateSavings ||
+ // this.analysisTableColumns.yearToDatePercentSavings ||
this.analysisTableColumns.rollingSavings ||
- this.analysisTableColumns.rolling12MonthImprovement||
+ this.analysisTableColumns.rolling12MonthImprovement ||
this.analysisTableColumns.SEnPI ||
this.analysisTableColumns.savings ||
this.analysisTableColumns.totalSavingsPercentImprovement ||
this.analysisTableColumns.annualSavingsPercentImprovement ||
this.analysisTableColumns.cummulativeSavings ||
- this.analysisTableColumns.newSavings
+ this.analysisTableColumns.newSavings ||
+ this.analysisTableColumns.bankedSavings ||
+ this.analysisTableColumns.savingsUnbanked
)
}
@@ -197,6 +203,8 @@ export class FacilityAnalysisReportSetupComponent {
this.analysisTableColumns.annualSavingsPercentImprovement = true;
this.analysisTableColumns.cummulativeSavings = true;
this.analysisTableColumns.newSavings = true;
+ this.analysisTableColumns.bankedSavings = false;
+ this.analysisTableColumns.savingsUnbanked = false;
await this.save();
}
diff --git a/src/app/models/analysis.ts b/src/app/models/analysis.ts
index bd6befcc4..cd0bf6f9c 100644
--- a/src/app/models/analysis.ts
+++ b/src/app/models/analysis.ts
@@ -77,7 +77,9 @@ export interface MonthlyAnalysisSummaryData {
dataAdjustment: number,
baselineAdjustmentInput: number,
isBanked: boolean,
- isIntermediateBanked: boolean
+ isIntermediateBanked: boolean,
+ savingsBanked: number
+ savingsUnbanked: number
}
export interface AnnualAnalysisSummary {
@@ -91,6 +93,8 @@ export interface AnnualAnalysisSummary {
baselineAdjustment: number,
SEnPI: number,
savings: number,
+ savingsBanked: number,
+ savingsUnbanked: number,
totalSavingsPercentImprovement: number,
annualSavingsPercentImprovement: number,
cummulativeSavings: number,
@@ -132,7 +136,9 @@ export interface AnalysisTableColumns {
display: boolean,
usedInAnalysis: boolean
}>,
- predictorGroupId: string
+ predictorGroupId: string,
+ bankedSavings: boolean,
+ savingsUnbanked: boolean
}
diff --git a/src/app/models/idbModels/facilityReport.ts b/src/app/models/idbModels/facilityReport.ts
index f716be436..14f22acd7 100644
--- a/src/app/models/idbModels/facilityReport.ts
+++ b/src/app/models/idbModels/facilityReport.ts
@@ -50,7 +50,9 @@ export function getAnalysisReportSettings(): AnalysisReportSettings {
cummulativeSavings: true,
newSavings: true,
predictors: [],
- predictorGroupId: undefined
+ predictorGroupId: undefined,
+ bankedSavings: false,
+ savingsUnbanked: false
},
facilityAnnualResults: true,
facilityAnnualResultsTable: true,
diff --git a/src/app/models/overview-report.ts b/src/app/models/overview-report.ts
index 03ebc9396..eaf12ed0e 100644
--- a/src/app/models/overview-report.ts
+++ b/src/app/models/overview-report.ts
@@ -10,7 +10,11 @@ export interface BetterPlantsSummary {
adjustedBaselinePrimaryWater: number,
// baselineAdjustment: number,
totalEnergySavings: number,
+ totalEnergySavingsUnbanked: number,
+ totalEnergySavingsBanked: number,
totalWaterSavings: number,
+ totalWaterSavingsUnbanked: number;
+ totalWaterSavingsBanked: number,
baselineYearEnergyResults: BetterPlantsEnergySummary,
reportYearEnergyResults: BetterPlantsEnergySummary,
baselineYearWaterResults: BetterPlantsWaterSummary,
diff --git a/src/app/shared/helper-services/backup-data.service.ts b/src/app/shared/helper-services/backup-data.service.ts
index db84e5176..56daa7a60 100644
--- a/src/app/shared/helper-services/backup-data.service.ts
+++ b/src/app/shared/helper-services/backup-data.service.ts
@@ -150,6 +150,9 @@ export class BackupDataService {
}
async importAccountBackupFile(backupFile: BackupFile): Promise {
+
+ console.log(backupFile);
+
this.analyticsService.sendEvent('import_backup_file');
this.loadingService.setLoadingMessage('Adding Account...');
let accountGUIDs: { oldId: string, newId: string } = {
@@ -322,7 +325,7 @@ export class BackupDataService {
predictorData.guid = newGUID;
predictorData.accountId = accountGUIDs.newId;
predictorData.facilityId = this.getNewId(predictorData.facilityId, facilityGUIDs);
- predictorData.predictorId = this.getNewId(predictorData.predictorId, predictorV2GUIDs);
+ predictorData.predictorId = this.getNewId(predictorData.predictorId, predictorGUIDs);
await firstValueFrom(this.predictorDataDbService.addWithObservable(predictorData));
}
}
diff --git a/src/app/shared/shared-analysis/analysis-summary-table-filter/analysis-summary-table-filter.component.html b/src/app/shared/shared-analysis/analysis-summary-table-filter/analysis-summary-table-filter.component.html
index 4e4f6c6b6..87e5f9c16 100644
--- a/src/app/shared/shared-analysis/analysis-summary-table-filter/analysis-summary-table-filter.component.html
+++ b/src/app/shared/shared-analysis/analysis-summary-table-filter/analysis-summary-table-filter.component.html
@@ -81,13 +81,23 @@
[(ngModel)]="analysisTableColumns.SEnPI" (change)="save()" id="SEnPI">
SEnPI
+
+
+ Banked Savings
+
+
+
+ Unbanked Savings
+
Savings
-
YTD Savings
-
+
YTD % Savings
-
+
-->