@measurequick/measurequick-report-generator 1.5.20 → 1.5.22

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.20",
3
+ "version": "1.5.22",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -42,56 +42,71 @@ export async function getReport(payload, _test) {
42
42
  supply_pressure = 4,
43
43
  test = payload&&payload.test ? payload.test : {};
44
44
 
45
- if (test.ductScreeningSystemType === 'Package Draw Through' && test.ductScreeningFilterLocation === 'Grille'){
46
- filter_pressure_drop = 1,
47
- return_pressure_drop = 2,
48
- coil_pressure_drop = 3,
49
- supply_pressure = 4;
50
- } else if (test.ductScreeningSystemType === 'Package Draw Through' && test.ductScreeningFilterLocation === 'Slot'){
51
- filter_pressure_drop = 2,
52
- return_pressure_drop = 1,
53
- coil_pressure_drop = 3,
54
- supply_pressure = 4;
55
- } else if (test.ductScreeningSystemType === 'Package Blow Through' && test.ductScreeningFilterLocation === 'Grille') {
56
- filter_pressure_drop = 1,
57
- return_pressure_drop = 2,
58
- coil_pressure_drop = 3,
59
- supply_pressure = 4;
60
- } else if (test.ductScreeningSystemType === 'Package Blow Through' && test.ductScreeningFilterLocation === 'Slot') {
61
- filter_pressure_drop = 2,
62
- return_pressure_drop = 1,
63
- coil_pressure_drop = 3,
64
- supply_pressure = 4;
65
- } else if (test.ductScreeningSystemType === 'AHU Draw Through' && test.ductScreeningFilterLocation === 'Grille'){
66
- filter_pressure_drop = 1,
67
- return_pressure_drop = 2,
68
- coil_pressure_drop = 3,
69
- supply_pressure = 4;
70
- } else if (test.ductScreeningSystemType === 'AHU Draw Through' && test.ductScreeningFilterLocation === 'Slot'){
71
- filter_pressure_drop = 2,
72
- return_pressure_drop = 1,
73
- coil_pressure_drop = 3,
74
- supply_pressure = 4;
75
- } else if (test.ductScreeningSystemType === 'AHU Blow Through' && test.ductScreeningFilterLocation === 'Grille'){
76
- filter_pressure_drop = 1,
77
- return_pressure_drop = 2,
78
- coil_pressure_drop = 3,
79
- supply_pressure = 4;
80
- } else if (test.ductScreeningSystemType === 'AHU Blow Through' && test.ductScreeningFilterLocation === 'Slot'){
81
- filter_pressure_drop = 2,
82
- return_pressure_drop = 1,
83
- coil_pressure_drop = 3,
84
- supply_pressure = 4;
85
- } else if (test.ductScreeningSystemType === 'Furnace' && test.ductScreeningFilterLocation === 'Grille'){
86
- filter_pressure_drop = 1,
87
- return_pressure_drop = 2,
88
- coil_pressure_drop = 3,
89
- supply_pressure = 4;
90
- } else if (test.ductScreeningSystemType === 'Furnace' && test.ductScreeningFilterLocation === 'Slot'){
91
- filter_pressure_drop = 2,
92
- return_pressure_drop = 1,
93
- coil_pressure_drop = 3,
94
- supply_pressure = 4;
45
+ if (test.ductSystemType === 1){
46
+ if (test.ductScreeningFilterLocation === 'Grille'){
47
+ filter_pressure_drop = 1,
48
+ return_pressure_drop = 2,
49
+ coil_pressure_drop = 3,
50
+ supply_pressure = 4;
51
+ } else {
52
+ filter_pressure_drop = 2,
53
+ return_pressure_drop = 1,
54
+ coil_pressure_drop = 3,
55
+ supply_pressure = 4;
56
+ }
57
+ }
58
+ else {
59
+ if (test.ductScreeningSystemType === 'Package Draw Through' && test.ductScreeningFilterLocation === 'Grille'){
60
+ filter_pressure_drop = 1,
61
+ return_pressure_drop = 2,
62
+ coil_pressure_drop = 3,
63
+ supply_pressure = 4;
64
+ } else if (test.ductScreeningSystemType === 'Package Draw Through' && test.ductScreeningFilterLocation === 'Slot'){
65
+ filter_pressure_drop = 2,
66
+ return_pressure_drop = 1,
67
+ coil_pressure_drop = 3,
68
+ supply_pressure = 4;
69
+ } else if (test.ductScreeningSystemType === 'Package Blow Through' && test.ductScreeningFilterLocation === 'Grille') {
70
+ filter_pressure_drop = 1,
71
+ return_pressure_drop = 2,
72
+ coil_pressure_drop = 3,
73
+ supply_pressure = 4;
74
+ } else if (test.ductScreeningSystemType === 'Package Blow Through' && test.ductScreeningFilterLocation === 'Slot') {
75
+ filter_pressure_drop = 2,
76
+ return_pressure_drop = 1,
77
+ coil_pressure_drop = 3,
78
+ supply_pressure = 4;
79
+ } else if (test.ductScreeningSystemType === 'AHU Draw Through' && test.ductScreeningFilterLocation === 'Grille'){
80
+ filter_pressure_drop = 1,
81
+ return_pressure_drop = 2,
82
+ coil_pressure_drop = 3,
83
+ supply_pressure = 4;
84
+ } else if (test.ductScreeningSystemType === 'AHU Draw Through' && test.ductScreeningFilterLocation === 'Slot'){
85
+ filter_pressure_drop = 2,
86
+ return_pressure_drop = 1,
87
+ coil_pressure_drop = 3,
88
+ supply_pressure = 4;
89
+ } else if (test.ductScreeningSystemType === 'AHU Blow Through' && test.ductScreeningFilterLocation === 'Grille'){
90
+ filter_pressure_drop = 1,
91
+ return_pressure_drop = 2,
92
+ coil_pressure_drop = 3,
93
+ supply_pressure = 4;
94
+ } else if (test.ductScreeningSystemType === 'AHU Blow Through' && test.ductScreeningFilterLocation === 'Slot'){
95
+ filter_pressure_drop = 2,
96
+ return_pressure_drop = 1,
97
+ coil_pressure_drop = 3,
98
+ supply_pressure = 4;
99
+ } else if (test.ductScreeningSystemType === 'Furnace' && test.ductScreeningFilterLocation === 'Grille'){
100
+ filter_pressure_drop = 1,
101
+ return_pressure_drop = 2,
102
+ coil_pressure_drop = 3,
103
+ supply_pressure = 4;
104
+ } else if (test.ductScreeningSystemType === 'Furnace' && test.ductScreeningFilterLocation === 'Slot'){
105
+ filter_pressure_drop = 2,
106
+ return_pressure_drop = 1,
107
+ coil_pressure_drop = 3,
108
+ supply_pressure = 4;
109
+ }
95
110
  }
96
111
 
97
112
  // embed company logo and profile picture
@@ -365,22 +380,22 @@ export async function getReport(payload, _test) {
365
380
  //form.getButton('ImageAdditionalSupportingData9').setImage(icon);
366
381
 
367
382
  let recommendations = '';
368
- if (test.ductScreeningTESPResult!==0 && test.ductScreeningTESPResultText){
383
+ if (test.ductScreeningTESPResult&&test.ductScreeningTESPResult!==0 && test.ductScreeningTESPResultText){
369
384
  recommendations += ("• " + test.ductScreeningTESPResultText + '\n');
370
385
  }
371
- if (test.ductScreeningAirflowResult!==0 && test.ductScreeningAirflowResultText){
386
+ if (test.ductScreeningAirflowResult&&test.ductScreeningAirflowResult!==0 && test.ductScreeningAirflowResultText){
372
387
  recommendations += ("• " + test.ductScreeningAirflowResultText + '\n');
373
388
  }
374
- if (test.ductScreeningPressureDrop1Result!==0 && test.ductScreeningPressureDrop1ResultText){
389
+ if (test.ductScreeningPressureDrop1Result&&test.ductScreeningPressureDrop1Result!==0 && test.ductScreeningPressureDrop1ResultText){
375
390
  recommendations += ("• " + test.ductScreeningPressureDrop1ResultText + '\n');
376
391
  }
377
- if (test.ductScreeningPressureDrop2Result!==0 && test.ductScreeningPressureDrop2ResultText){
392
+ if (test.ductScreeningPressureDrop2Result&&test.ductScreeningPressureDrop2Result!==0 && test.ductScreeningPressureDrop2ResultText){
378
393
  recommendations += ("• " + test.ductScreeningPressureDrop2ResultText + '\n');
379
394
  }
380
- if (test.ductScreeningPressureDrop3Result!==0 && test.ductScreeningPressureDrop3ResultText){
395
+ if (test.ductScreeningPressureDrop3Result&&test.ductScreeningPressureDrop3Result!==0 && test.ductScreeningPressureDrop3ResultText){
381
396
  recommendations += ("• " + test.ductScreeningPressureDrop3ResultText + '\n');
382
397
  }
383
- if (test.ductScreeningPressureDrop4Result!==0 && test.ductScreeningPressureDrop4ResultText){
398
+ if (test.ductScreeningPressureDrop4Result&&test.ductScreeningPressureDrop4Result!==0 && test.ductScreeningPressureDrop4ResultText){
384
399
  recommendations += ("• " + test.ductScreeningPressureDrop4ResultText + '\n');
385
400
  }
386
401
  if (!recommendations) {