@measurequick/measurequick-report-generator 1.5.93 → 1.5.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.5.93",
3
+ "version": "1.5.94",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -185,16 +185,34 @@ export async function getReport(payload, _test) {
185
185
  //this.data.cep_ratio
186
186
  //this.data.csp_ratio
187
187
  let cep_ratio =
188
- payload.test && payload.test.cep_ratio
189
- ? (payload.test.cep_ratio * 100).toFixed(0).toString() + "%"
188
+ payload &&
189
+ payload.project &&
190
+ payload.project.tests &&
191
+ payload.projects.tests[payload.project.tests.length - 1] &&
192
+ payload.projects.tests[payload.project.tests.length - 1].cep_ratio
193
+ ? (
194
+ payload.projects.tests[payload.project.tests.length - 1].cep_ratio *
195
+ 100
196
+ )
197
+ .toFixed(0)
198
+ .toString() + "%"
190
199
  : "N/A";
191
200
  let cep_description =
192
201
  "Your equipment is designed by the manufacturer to deliver a specific amount of air into your home. The Equipment " +
193
202
  "Performance Score is the percentage of the measured capacity delivered into your home compared to the equipment rated capacity. " +
194
203
  "The ideal score is 100%, but a score of 90% or better is excellent compared to most installed equipment.";
195
204
  let csp_ratio =
196
- payload.test && payload.test.csp_ratio
197
- ? (payload.test.csp_ratio * 100).toFixed(0).toString() + "%"
205
+ payload &&
206
+ payload.project &&
207
+ payload.project.tests &&
208
+ payload.projects.tests[payload.project.tests.length - 1] &&
209
+ payload.projects.tests[payload.project.tests.length - 1].csp_ratio
210
+ ? (
211
+ payload.projects.tests[payload.project.tests.length - 1].csp_ratio *
212
+ 100
213
+ )
214
+ .toFixed(0)
215
+ .toString() + "%"
198
216
  : "N/A";
199
217
  let csp_description =
200
218
  "A system is made up of the equipment and a duct system that delivers air from the equipment into your home. The ideal " +
@@ -222,10 +240,6 @@ export async function getReport(payload, _test) {
222
240
  : {};
223
241
 
224
242
  //TESP
225
-
226
- //This is SESP
227
- form.getTextField("TESPExiting").setText("TESPExiting");
228
-
229
243
  let tesp_value = duct_test.ductScreeningTESP
230
244
  ? (+duct_test.ductScreeningTESP).toFixed(2).toString() + "inH2O"
231
245
  : "N/A";
@@ -240,7 +254,9 @@ export async function getReport(payload, _test) {
240
254
  ? (+duct_test.ductScreeningTESP / +duct_test.ductScreeningTESPTarget) *
241
255
  100
242
256
  : null;
243
- let tesp_pct_rated = tesp_pct ? tesp_pct.toFixed(0).toString() : "N/A";
257
+ let tesp_pct_rated = tesp_pct
258
+ ? tesp_pct.toFixed(0).toString() + "%"
259
+ : "N/A";
244
260
  form.getTextField("TESPPercentRated").setText(tesp_pct_rated);
245
261
 
246
262
  let gauge = gauge10;
@@ -551,7 +567,7 @@ export async function getReport(payload, _test) {
551
567
  form.getTextField("FanAirflowRequired").setText(airflow_required);
552
568
 
553
569
  let airflow_pct = Math.abs(
554
- (test.ductScreeningAirflow / test.ductScreeningAirflowTarget) * 100
570
+ (1 - test.ductScreeningAirflow / test.ductScreeningAirflowTarget) * 100
555
571
  );
556
572
 
557
573
  let airflow_pct_required = airflow_pct