@measurequick/measurequick-report-generator 1.0.74 → 1.0.76
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.
|
@@ -17,10 +17,129 @@ export async function generateReport(payload) {
|
|
|
17
17
|
const form = pdfDoc.getForm();
|
|
18
18
|
|
|
19
19
|
// fill form
|
|
20
|
-
|
|
20
|
+
//page 1
|
|
21
|
+
form.getTextField('PTCS Tech').setText("");
|
|
22
|
+
form.getTextField('PTCS Tech Name').setText("");
|
|
23
|
+
form.getTextField('Install Date').setText("");
|
|
24
|
+
form.getTextField('Electric Utility').setText("");
|
|
25
|
+
form.getTextField('Installation Site Address').setText("");
|
|
26
|
+
form.getTextField('Site City').setText("");
|
|
27
|
+
form.getTextField('Site State').setText("");
|
|
28
|
+
form.getTextField('Site Zip').setText("");
|
|
29
|
+
|
|
30
|
+
// // check group
|
|
31
|
+
// Existing Site Built
|
|
32
|
+
// New Construction Site Built
|
|
33
|
+
// Manufactured of Sections
|
|
34
|
+
// // check group
|
|
35
|
+
// 1
|
|
36
|
+
// 2
|
|
37
|
+
// 3
|
|
38
|
+
//
|
|
39
|
+
// form.getTextField('Text1').setText("");
|
|
40
|
+
// // check group
|
|
41
|
+
// Crawlspace
|
|
42
|
+
// Full Basement
|
|
43
|
+
// Half Basement
|
|
44
|
+
// Slab
|
|
45
|
+
// // check group
|
|
46
|
+
// Electric Forced Air wout AC
|
|
47
|
+
// Electric Forced Air w AC
|
|
48
|
+
// Electric Zonal
|
|
49
|
+
// Air Source Heat Pump
|
|
50
|
+
// Ground Source Heat Pump
|
|
51
|
+
// Natural Gas Furnace Gas Company
|
|
52
|
+
// Text2
|
|
53
|
+
// Other NonElectric Space Heating
|
|
54
|
+
// Text3
|
|
55
|
+
// // check group
|
|
56
|
+
// None
|
|
57
|
+
// Electric Forced Air
|
|
58
|
+
// Electric Zonal_2
|
|
59
|
+
// Natural Gas Furnace
|
|
60
|
+
// NonElectric Space Heating
|
|
61
|
+
//
|
|
62
|
+
// form.getTextField('AHRI').setText("");
|
|
63
|
+
// form.getTextField('SEER').setText("");
|
|
64
|
+
// form.getTextField('HSPF').setText("");
|
|
65
|
+
// form.getTextField('Outdoor HP Capacity tons').setText("");
|
|
66
|
+
// form.getTextField('Heat Pump Make').setText("");
|
|
67
|
+
// form.getTextField('Outdoor HP Model').setText("");
|
|
68
|
+
// form.getTextField('Indoor HP Model').setText("");
|
|
69
|
+
// // check group
|
|
70
|
+
// Non Variable Speed HP Compressor
|
|
71
|
+
// Variable Speed HP Compressor
|
|
72
|
+
//
|
|
73
|
+
// form.getTextField('Balance Point').setText("");
|
|
74
|
+
// // radio group
|
|
75
|
+
// Did you perform all of your tests in Test OnlyCheck Charge mode
|
|
76
|
+
// Yes
|
|
77
|
+
// No
|
|
78
|
+
// NA
|
|
79
|
+
//
|
|
80
|
+
// form.getTextField('1 Return Static Pressure').setText("");
|
|
81
|
+
// // check group
|
|
82
|
+
// Pa
|
|
83
|
+
// Inches H2O
|
|
84
|
+
//
|
|
85
|
+
// form.getTextField('2 Supply Static Pressure').setText("");
|
|
86
|
+
// form.getTextField('3 External Static Pressure').setText("");
|
|
87
|
+
// form.getTextField('1 NSOP A').setText("");
|
|
88
|
+
// // radio group
|
|
89
|
+
// 2a Plate Size
|
|
90
|
+
// 14
|
|
91
|
+
// 20
|
|
92
|
+
// // check group
|
|
93
|
+
// Air Handler
|
|
94
|
+
// Return Grille
|
|
95
|
+
|
|
96
|
+
// form.getTextField('3 TFSOP B').setText("");
|
|
97
|
+
// form.getTextField('fill_22').setText("");
|
|
98
|
+
// form.getTextField('5 Plate Pressure').setText("");
|
|
99
|
+
// form.getTextField('6 Raw Flow CFM from tables D').setText("");
|
|
100
|
+
// form.getTextField('7 Corrected Flow CFM C x D').setText("");
|
|
101
|
+
// form.getTextField('8 CFMton').setText("");
|
|
102
|
+
//
|
|
103
|
+
// // page 2
|
|
104
|
+
// form.getTextField('Text4').setText("");
|
|
105
|
+
// // check group
|
|
106
|
+
// undefined
|
|
107
|
+
// undefined_2
|
|
108
|
+
//
|
|
109
|
+
// form.getTextField('Supply Air SA Temp').setText("");
|
|
110
|
+
// form.getTextField('Return Air RA Temp').setText("");
|
|
111
|
+
// form.getTextField('Temp Split SA RA').setText("");
|
|
112
|
+
// form.getTextField('Temp Split Target').setText("");
|
|
113
|
+
// form.getTextField('Discharge Pressure').setText("");
|
|
114
|
+
// form.getTextField('Discharge Temp A').setText("");
|
|
115
|
+
// form.getTextField('Liquid Line Temp B').setText("");
|
|
116
|
+
// form.getTextField('Sub cooling A B').setText("");
|
|
117
|
+
// form.getTextField('Specify method used').setText("");
|
|
118
|
+
// form.getTextField('Target').setText("");
|
|
119
|
+
// form.getTextField('Test result').setText("");
|
|
120
|
+
// // check group
|
|
121
|
+
// Y
|
|
122
|
+
// N
|
|
123
|
+
// // check group
|
|
124
|
+
// Yes_2
|
|
125
|
+
// Not InstalledDisabled
|
|
126
|
+
// NonElectric Backup
|
|
127
|
+
// No_2
|
|
128
|
+
// // check group
|
|
129
|
+
// 35
|
|
130
|
+
// Below 35
|
|
131
|
+
//
|
|
132
|
+
// form.getTextField('HP Thermostat Make').setText("");
|
|
133
|
+
// form.getTextField('HP Thermostat Model').setText("");
|
|
134
|
+
// // check group
|
|
135
|
+
// Yes Discharge
|
|
136
|
+
// Yes Staging
|
|
137
|
+
// No this does not apply
|
|
138
|
+
|
|
139
|
+
form.getTextField('Notes').setText("");
|
|
21
140
|
|
|
22
141
|
// flatten and return as base64
|
|
23
|
-
|
|
142
|
+
form.flatten();
|
|
24
143
|
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
25
144
|
return pdfBase64;
|
|
26
145
|
}
|
|
@@ -66,7 +66,7 @@ export async function generateReport(payload) {
|
|
|
66
66
|
form.getTextField('DateOfServiceLabelLower').setText("");
|
|
67
67
|
form.getTextField('TimeOfServiceLabelLower').setText("");
|
|
68
68
|
form.getTextField('DateOfServiceLabelUpper').setText("Date of Service:");
|
|
69
|
-
form.getTextField('TimeOfServiceLabelUpper').setText("Time of Service:");
|
|
69
|
+
form.getTextField('TimeOfServiceLabelUpper').setText("Time of Service:");
|
|
70
70
|
form.getTextField('DateOfServiceUpper').setText(date.toLocaleDateString("en-US"));
|
|
71
71
|
form.getTextField('TimeOfServiceUpper').setText(date.toLocaleTimeString("en-US"));
|
|
72
72
|
}
|
|
@@ -130,16 +130,19 @@ export async function generateReport(payload) {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// flatten and return as base64
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
form.flatten();
|
|
134
|
+
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
135
|
+
return pdfBase64;
|
|
136
|
+
|
|
137
|
+
// if (payload.project.isCordova) {
|
|
138
|
+
// const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
139
|
+
// return pdfBase64;
|
|
140
|
+
// } else {
|
|
141
|
+
// const pdfBytes = await pdfDoc.save();
|
|
142
|
+
// const fn = "vitals-heating-test.pdf";
|
|
143
|
+
// require("downloadjs").download(pdfBytes, fn, "application/pdf");
|
|
144
|
+
// return fn;
|
|
145
|
+
// }
|
|
143
146
|
}
|
|
144
147
|
|
|
145
148
|
function getGradeFromScore(score) {
|
|
@@ -105,11 +105,11 @@ export async function generateReport(payload) {
|
|
|
105
105
|
form.getTextField('FilterFaceVelocity').setText(`${textFields.fltrFace} FPM`);
|
|
106
106
|
|
|
107
107
|
// print losses data (second page)
|
|
108
|
-
form.getTextField('AgeLosses').setText(
|
|
109
|
-
form.getTextField('TemperatureSplitLosses').setText(
|
|
110
|
-
form.getTextField('StaticPressureLosses').setText(
|
|
111
|
-
form.getTextField('ApproachLosses').setText(
|
|
112
|
-
form.getTextField('RefrigerantChargeIssues').setText(
|
|
108
|
+
form.getTextField('AgeLosses').setText(`-${textFields.ageLosses}`);
|
|
109
|
+
form.getTextField('TemperatureSplitLosses').setText(`-${textFields.tempSplitLosses}`);
|
|
110
|
+
form.getTextField('StaticPressureLosses').setText(`-${textFields.staticLosses}`);
|
|
111
|
+
form.getTextField('ApproachLosses').setText(`-${textFields.approachLosses}`);
|
|
112
|
+
form.getTextField('RefrigerantChargeIssues').setText(`-${textFields.refChargeLosses}`);
|
|
113
113
|
form.getTextField('YourSystemScorePage2').setText(`${systemScorePercentage}% ${systemScoreGrade}`);
|
|
114
114
|
|
|
115
115
|
// print targets and range icons
|
|
@@ -145,16 +145,19 @@ export async function generateReport(payload) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// flatten and return as base64
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
form.flatten();
|
|
149
|
+
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
150
|
+
return pdfBase64;
|
|
151
|
+
|
|
152
|
+
// if (payload.project.isCordova) {
|
|
153
|
+
// const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
154
|
+
// return pdfBase64;
|
|
155
|
+
// } else {
|
|
156
|
+
// const pdfBytes = await pdfDoc.save();
|
|
157
|
+
// const fn = "vitals-test.pdf";
|
|
158
|
+
// //require("downloadjs").download(pdfBytes, fn, "application/pdf");
|
|
159
|
+
// return fn;
|
|
160
|
+
// }
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
function getGradeFromScore(score) {
|
package/package.json
CHANGED
package/sign-pdf.js
CHANGED
|
@@ -10,7 +10,7 @@ export async function signPdf(fillableReportFileName, fillableFieldName, signatu
|
|
|
10
10
|
const signature = await pdfDoc.embedPng(signatureBytes);
|
|
11
11
|
const form = pdfDoc.getForm();
|
|
12
12
|
form.getButton(fillableFieldName).setImage(signature);
|
|
13
|
-
|
|
13
|
+
form.flatten();
|
|
14
14
|
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
15
15
|
return pdfBase64;
|
|
16
16
|
}
|