@measurequick/measurequick-report-generator 1.3.5 → 1.3.7
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
|
@@ -11,13 +11,14 @@ export async function getReport(payload) {
|
|
|
11
11
|
// get form for filling
|
|
12
12
|
const form = pdfDoc.getForm();
|
|
13
13
|
|
|
14
|
-
let
|
|
14
|
+
let l = payload.tests.length - 1;
|
|
15
|
+
let t = payload.tests[l].testInfo.data;
|
|
15
16
|
|
|
16
17
|
// TOP SECTION
|
|
17
|
-
form.getTextField('Installation Contractor').setText(payload.meta.company_name);
|
|
18
|
-
form.getTextField('Installation Tech').setText(payload.meta.technician_name);
|
|
19
|
-
form.getTextField('System Reference ID').setText(payload.equipment.ahri_reference_number);
|
|
20
|
-
form.getTextField('Install Service Date').setText(payload.meta.date_of_service);
|
|
18
|
+
form.getTextField('Installation Contractor').setText(payload.meta.company_name ? `${payload.meta.company_name}` : 'XXX');
|
|
19
|
+
form.getTextField('Installation Tech').setText(payload.meta.technician_name ? `${payload.meta.technician_name}` : 'XXX');
|
|
20
|
+
form.getTextField('System Reference ID').setText(payload.equipment.ahri_reference_number ? `${payload.equipment.ahri_reference_number}` : 'XXX');
|
|
21
|
+
form.getTextField('Install Service Date').setText(payload.meta.date_of_service ? `${payload.meta.date_of_service}` : 'XXX');
|
|
21
22
|
|
|
22
23
|
if (payload.equipment.primary_heating_fuel_type == 'Gas') form.getCheckBox('ExistingHeatSourceFuelGas').check();
|
|
23
24
|
else if (payload.equipment.primary_heating_fuel_type == 'Electric') form.getCheckBox('ExistingHeatSourceFuelElectric').check();
|
|
@@ -28,8 +29,8 @@ export async function getReport(payload) {
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
// TUNE UP
|
|
31
|
-
form.getTextField('Manufacturer').setText(payload.equipment.condenser_make);
|
|
32
|
-
form.getTextField('Measured EER').setText(payload.equipment.condenser_model);
|
|
32
|
+
form.getTextField('Manufacturer').setText(payload.equipment.condenser_make ? `${payload.equipment.condenser_make}` : 'XXX');
|
|
33
|
+
form.getTextField('Measured EER').setText(payload.equipment.condenser_model ? `${payload.equipment.condenser_model}` : 'XXX');
|
|
33
34
|
// form.getTextField('Age of System').setText(payload.);
|
|
34
35
|
// form.getTextField('Heat Pump Efficiency').setText(payload.);
|
|
35
36
|
// form.getTextField('Model Number').setText(payload.);
|
|
@@ -48,13 +49,13 @@ export async function getReport(payload) {
|
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
// HVAC QUALITY INSTALL
|
|
51
|
-
form.getTextField('Capacity Btuh_2').setText(payload.equipment.capacity);
|
|
52
|
+
form.getTextField('Capacity Btuh_2').setText(payload.equipment.capacity ? `${payload.equipment.capacity}` : 'XXX');
|
|
52
53
|
// form.getTextField('AHRI Capacity Btuh').setText(payload.);
|
|
53
54
|
// form.getTextField('Measured System EER').setText(payload.);
|
|
54
|
-
form.getTextField('Manufacturer_2').setText(payload.equipment.make);
|
|
55
|
-
form.getTextField('Heat Pump Efficiency COP or HSPF_2').setText(payload.equipment.cop);
|
|
56
|
-
form.getTextField('AHRI Certificate Number').setText(payload.equipment.ahri_reference_number);
|
|
57
|
-
form.getTextField('Calculated SEER normalized to AHRI conditions2').setText(payload.equipment.efficiency_seasonal);
|
|
55
|
+
form.getTextField('Manufacturer_2').setText(payload.equipment.make ? `${payload.equipment.make}` : 'XXX');
|
|
56
|
+
form.getTextField('Heat Pump Efficiency COP or HSPF_2').setText(payload.equipment.cop ? `${payload.equipment.cop}` : 'XXX');
|
|
57
|
+
form.getTextField('AHRI Certificate Number').setText(payload.equipment.ahri_reference_number ? `${payload.equipment.ahri_reference_number}` : 'XXX');
|
|
58
|
+
form.getTextField('Calculated SEER normalized to AHRI conditions2').setText(payload.equipment.efficiency_seasonal ? `${payload.equipment.efficiency_seasonal}` : 'XXX');
|
|
58
59
|
// form.getTextField('Indoor Coil Model Number').setText(payload.);
|
|
59
60
|
// form.getTextField('Age of System_2').setText(payload.);
|
|
60
61
|
// form.getTextField('Manufactured SEER2:').setText(payload.);
|
|
@@ -70,19 +71,19 @@ export async function getReport(payload) {
|
|
|
70
71
|
// form.getTextField('InsidePerfReturnWetBulb').setText(payload.);
|
|
71
72
|
// form.getTextField('InsidePerformanceSupplyWetBulb').setText(payload.);
|
|
72
73
|
// form.getTextField('OutsidePerf').setText(payload.);
|
|
73
|
-
form.getTextField('TXVLiqLineTemp').setText(t.temperature_liquid_line);
|
|
74
|
+
form.getTextField('TXVLiqLineTemp').setText(t.temperature_liquid_line ? `${t.temperature_liquid_line}` : 'XXX');
|
|
74
75
|
// form.getTextField('TXVCondTemp').setText(t.);
|
|
75
|
-
form.getTextField('TXVSubcooling').setText(t.subcooling);
|
|
76
|
-
form.getTextField('FixedOrificeSuctionLineTemp').setText(t.temperature_suction_line);
|
|
77
|
-
form.getTextField('FixedOrificeSatTemp').setText(t.temperature_saturation_line);
|
|
78
|
-
form.getTextField('FixedOrificeSuperheat').setText(t.superheat);
|
|
79
|
-
form.getTextField('PressureReadingsLow Pressure').setText(t.pressure_condenser);
|
|
80
|
-
form.getTextField('PressureReadingsHigh Pressure').setText(t.pressure_evaporator);
|
|
76
|
+
form.getTextField('TXVSubcooling').setText(t.subcooling ? `${t.subcooling}` : 'XXX');
|
|
77
|
+
form.getTextField('FixedOrificeSuctionLineTemp').setText(t.temperature_suction_line ? `${t.temperature_suction_line}` : 'XXX');
|
|
78
|
+
form.getTextField('FixedOrificeSatTemp').setText(t.temperature_saturation_line ? `${t.temperature_saturation_line}` : 'XXX');
|
|
79
|
+
form.getTextField('FixedOrificeSuperheat').setText(t.superheat ? `${t.superheat}` : 'XXX');
|
|
80
|
+
form.getTextField('PressureReadingsLow Pressure').setText(t.pressure_condenser ? `${t.pressure_evaporator}` : 'XXX');
|
|
81
|
+
form.getTextField('PressureReadingsHigh Pressure').setText(t.pressure_evaporator ? `${t.pressure_condenser}` : 'XXX');
|
|
81
82
|
|
|
82
83
|
// if () form.getCheckBox('ChargingMethodHeat').check();
|
|
83
84
|
// else form.getCheckBox('ChargingMethodCooling').check();
|
|
84
85
|
|
|
85
|
-
if (payload.equipment.metering_device
|
|
86
|
+
if (payload.equipment.metering_device == 'Fixed Orifice') form.getCheckBox('RefrigDeviceFixed Orifice').check();
|
|
86
87
|
else form.getCheckBox('RefrigDeviceTXV').check();
|
|
87
88
|
|
|
88
89
|
if (payload.equipment.refrigerant.name == 'R32') form.getCheckBox('R32').check();
|
|
@@ -103,16 +104,19 @@ export async function getReport(payload) {
|
|
|
103
104
|
|
|
104
105
|
|
|
105
106
|
// HEATING
|
|
106
|
-
form.getTextField('HeatingEnteringReturn').setText(t.temperature_entering_dry_bulb);
|
|
107
|
-
form.getTextField('HeatingExistingSupply').setText(t.temperature_leaving_dry_bulb);
|
|
108
|
-
form.getTextField('HeatingTempRiseDiff').setText(t.temperature_rise);
|
|
109
|
-
form.getTextField('HeatingOutdoor').setText(t.temperature_outdoor_dry_bulb);
|
|
110
|
-
form.getTextField('HeatingAHRI').setText(payload.equipment.ahri_reference_number);
|
|
111
|
-
form.getTextField('HeatingSize of Unit').setText(t.capacity);
|
|
107
|
+
form.getTextField('HeatingEnteringReturn').setText(t.temperature_entering_dry_bulb ? `${t.temperature_entering_dry_bulb}` : 'XXX');
|
|
108
|
+
form.getTextField('HeatingExistingSupply').setText(t.temperature_leaving_dry_bulb ? `${t.temperature_leaving_dry_bulb}` : 'XXX');
|
|
109
|
+
form.getTextField('HeatingTempRiseDiff').setText(t.temperature_rise ? `${t.temperature_rise}` : 'XXX');
|
|
110
|
+
form.getTextField('HeatingOutdoor').setText(t.temperature_outdoor_dry_bulb ? `${t.temperature_outdoor_dry_bulb}` : 'XXX');
|
|
111
|
+
form.getTextField('HeatingAHRI').setText(payload.equipment.ahri_reference_number ? `${payload.equipment.ahri_reference_number}` : 'XXX');
|
|
112
|
+
form.getTextField('HeatingSize of Unit').setText(t.capacity ? `${t.capacity}` : 'XXX');
|
|
112
113
|
|
|
113
114
|
// flatten and return as base64
|
|
114
115
|
form.flatten();
|
|
115
116
|
const pdfBase64 = await pdfDoc.saveAsBase64({ dataUri: true });
|
|
116
117
|
return pdfBase64;
|
|
117
|
-
} catch (error) {
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.log(error);
|
|
120
|
+
return error;
|
|
121
|
+
}
|
|
118
122
|
}
|