www/js/prod_new.js

changeset 240
a85c1d4c4d12
parent 170
71850ebe5a1c
child 243
b43214d218c0
equal deleted inserted replaced
239:03e81378182d 240:a85c1d4c4d12
21 *****************************************************************************/ 21 *****************************************************************************/
22 22
23 23
24 $(document).ready(function () { 24 $(document).ready(function () {
25 25
26 // tooltips 26 var recipe_type = 2;
27 var style_type = 0;
28 var tun_material = 0;
29
30 // Tab 1, base
27 $("#name").jqxTooltip({ content: 'De naam voor dit brouw project.' }); 31 $("#name").jqxTooltip({ content: 'De naam voor dit brouw project.' });
32 $("#name").jqxInput({ theme: theme, width: 640, height: 23 });
28 $("#code").jqxTooltip({ content: 'Het unieke code nummer van dit brouw project.' }); 33 $("#code").jqxTooltip({ content: 'Het unieke code nummer van dit brouw project.' });
34 $("#code").jqxInput({ theme: theme, width: 100, height: 23 });
29 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit project.' }); 35 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit project.' });
30 $("#type").jqxTooltip({ content: 'Het brouw type van bier in dit brouw project.' });
31
32 // editers
33 var srcType = [ "All Grain", "Partial Mash", "Extract" ];
34 $("#name").jqxInput({ theme: theme, width: 640, height: 23 });
35 $("#code").jqxInput({ theme: theme, width: 100, height: 23 });
36 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); 36 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 });
37 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 125, height: 23, dropDownHeight: 95 }); 37 $("#type").jqxDropDownList({
38 38 theme: theme,
39 source: RecipeTypeAdapter,
40 valueMember: 'id',
41 displayMember: 'nl',
42 width: 180,
43 height: 23,
44 autoDropDownHeight: true
45 });
46 $("#type").jqxDropDownList('selectItem', 2);
47 $("#type").on('select', function (event) {
48 if (event.args) {
49 recipe_type = event.args.index;
50 }
51 });
52
53 // Tab 2, style
54 $("#st_name").jqxTooltip({ content: 'De bierstijl naam voor dit recept.'});
39 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 }); 55 $("#st_name").jqxInput({ theme: theme, width: 250, height: 23 });
56 $("#st_category").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie.'});
40 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 }); 57 $("#st_category").jqxInput({ theme: theme, width: 250, height: 23 });
58 $("#st_category_number").jqxTooltip({ content: 'De Amerikaanse bierstijl categorie sub nummer.'});
41 $("#st_category_number").jqxInput({ theme: theme, width: 70, height: 23 }); 59 $("#st_category_number").jqxInput({ theme: theme, width: 70, height: 23 });
60 $("#st_letter").jqxTooltip({ content: 'De bierstijl letter voor dit recept.'});
42 $("#st_letter").jqxInput({ theme: theme, width: 250, height: 23 }); 61 $("#st_letter").jqxInput({ theme: theme, width: 250, height: 23 });
62 $("#st_guide").jqxTooltip({ content: 'De bierstijl gids voor dit recept.'});
43 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 }); 63 $("#st_guide").jqxInput({ theme: theme, width: 250, height: 23 });
44 $("#st_notes").jqxInput({ theme: theme, width: 800, height: 100 }); 64 $("#st_notes").jqxInput({ theme: theme, width: 800, height: 100 });
45 $("#st_type").jqxInput({ theme: theme, width: 90, height: 23 }); 65 $("#st_type").jqxTooltip({ content: 'Het bierstijl type.'});
46 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); 66 $("#st_type").jqxInput({ theme: theme, width: 250, height: 23 });
47 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); 67 $("#st_og_min").jqxTooltip({ content: 'Het minimum begin SG voor deze bierstijl.'});
48 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); 68 $("#st_og_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
49 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 3, readOnly: true }); 69 $("#st_og_max").jqxTooltip({ content: 'Het maximum begin SG voor deze bierstijl.'});
50 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); 70 $("#st_og_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
51 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); 71 $("#st_fg_min").jqxTooltip({ content: 'Het minimum eind SG voor deze bierstijl.'});
52 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); 72 $("#st_fg_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
53 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 0, readOnly: true }); 73 $("#st_fg_max").jqxTooltip({ content: 'Het maximum eind SG voor deze bierstijl.'});
54 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); 74 $("#st_fg_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 3, readOnly: true });
55 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); 75 $("#st_ibu_min").jqxTooltip({ content: 'De minimum bitterheid voor deze bierstijl.'});
56 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); 76 $("#st_ibu_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
57 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 50, height: 23, decimalDigits: 1, readOnly: true }); 77 $("#st_ibu_max").jqxTooltip({ content: 'De maximum bitterheid voor deze bierstijl.'});
78 $("#st_ibu_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
79 $("#st_color_min").jqxTooltip({ content: 'De minimum kleur voor deze bierstijl.'});
80 $("#st_color_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
81 $("#st_color_max").jqxTooltip({ content: 'De maximum kleur voor deze bierstijl.'});
82 $("#st_color_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 0, readOnly: true });
83 $("#st_carb_min").jqxTooltip({ content: 'Het minimum koolzuur volume voor deze bierstijl.'});
84 $("#st_carb_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
85 $("#st_carb_max").jqxTooltip({ content: 'Het maximum koolzuur volume voor deze bierstijl.'});
86 $("#st_carb_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
87 $("#st_abv_min").jqxTooltip({ content: 'Het minimum alcohol volume % voor deze bierstijl.'});
88 $("#st_abv_min").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
89 $("#st_abv_max").jqxTooltip({ content: 'Het maximum alcohol volume % voor deze bierstijl.'});
90 $("#st_abv_max").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 90, height: 23, decimalDigits: 1, readOnly: true });
58 $("#st_profile").jqxInput({ theme: theme, width: 800, height: 48 }); 91 $("#st_profile").jqxInput({ theme: theme, width: 800, height: 48 });
59 $("#st_ingredients").jqxInput({ theme: theme, width: 800, height: 23 }); 92 $("#st_ingredients").jqxInput({ theme: theme, width: 800, height: 23 });
60 $("#st_examples").jqxInput({ theme: theme, width: 800, height: 48 }); 93 $("#st_examples").jqxInput({ theme: theme, width: 800, height: 48 });
61
62 $("#eq_name").jqxTooltip({ content: 'De naam van deze brouw apparatuur.' });
63 $("#eq_name").jqxInput({ theme: theme, width: 250, height: 23 });
64 $("#eq_calc_boil_volume").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true });
65 $("#eq_boil_size").jqxTooltip({ content: 'Normaal kook volume in liters' });
66 $("#eq_boil_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
67 $("#eq_batch_size").jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' });
68 $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
69 $("#eq_tun_volume").jqxTooltip({ content: 'Maisch ketel volume.' });
70 $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
71 $("#eq_tun_weight").jqxTooltip({ content: 'Maisch ketel gewicht.' });
72 $("#eq_tun_weight").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
73 $("#eq_tun_height").jqxTooltip({ content: 'Maisch ketel hoogte.' });
74 $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
75 $("#eq_tun_material").jqxTooltip({ content: 'Maisch ketel materiaal.' });
76 $("#eq_tun_material").jqxInput({ theme: theme, width: 120, height: 23 });
77 $("#eq_tun_specific_heat").jqxTooltip({ content: 'Maisch ketel warmte geleiding.' });
78 $("#eq_tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
79 $("#eq_top_up_water").jqxTooltip({ content: 'Extra water in het gistvat.' });
80 $("#eq_top_up_water").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
81 $("#eq_trub_chiller_loss").jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' });
82 $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
83 $("#eq_evap_rate").jqxTooltip({ content: 'Verdamping in liters per uur.' });
84 $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 2, });
85 $("#eq_boil_time").jqxTooltip({ content: 'Normale kooktijd in minuten.' });
86 $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
87 $("#eq_top_up_kettle").jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' });
88 $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
89 $("#eq_hop_utilization").jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' });
90 $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 });
91 $("#eq_notes").jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' });
92 $("#eq_notes").jqxInput({ theme: theme, width: 960, height: 100 });
93 $("#eq_lauter_volume").jqxTooltip({ content: 'Filterkuip volume.' });
94 $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
95 $("#eq_lauter_height").jqxTooltip({ content: 'Filterkuip hoogte.' });
96 $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
97 $("#eq_lauter_deadspace").jqxTooltip({ content: 'Filterkuip verlies in liters.' });
98 $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
99 $("#eq_kettle_volume").jqxTooltip({ content: 'Kook ketel volume in liters.' });
100 $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
101 $("#eq_kettle_height").jqxTooltip({ content: 'Kook ketel hoogte in cm.' });
102 $("#eq_kettle_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
103 $("#eq_mash_volume").jqxTooltip({ content: 'Maisch water voor de eerste stap.' });
104 $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
105 $("#eq_mash_max").jqxTooltip({ content: 'De maximale moutstort in Kg.' });
106 $("#eq_mash_max").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
107 $("#eq_efficiency").jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' });
108 $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 });
109
110 // Default values
111 $("#type").val('All Grain');
112
113 $("#styleSelect").jqxDropDownList({ 94 $("#styleSelect").jqxDropDownList({
114 placeHolder: "Kies bierstijl:", 95 placeHolder: "Kies bierstijl:",
115 theme: theme, 96 theme: theme,
116 source: styleslist, 97 source: styleslist,
117 displayMember: "name", 98 displayMember: "name",
118 width: 150, 99 width: 250,
119 height: 27, 100 height: 27,
120 dropDownWidth: 500, 101 dropDownWidth: 500,
121 dropDownHeight: 500, 102 dropDownHeight: 500,
122 renderer: function (index, label, value) { 103 renderer: function (index, label, value) {
123 var datarecord = styleslist.records[index]; 104 var datarecord = styleslist.records[index];
124 return datarecord.style_guide + " " + datarecord.style_letter+ " " + datarecord.name; 105 return datarecord.style_guide + " " + datarecord.style_letter+ " " + datarecord.name;
125 } 106 }
126 }); 107 });
127 $("#styleSelect").on('select', function (event) { 108 $("#styleSelect").on('select', function (event) {
128 if (event.args) { 109 if (event.args) {
131 $("#st_name").val(datarecord.name); 112 $("#st_name").val(datarecord.name);
132 $("#st_category").val(datarecord.category); 113 $("#st_category").val(datarecord.category);
133 $("#st_category_number").val(datarecord.category_number); 114 $("#st_category_number").val(datarecord.category_number);
134 $("#st_letter").val(datarecord.style_letter); 115 $("#st_letter").val(datarecord.style_letter);
135 $("#st_guide").val(datarecord.style_guide); 116 $("#st_guide").val(datarecord.style_guide);
136 $("#st_type").val(datarecord.type); 117 style_type = datarecord.type;
118 $("#st_type").val(StyleTypeData[datarecord.type].nl);
137 $("#st_og_min").val(datarecord.og_min); 119 $("#st_og_min").val(datarecord.og_min);
138 $("#st_og_max").val(datarecord.og_max); 120 $("#st_og_max").val(datarecord.og_max);
139 $("#st_fg_min").val(datarecord.fg_min); 121 $("#st_fg_min").val(datarecord.fg_min);
140 $("#st_fg_max").val(datarecord.fg_max); 122 $("#st_fg_max").val(datarecord.fg_max);
141 $("#st_ibu_min").val(datarecord.ibu_min); 123 $("#st_ibu_min").val(datarecord.ibu_min);
151 $("#st_ingredients").val(datarecord.ingredients); 133 $("#st_ingredients").val(datarecord.ingredients);
152 $("#st_examples").val(datarecord.examples); 134 $("#st_examples").val(datarecord.examples);
153 } 135 }
154 }); 136 });
155 137
156 // Equipemnt dropdown list 138 // Tab 3, equipment
139 $("#eq_name").jqxTooltip({ content: 'De naam van deze brouw apparatuur.' });
140 $("#eq_name").jqxInput({ theme: theme, width: 250, height: 23 });
141 $("#eq_calc_boil_volume").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled: true });
142 $("#eq_boil_size").jqxTooltip({ content: 'Normaal kook volume in liters' });
143 $("#eq_boil_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
144 $("#eq_batch_size").jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' });
145 $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
146 $("#eq_tun_volume").jqxTooltip({ content: 'Maisch ketel volume.' });
147 $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
148 $("#eq_tun_weight").jqxTooltip({ content: 'Maisch ketel gewicht.' });
149 $("#eq_tun_weight").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
150 $("#eq_tun_height").jqxTooltip({ content: 'Maisch ketel hoogte.' });
151 $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
152 $("#eq_tun_material").jqxTooltip({ content: 'Maisch ketel materiaal.' });
153 $("#eq_tun_material").jqxInput({ theme: theme, width: 180, height: 23 });
154 $("#eq_tun_specific_heat").jqxTooltip({ content: 'Maisch ketel warmte geleiding.' });
155 $("#eq_tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 3 });
156 $("#eq_top_up_water").jqxTooltip({ content: 'Extra water in het gistvat.' });
157 $("#eq_top_up_water").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
158 $("#eq_trub_chiller_loss").jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' });
159 $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
160 $("#eq_evap_rate").jqxTooltip({ content: 'Verdamping in liters per uur.' });
161 $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 2, });
162 $("#eq_boil_time").jqxTooltip({ content: 'Normale kooktijd in minuten.' });
163 $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 0 });
164 $("#eq_top_up_kettle").jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' });
165 $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
166 $("#eq_hop_utilization").jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' });
167 $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 0 });
168 $("#eq_notes").jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' });
169 $("#eq_notes").jqxInput({ theme: theme, width: 960, height: 100 });
170 $("#eq_lauter_volume").jqxTooltip({ content: 'Filterkuip volume.' });
171 $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
172 $("#eq_lauter_height").jqxTooltip({ content: 'Filterkuip hoogte.' });
173 $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
174 $("#eq_lauter_deadspace").jqxTooltip({ content: 'Filterkuip verlies in liters.' });
175 $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
176 $("#eq_kettle_volume").jqxTooltip({ content: 'Kook ketel volume in liters.' });
177 $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
178 $("#eq_kettle_height").jqxTooltip({ content: 'Kook ketel hoogte in cm.' });
179 $("#eq_kettle_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
180 $("#eq_mash_volume").jqxTooltip({ content: 'Maisch water voor de eerste stap.' });
181 $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
182 $("#eq_mash_max").jqxTooltip({ content: 'De maximale moutstort in Kg.' });
183 $("#eq_mash_max").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
184 $("#eq_efficiency").jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' });
185 $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 1 });
157 $("#equipmentSelect").jqxDropDownList({ 186 $("#equipmentSelect").jqxDropDownList({
158 placeHolder: "Kies apparatuur:", 187 placeHolder: "Kies apparatuur:",
159 theme: theme, 188 theme: theme,
160 source: equipmentlist, 189 source: equipmentlist,
161 displayMember: "name", 190 displayMember: "name",
162 width: 150, 191 width: 250,
163 height: 27, 192 height: 27,
164 dropDownWidth: 300, 193 dropDownWidth: 300,
165 renderer: function (index, label, value) { 194 renderer: function (index, label, value) {
166 var datarecord = equipmentlist.records[index]; 195 var datarecord = equipmentlist.records[index];
167 return datarecord.batch_size + " liter " + datarecord.name; 196 return datarecord.batch_size + " liter " + datarecord.name;
175 $("#eq_boil_size").val(datarecord.boil_size); 204 $("#eq_boil_size").val(datarecord.boil_size);
176 $("#eq_batch_size").val(datarecord.batch_size); 205 $("#eq_batch_size").val(datarecord.batch_size);
177 $("#eq_tun_volume").val(datarecord.tun_volume); 206 $("#eq_tun_volume").val(datarecord.tun_volume);
178 $("#eq_tun_weight").val(datarecord.tun_weight); 207 $("#eq_tun_weight").val(datarecord.tun_weight);
179 $("#eq_tun_specific_heat").val(datarecord.tun_specific_heat); 208 $("#eq_tun_specific_heat").val(datarecord.tun_specific_heat);
180 $("#eq_tun_material").val(datarecord.tun_material); 209 tun_material = datarecord.tun_material;
210 $("#eq_tun_material").val(MaterialData[datarecord.tun_material].nl);
181 $("#eq_tun_height").val(datarecord.tun_height); 211 $("#eq_tun_height").val(datarecord.tun_height);
182 $("#eq_top_up_water").val(datarecord.top_up_water); 212 $("#eq_top_up_water").val(datarecord.top_up_water);
183 $("#eq_trub_chiller_loss").val(datarecord.trub_chiller_loss); 213 $("#eq_trub_chiller_loss").val(datarecord.trub_chiller_loss);
184 $("#eq_evap_rate").val(datarecord.evap_rate); 214 $("#eq_evap_rate").val(datarecord.evap_rate);
185 $("#eq_boil_time").val(datarecord.boil_time); 215 $("#eq_boil_time").val(datarecord.boil_time);
221 var newrow = { 251 var newrow = {
222 record: -1, 252 record: -1,
223 name: $("#name").val(), 253 name: $("#name").val(),
224 code: $("#code").val(), 254 code: $("#code").val(),
225 birth: b, 255 birth: b,
226 stage: 'Plan', 256 stage: 0,
227 notes: $("#notes").val(), 257 notes: $("#notes").val(),
228 log_brew: false, 258 log_brew: false,
229 log_fermentation: false, 259 log_fermentation: false,
230 inventory_reduced: false, 260 inventory_reduced: false,
231 locked: false, 261 locked: false,
233 eq_boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')), 263 eq_boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')),
234 eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')), 264 eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')),
235 eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')), 265 eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')),
236 eq_tun_weight: parseFloat($("#eq_tun_weight").jqxNumberInput('decimal')), 266 eq_tun_weight: parseFloat($("#eq_tun_weight").jqxNumberInput('decimal')),
237 eq_tun_specific_heat: parseFloat($("#eq_tun_specific_heat").jqxNumberInput('decimal')), 267 eq_tun_specific_heat: parseFloat($("#eq_tun_specific_heat").jqxNumberInput('decimal')),
238 eq_tun_material: $("#eq_tun_material").val(), 268 eq_tun_material: tun_material,
239 eq_tun_height: parseFloat($("#eq_tun_height").jqxNumberInput('decimal')), 269 eq_tun_height: parseFloat($("#eq_tun_height").jqxNumberInput('decimal')),
240 eq_top_up_water: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')), 270 eq_top_up_water: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')),
241 eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')), 271 eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')),
242 eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')), 272 eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')),
243 eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')), 273 eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')),
264 brew_preboil_ph: 0.0, 294 brew_preboil_ph: 0.0,
265 brew_aboil_volume: 0, 295 brew_aboil_volume: 0,
266 brew_aboil_sg: 1.000, 296 brew_aboil_sg: 1.000,
267 brew_aboil_ph: 0.0, 297 brew_aboil_ph: 0.0,
268 brew_aboil_efficiency: 0, 298 brew_aboil_efficiency: 0,
269 brew_cooling_method: '-', 299 brew_cooling_method: 0,
270 brew_cooling_time: 0, 300 brew_cooling_time: 0,
271 brew_cooling_to: 0, 301 brew_cooling_to: 0,
272 brew_whirlpool9: 0, 302 brew_whirlpool9: 0,
273 brew_whirlpool7: 0, 303 brew_whirlpool7: 0,
274 brew_whirlpool6: 0, 304 brew_whirlpool6: 0,
275 brew_whirlpool2: 0, 305 brew_whirlpool2: 0,
276 brew_fermenter_volume: 0, 306 brew_fermenter_volume: 0,
277 brew_fermenter_extrawater: 0, 307 brew_fermenter_extrawater: 0,
278 brew_aeration_time: 0, 308 brew_aeration_time: 0,
279 brew_aeration_speed: 0, 309 brew_aeration_speed: 0,
280 brew_aeration_type: 'None', 310 brew_aeration_type: 0,
281 brew_fermenter_sg: 0, 311 brew_fermenter_sg: 0,
282 brew_fermenter_ibu: 0, 312 brew_fermenter_ibu: 0,
283 brew_date_end: '', 313 brew_date_end: '',
284 brew_log_available: false, 314 brew_log_available: false,
285 og: 0, 315 og: 0,
293 secondary_end_date: '', 323 secondary_end_date: '',
294 tertiary_temp: 0, 324 tertiary_temp: 0,
295 package_date: '', 325 package_date: '',
296 bottle_amount: 0, 326 bottle_amount: 0,
297 bottle_carbonation: 0, 327 bottle_carbonation: 0,
298 bottle_priming_sugar: 'Kristalsuiker', 328 bottle_priming_sugar: 0,
299 bottle_priming_amount: 0, 329 bottle_priming_amount: 0,
300 bottle_carbonation_temp: 23, 330 bottle_carbonation_temp: 23,
301 keg_amount: 0, 331 keg_amount: 0,
302 keg_carbonation: 0, 332 keg_carbonation: 0,
303 keg_priming_sugar: 'Kristalsuiker', 333 keg_priming_sugar: 0,
304 keg_priming_amount: 0, 334 keg_priming_amount: 0,
305 keg_carbonation_temp: 23, 335 keg_carbonation_temp: 23,
306 keg_forced_carb: false, 336 keg_forced_carb: false,
307 keg_pressure: 0, 337 keg_pressure: 0,
308 taste_notes: '', 338 taste_notes: '',
316 taste_mouthfeel: '', 346 taste_mouthfeel: '',
317 taste_aftertaste: '', 347 taste_aftertaste: '',
318 st_name: $('#st_name').val(), 348 st_name: $('#st_name').val(),
319 st_letter: $('#st_letter').val(), 349 st_letter: $('#st_letter').val(),
320 st_guide: $('#st_guide').val(), 350 st_guide: $('#st_guide').val(),
321 st_type: $('#st_type').val(), 351 st_type: style_type,
322 st_category: $('#st_category').val(), 352 st_category: $('#st_category').val(),
323 st_category_number: parseFloat($("#st_category_number").jqxNumberInput('decimal')), 353 st_category_number: parseFloat($("#st_category_number").jqxNumberInput('decimal')),
324 st_og_min: parseFloat($("#st_og_min").jqxNumberInput('decimal')), 354 st_og_min: parseFloat($("#st_og_min").jqxNumberInput('decimal')),
325 st_og_max: parseFloat($("#st_og_max").jqxNumberInput('decimal')), 355 st_og_max: parseFloat($("#st_og_max").jqxNumberInput('decimal')),
326 st_fg_min: parseFloat($("#st_fg_min").jqxNumberInput('decimal')), 356 st_fg_min: parseFloat($("#st_fg_min").jqxNumberInput('decimal')),
331 st_color_max: parseFloat($("#st_color_max").jqxNumberInput('decimal')), 361 st_color_max: parseFloat($("#st_color_max").jqxNumberInput('decimal')),
332 st_carb_min: parseFloat($("#st_carb_min").jqxNumberInput('decimal')), 362 st_carb_min: parseFloat($("#st_carb_min").jqxNumberInput('decimal')),
333 st_carb_max: parseFloat($("#st_carb_max").jqxNumberInput('decimal')), 363 st_carb_max: parseFloat($("#st_carb_max").jqxNumberInput('decimal')),
334 st_abv_min: parseFloat($("#st_abv_min").jqxNumberInput('decimal')), 364 st_abv_min: parseFloat($("#st_abv_min").jqxNumberInput('decimal')),
335 st_abv_max: parseFloat($("#st_abv_max").jqxNumberInput('decimal')), 365 st_abv_max: parseFloat($("#st_abv_max").jqxNumberInput('decimal')),
336 type: $("#type").val(), 366 type: recipe_type,
337 batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')), 367 batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')),
338 boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')), 368 boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')),
339 boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')), 369 boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')),
340 efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')), 370 efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')),
341 est_og: 0.000, 371 est_og: 0.000,
342 est_fg: 0.000, 372 est_fg: 0.000,
343 est_color: 0, 373 est_color: 0,
344 est_abv: 0.0, 374 est_abv: 0.0,
345 est_carb: 0.0, 375 est_carb: 0.0,
346 color_method: "Morey", 376 color_method: 0,
347 est_ibu: 0, 377 est_ibu: 0,
348 ibu_method: "Tinseth", 378 ibu_method: 0,
349 mash_name: "", 379 mash_name: "",
350 mash_ph: 5.4, 380 mash_ph: 5.4,
351 sparge_temp: 78.0, 381 sparge_temp: 85.0,
352 sparge_volume: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')) / 2, 382 sparge_volume: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')) / 2,
353 sparge_ph: 5.8, 383 sparge_ph: 5.8,
354 sparge_source: 'Bron 1', 384 sparge_source: 0,
355 sparge_acid_type: 'Melkzuur', 385 sparge_acid_type: 0,
356 sparge_acid_perc: 80, 386 sparge_acid_perc: 80,
357 sparge_acid_amount: 0, 387 sparge_acid_amount: 0,
358 calc_acid: true 388 calc_acid: true,
389 w1_name: 'Tap water',
390 w1_amount: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')),
391 w1_calcium: 0,
392 w1_sulfate: 0,
393 w1_chloride: 0,
394 w1_sodium: 0,
395 w1_magnesium: 0,
396 w1_total_alkalinity: 0,
397 w1_ph: 7.0,
398 w1_cost: 0.0,
399 wa_acid_name: 0, // Lactic acid
400 wa_acid_perc: 80,
401 wa_base_name: 0
402
359 }; 403 };
360 var data = "insert=true&return=" + my_return + "&" + $.param(newrow); 404 var data = "insert=true&return=" + my_return + "&" + $.param(newrow);
361 $.ajax({ 405 $.ajax({
362 dataType: 'json', 406 dataType: 'json',
363 url: "includes/db_product.php", 407 url: "includes/db_product.php",
441 $(selector).html('<strong>' + message + '</strong>'); 485 $(selector).html('<strong>' + message + '</strong>');
442 }, 486 },
443 487
444 //Validating the first tab 488 //Validating the first tab
445 firstTab: function (notify) { 489 firstTab: function (notify) {
446 var name = $('#name').val(), code = $('#code').val(), message = ''; 490 var name = $('#name').val(),
491 code = $('#code').val(),
492 message = '';
447 if (name.length < 3) { 493 if (name.length < 3) {
448 message += 'Je moet een brouw project naam invullen. <br />'; 494 message += 'Je moet een brouw project naam invullen. <br />';
449 } 495 }
450 if (code.length < 3) { 496 if (code.length < 3) {
451 message += 'Je moet een brouw project code invullen. <br />'; 497 message += 'Je moet een brouw project code invullen. <br />';
479 }, 525 },
480 526
481 //Validating the third tab 527 //Validating the third tab
482 thirdTab: function (notify) { 528 thirdTab: function (notify) {
483 var equipsel = $('#equipmentSelect').val(), 529 var equipsel = $('#equipmentSelect').val(),
484 message = ''; 530 message = '';
485 if (equipsel.length < 3) { 531 if (equipsel.length < 3) {
486 message += 'Je moet een brouw installatie kiezen. <br />'; 532 message += 'Je moet een brouw installatie kiezen. <br />';
487 } 533 }
488 if (message !== '') { 534 if (message !== '') {
489 if (notify) { 535 if (notify) {

mercurial