www/prod_checklist.php

branch
divide
changeset 535
1f0059cfb6fe
parent 516
28670364bd0c
child 554
c62ff53cfc3d
equal deleted inserted replaced
534:01fa81a33b70 535:1f0059cfb6fe
1 <?php 1 <?php
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); 2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php'); 3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
4 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php');
4 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php'); 5 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php');
5 6
6 7
7 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); 8 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
8 if (! $link) { 9 if (! $link) {
36 $this->Cell(4, 4,' ',1,0,'L',true); 37 $this->Cell(4, 4,' ',1,0,'L',true);
37 $this->Cell(0, 4,' '.$text,0,1,'L',true); 38 $this->Cell(0, 4,' '.$text,0,1,'L',true);
38 $this->Ln(1); 39 $this->Ln(1);
39 } 40 }
40 41
42 function Checksplit($moment, $row) {
43 global $splitat;
44 if ($row['divide_type'] && $row['divide_type'] == $moment) {
45 $this->Ln(2);
46 $this->SetFont('Helvetica','B',14);
47 $this->Cell(0, 4,$splitat[$row['divide_type']]." splits de batch hier!",0,0,'C',true);
48 $this->SetFont('Arial','',10);
49 $this->AddPage();
50 return true;
51 }
52 return false;
53 }
54
41 function Checklist($row) { 55 function Checklist($row) {
42 56
43 global $my_grain_absorbtion; 57 global $my_grain_absorbtion;
44 global $my_brix_correction; 58 global $my_brix_correction;
59 global $acidtype;
45 $mashwater = 0; 60 $mashwater = 0;
46 $numsalts = 0; 61 $numsalts = 0;
62 $factor = 1 / $row['divide_factor'];
47 63
48 $this->AddPage(); 64 $this->AddPage();
49 $this->SetFillColor(255,255,255); 65 $this->SetFillColor(255,255,255);
50 66
51 $ferms = json_decode($row['json_fermentables'], true); 67 $ferms = json_decode($row['json_fermentables'], true);
99 $this->Ln(5); 115 $this->Ln(5);
100 } 116 }
101 117
102 $this->Checkheader('Water en -behandeling'); 118 $this->Checkheader('Water en -behandeling');
103 if ($row['w1_name']) { 119 if ($row['w1_name']) {
104 $this->Checkline(sprintf("%.1f",floatval($row['w1_amount'])).' liter water '.$row['w1_name']); 120 $this->Checkline(sprintf("%.1f",floatval($row['w1_amount'] * $factor)).' liter water '.$row['w1_name']);
105 $mashwater += floatval($row['w1_amount']); 121 $mashwater += floatval($row['w1_amount'] * $factor);
106 } 122 }
107 if ($row['w2_name']) { 123 if ($row['w2_name']) {
108 $this->Checkline(sprintf("%.1f",floatval($row['w2_amount'])).' liter water '.$row['w2_name']); 124 $this->Checkline(sprintf("%.1f",floatval($row['w2_amount'] * $factor)).' liter water '.$row['w2_name']);
109 $mashwater += floatval($row['w2_amount']); 125 $mashwater += floatval($row['w2_amount'] * $factor);
110 } 126 }
111 foreach($miscs as $item) { 127 foreach($miscs as $item) {
112 if ($item['m_type'] == 4) { // Only the water agents 128 if ($item['m_type'] == 4) { // Only the water agents
113 $unit = ($item['m_amount_is_weight']) ? " gr ":" ml "; 129 $unit = ($item['m_amount_is_weight']) ? " gr ":" ml ";
114 $this->Checkline(sprintf("%.1f",floatval($item['m_amount'] * 1000)).$unit.$item['m_name']); 130 $this->Checkline(sprintf("%.2f",floatval($item['m_amount'] * 1000 * $factor)).$unit.$item['m_name']);
115 $numsalts++; 131 $numsalts++;
116 } 132 }
117 } 133 }
118 $this->Ln(5); 134 $this->Ln(5);
119 135
120 $this->Checkheader('Mout afwegen en schroten'); 136 $this->Checkheader('Mout afwegen en schroten');
121 foreach($ferms as $item) { 137 foreach($ferms as $item) {
122 if ($item['f_added'] == 0) { // to mash 138 if ($item['f_added'] == 0) { // to mash
123 $s = sprintf("%.3f",floatval($item['f_amount'])).' kg `'; 139 $s = sprintf("%.3f",floatval($item['f_amount'] * $factor)).' kg `';
124 $s .= iconv('UTF-8','windows-1252',$item['f_name']); 140 $s .= iconv('UTF-8','windows-1252',$item['f_name']);
125 $s .= '` ('.iconv('UTF-8','windows-1252',$item['f_supplier']).')'; 141 $s .= '` ('.iconv('UTF-8','windows-1252',$item['f_supplier']).')';
126 $this->Checkline($s); 142 $this->Checkline($s);
127 } 143 }
128 } 144 }
136 $arr = json_decode($row['json_mashs'], true); 152 $arr = json_decode($row['json_mashs'], true);
137 if (count($arr) > 0) { 153 if (count($arr) > 0) {
138 $loop = 0; 154 $loop = 0;
139 foreach($arr as $item) { 155 foreach($arr as $item) {
140 if ($item['step_type'] == 0) 156 if ($item['step_type'] == 0)
141 $mvol += $item['step_infuse_amount']; // We need this later. 157 $mvol += $item['step_infuse_amount'] * $factor; // We need this later.
142 if ($loop == 0) { 158 if ($loop == 0) {
143 if ($item['step_type'] == 0) 159 if ($item['step_type'] == 0)
144 $l = $item['step_infuse_amount']; 160 $l = $item['step_infuse_amount'] * $factor;
145 else 161 else
146 $l = $mashwater; 162 $l = $mashwater;
147 $s = sprintf("%.1f",$l).' liter water opwarmen tot '; 163 $s = sprintf("%.1f",$l).' liter water opwarmen tot ';
148 $s .= sprintf("%.1f",$item['step_temp']).' '.DEG.'C ('; 164 $s .= sprintf("%.1f",$item['step_temp']).' '.DEG.'C (';
149 $s .= sprintf("%.1f",kettle_cm($l,$row['eq_tun_volume'],$row['eq_tun_height'])); 165 $s .= sprintf("%.1f",kettle_cm($l,$row['eq_tun_volume'],$row['eq_tun_height']));
152 if ($numsalts > 0) 168 if ($numsalts > 0)
153 $this->Checkline('brouwzouten en -zuren toevoegen'); 169 $this->Checkline('brouwzouten en -zuren toevoegen');
154 $this->Checkline('mout storten en inmaischen'); 170 $this->Checkline('mout storten en inmaischen');
155 foreach($hops as $item2) { 171 foreach($hops as $item2) {
156 if ($item2['h_useat'] == 0) { 172 if ($item2['h_useat'] == 0) {
157 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `'; 173 $s = sprintf("%.1f",$item2['h_amount']*1000 * $factor).' gr `';
158 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` toevoegen'; 174 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` toevoegen';
159 $this->Checkline($s); 175 $this->Checkline($s);
160 } 176 }
161 } 177 }
162 foreach($miscs as $item3) { 178 foreach($miscs as $item3) {
163 if ($item3['m_use_use'] == 1 && $item3['m_type'] != 4) { // Only if not a water agent 179 if ($item3['m_use_use'] == 1 && $item3['m_type'] != 4) { // Only if not a water agent
164 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml "; 180 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml ";
165 $s = sprintf("%.2f",$item3['m_amount']*1000).$unit.'`'; 181 $s = sprintf("%.2f",$item3['m_amount']*1000 * $factor).$unit.'`';
166 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` toevoegen'; 182 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` toevoegen';
167 $this->Checkline($s); 183 $this->Checkline($s);
168 } 184 }
169 } 185 }
170 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C'); 186 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C');
171 $this->Checkline('pH meten en bijstellen (doel pH beslag: '.sprintf("%.1f",$row['mash_ph']).' pH)'); 187 $this->Checkline('pH meten en bijstellen (doel pH beslag: '.sprintf("%.1f",$row['mash_ph']).' pH)');
172 } else { 188 } else {
173 if ($item['step_type'] == 0) { // Infusion 189 if ($item['step_type'] == 0) { // Infusion
174 $s = 'toevoegen '.$item['step_infuse_amount'].' liter water van xx '.DEG.'C'; 190 $s = 'toevoegen '.($item['step_infuse_amount'] * $factor).' liter water van xx '.DEG.'C';
175 } else if ($item['step_type'] == 1) { // Direct heat 191 } else if ($item['step_type'] == 1) { // Direct heat
176 $s = 'opwarmen tot '.$item['step_temp'].' '.DEG.'C'; 192 $s = 'opwarmen tot '.$item['step_temp'].' '.DEG.'C';
177 } else { // Decoction 193 } else { // Decoction
178 $s = 'uitnemen, opwarmen, koken en terugstorten van '.$item['step_infuse_amount'].' liter deelbeslag'; 194 $s = 'uitnemen, opwarmen, koken en terugstorten van '.($item['step_infuse_amount']*$factor).' liter deelbeslag';
179 } 195 }
180 $this->Checkline($s); 196 $this->Checkline($s);
181 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C'); 197 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C');
182 } 198 }
183 $loop++; 199 $loop++;
184 } 200 }
185 $est_mash_sg = 0; 201 $est_mash_sg = 0;
186 foreach($ferms as $item) { 202 foreach($ferms as $item) {
187 if ($item['f_added'] == 0) { 203 if ($item['f_added'] == 0) {
188 $d = $item['f_amount'] * ($item['f_yield'] / 100) * (1 - $item['f_moisture'] / 100); 204 $d = $item['f_amount'] * $factor * ($item['f_yield'] / 100) * (1 - $item['f_moisture'] / 100);
189 $mvol += $item['f_amount'] * $item['f_moisture'] / 100; 205 $mvol += $item['f_amount'] * $factor * $item['f_moisture'] / 100;
190 $grainabsorbtion += $my_grain_absorbtion * $item['f_amount']; 206 $grainabsorbtion += $my_grain_absorbtion * $item['f_amount'] * $factor;
191 $msugars += $d; 207 $msugars += $d;
192 } 208 }
193 } 209 }
194 $sugardensity = 1.611; 210 $sugardensity = 1.611;
195 $v = $msugars / $sugardensity + $mvol; 211 $v = $msugars / $sugardensity + $mvol;
200 if ($this->GetY() > 200) 216 if ($this->GetY() > 200)
201 $this->AddPage(); 217 $this->AddPage();
202 else 218 else
203 $this->Ln(5); 219 $this->Ln(5);
204 220
205 $acidtype = array( 'Melkzuur', 'Zoutzuur', 'Fosforzuur', 'Zwavelzuur' );
206 $this->Checkheader('Filteren en spoelen'); 221 $this->Checkheader('Filteren en spoelen');
207 $s = sprintf("%.1f",$row['sparge_volume']).' liter spoelwater opwarmen tot '.sprintf("%.1f",$row['sparge_temp']).' '.DEG.'C'; 222 $s = sprintf("%.1f",$row['sparge_volume'] * $factor).' liter spoelwater opwarmen tot '.sprintf("%.1f",$row['sparge_temp']).' '.DEG.'C';
208 $this->Checkline($s); 223 $this->Checkline($s);
209 $s = 'spoelwater aanzuren tot pH <= '.sprintf("%.1f",$row['sparge_ph']).' met '; 224 $s = 'spoelwater aanzuren tot pH <= '.sprintf("%.1f",$row['sparge_ph']).' met ';
210 $s .= sprintf("%.1f",$row['sparge_acid_amount']*1000).' ml. '.$acidtype[$row['sparge_acid_type']]; 225 $s .= sprintf("%.2f",$row['sparge_acid_amount']*1000*$factor).' ml. '.$acidtype[$row['sparge_acid_type']];
211 $this->Checkline($s); 226 $this->Checkline($s);
212 $spoelw = ($row['boil_size'] - $mashwater + $grainabsorbtion + $row['eq_lauter_deadspace']) * 1.03; // A small heat correction 227 $spoelw = (($row['boil_size']*$factor) - $mashwater + $grainabsorbtion + $row['eq_lauter_deadspace']) * 1.03; // A small heat correction
213 $this->Checkline('spoelen met ongeveer '.sprintf("%.1f",$spoelw).' liter spoelwater'); 228 $this->Checkline('spoelen met ongeveer '.sprintf("%.1f",$spoelw).' liter spoelwater');
214 $s = 'doelvolume in kookketel: '.sprintf("%.1f",$row['boil_size'] * 1.04).' liter ('; 229 $s = 'doelvolume in kookketel: '.sprintf("%.1f",$row['boil_size'] * $factor * 1.04).' liter (';
215 $s .= sprintf("%.1f",kettle_cm($row['boil_size'] * 1.04,$row['eq_kettle_volume'],$row['eq_kettle_height'])).' cm onder de rand)'; 230 $s .= sprintf("%.1f",kettle_cm($row['boil_size'] * $factor * 1.04,$row['eq_kettle_volume'],$row['eq_kettle_height'])).' cm onder de rand)';
216 $this->Checkline($s); 231 $this->Checkline($s);
217 $pre_sg = estimate_sg($msugars * floatval($row['efficiency']) / 100,floatval($row['boil_size'])); 232 $pre_sg = estimate_sg($msugars * floatval($row['efficiency']) / 100,floatval($row['boil_size'] * $factor));
218 $this->Checkline('doel SG in kookketel: '.density_str($pre_sg)); 233 $this->Checkline('doel SG in kookketel: '.density_str($pre_sg));
219 foreach($hops as $item2) { 234 foreach($hops as $item2) {
220 if ($item2['h_useat'] == 1) { 235 if ($item2['h_useat'] == 1) {
221 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `'; 236 $s = sprintf("%.1f",$item2['h_amount']*1000*$factor).' gr `';
222 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` toevoegen na het spoelen'; 237 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` toevoegen na het spoelen';
223 $this->Checkline($s); 238 $this->Checkline($s);
224 } 239 }
225 } 240 }
241 if ($this->Checksplit(1, $row))
242 $factor = 1;
226 if ($this->GetY() > 200) 243 if ($this->GetY() > 200)
227 $this->AddPage(); 244 $this->AddPage();
228 else 245 else
229 $this->Ln(5); 246 $this->Ln(5);
230 247
232 $this->Checkline('totale kooktijd: '.$row['boil_time'].' min.'); 249 $this->Checkline('totale kooktijd: '.$row['boil_time'].' min.');
233 for ($i = $row['boil_time']; $i >= 0; $i--) { 250 for ($i = $row['boil_time']; $i >= 0; $i--) {
234 if ($i == 10) { 251 if ($i == 10) {
235 foreach($ferms as $item1) { 252 foreach($ferms as $item1) {
236 if ($item1['f_added'] == 1) { 253 if ($item1['f_added'] == 1) {
237 $s = sprintf("%.3f",$item1['f_amount']).' kg `'; 254 $s = sprintf("%.3f",$item1['f_amount']*$factor).' kg `';
238 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` bij 10 minuten voor einde koken'; 255 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` bij 10 minuten voor einde koken';
239 $this->Checkline($s); 256 $this->Checkline($s);
240 } 257 }
241 } 258 }
242 if ($row['brew_cooling_method'] == 1) 259 if ($row['brew_cooling_method'] == 1)
243 $this->Checkline('Plaats dompelkoeler bij 10 minuten voor einde koken'); 260 $this->Checkline('Plaats dompelkoeler bij 10 minuten voor einde koken');
244 } 261 }
245 foreach($hops as $item2) { 262 foreach($hops as $item2) {
246 if (($item2['h_useat'] == 2 || $item2['h_useat'] == 3) && ($item2['h_time'] == $i)) { 263 if (($item2['h_useat'] == 2 || $item2['h_useat'] == 3) && ($item2['h_time'] == $i)) {
247 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `'; 264 $s = sprintf("%.1f",$item2['h_amount']*1000*$factor).' gr `';
248 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` bij '; 265 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` bij ';
249 if ($i > 0) 266 if ($i > 0)
250 $s .= $i.' minuten voor einde koken'; 267 $s .= $i.' minuten voor einde koken';
251 else 268 else
252 $s .= 'vlamuit'; 269 $s .= 'vlamuit';
254 } 271 }
255 } 272 }
256 foreach($miscs as $item3) { 273 foreach($miscs as $item3) {
257 if ($item3['m_use_use'] == 2 && $item3['m_time'] == $i) { 274 if ($item3['m_use_use'] == 2 && $item3['m_time'] == $i) {
258 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml "; 275 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml ";
259 $s = sprintf("%.1f",$item3['m_amount']*1000).$unit.'`'; 276 $s = sprintf("%.1f",$item3['m_amount']*1000*$factor).$unit.'`';
260 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` bij '; 277 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` bij ';
261 if ($i > 0) 278 if ($i > 0)
262 $s .= $i.' minuten voor einde koken'; 279 $s .= $i.' minuten voor einde koken';
263 else 280 else
264 $s .= 'vlamuit'; 281 $s .= 'vlamuit';
265 $this->Checkline($s); 282 $this->Checkline($s);
266 } 283 }
267 } 284 }
268 285
269 } 286 }
270 $s = 'doelvolume einde koken: '.sprintf("%.1f",$row['batch_size']*1.04).' liter ('; 287 $s = 'doelvolume einde koken: '.sprintf("%.1f",$row['batch_size']*$factor*1.04).' liter (';
271 $s .= sprintf("%.1f",kettle_cm($row['batch_size']*1.04,$row['eq_kettle_volume'],$row['eq_kettle_height'])); 288 $s .= sprintf("%.1f",kettle_cm($row['batch_size']*$factor*1.04,$row['eq_kettle_volume'],$row['eq_kettle_height']));
272 $s .= ' cm onder de rand)'; 289 $s .= ' cm onder de rand)';
273 $this->Checkline($s); 290 $this->Checkline($s);
274 $this->Checkline('doel SG einde koken: '.density_str($row['est_og'])); 291 $this->Checkline('doel SG einde koken: '.density_str($row['est_og']));
292 if ($this->Checksplit(2, $row))
293 $factor = 1;
275 if ($this->GetY() > 200) 294 if ($this->GetY() > 200)
276 $this->AddPage(); 295 $this->AddPage();
277 else 296 else
278 $this->Ln(5); 297 $this->Ln(5);
279 298
293 $s = 'Whirlpool voor '.$row['brew_whirlpool6'].' min. Temperatuur tussen 60 en 66 '.DEG.'C houden'; 312 $s = 'Whirlpool voor '.$row['brew_whirlpool6'].' min. Temperatuur tussen 60 en 66 '.DEG.'C houden';
294 $this->Checkline($s); 313 $this->Checkline($s);
295 } 314 }
296 foreach($hops as $item2) { 315 foreach($hops as $item2) {
297 if ($item2['h_useat'] == 4) { 316 if ($item2['h_useat'] == 4) {
298 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `'; 317 $s = sprintf("%.1f",$item2['h_amount']*1000*$factor).' gr `';
299 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` voor '; 318 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` voor ';
300 $s .= $item2['h_time'].' minuten in de whirlpool'; 319 $s .= $item2['h_time'].' minuten in de whirlpool';
301 $this->Checkline($s); 320 $this->Checkline($s);
302 } 321 }
303 } 322 }
310 $this->Checkheader('Koelen'); 329 $this->Checkheader('Koelen');
311 $this->Checkline('koelen tot '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C'); 330 $this->Checkline('koelen tot '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
312 } 331 }
313 $this->Checkline('gistvat ontsmetten en evt. pomp en slangen ontsmetten'); 332 $this->Checkline('gistvat ontsmetten en evt. pomp en slangen ontsmetten');
314 $this->Checkline('wort naar gistvat overbrengen'); 333 $this->Checkline('wort naar gistvat overbrengen');
315 334 if ($this->Checksplit(3, $row))
335 $factor = 1;
316 if ($this->GetY() > 240) 336 if ($this->GetY() > 240)
317 $this->AddPage(); 337 $this->AddPage();
318 else 338 else
319 $this->Ln(5); 339 $this->Ln(5);
340
320 $this->Checkheader('Gist enten'); 341 $this->Checkheader('Gist enten');
321 $dry = 0; 342 $dry = 0;
322 foreach ($yeasts as $item) { 343 foreach ($yeasts as $item) {
323 if ($item['y_use'] == 0) { // primary 344 if ($item['y_use'] == 0) { // primary
324 if ($item['y_form'] == 0) { // Liquid 345 if ($item['y_form'] == 0) { // Liquid
325 $this->Checkline($item['y_amount'].' pak '.$item['y_product_id'].', '.$item['y_name'].' gist'); 346 $this->Checkline(($item['y_amount']*$factor).' pak '.$item['y_product_id'].', '.$item['y_name'].' gist');
326 } else if ($item['y_form'] == 1 || $item['y_form'] == 6) { // Dry 347 } else if ($item['y_form'] == 1 || $item['y_form'] == 6) { // Dry
327 $s = sprintf("%.1f",$item['y_amount']*1000).' gram '.$item['y_product_id'].', '.$item['y_name']; 348 $s = sprintf("%.1f",$item['y_amount']*$factor*1000).' gram '.$item['y_product_id'].', '.$item['y_name'];
328 $s .= ' gist'; 349 $s .= ' gist';
329 $dry += $item['y_amount']*10000; 350 $dry += $item['y_amount']*$factor*10000;
330 $this->Checkline($s); 351 $this->Checkline($s);
331 } else { // Slant/Culture/Frozen/Bottle 352 } else { // Slant/Culture/Frozen/Bottle
332 $s = sprintf("%.0f",$item['y_amount']*1000).' ml '.$item['y_product_id'].', '.$item['y_name'].' gist'; 353 $s = sprintf("%.0f",$item['y_amount']*$factor*1000).' ml '.$item['y_product_id'].', '.$item['y_name'].' gist';
333 $this->Checkline($s); 354 $this->Checkline($s);
334 } 355 }
335 } 356 }
336 } 357 }
337 if ($dry > 0) { 358 if ($dry > 0) {
346 $this->Checkline('giststarter toevoegen'); 367 $this->Checkline('giststarter toevoegen');
347 else 368 else
348 $this->Checkline('gist toevoegen'); 369 $this->Checkline('gist toevoegen');
349 } 370 }
350 if ($row['brew_fermenter_extrawater'] > 0) 371 if ($row['brew_fermenter_extrawater'] > 0)
351 $this->Checkline(sprintf("%.1f", $row['brew_fermenter_extrawater']).' liter water toevoegen in gistvat'); 372 $this->Checkline(sprintf("%.1f", $row['brew_fermenter_extrawater']*$factor).' liter water toevoegen in gistvat');
352 if ($row['brew_aeration_type'] > 0) { 373 if ($row['brew_aeration_type'] > 0) {
353 $s = 'wort '.$row['brew_aeration_time'].' minuten beluchten met '; 374 $s = 'wort '.$row['brew_aeration_time'].' minuten beluchten met ';
354 $s .= ($row['brew_aeration_type'] == 1) ? "lucht":"zuurstof"; 375 $s .= ($row['brew_aeration_type'] == 1) ? "lucht":"zuurstof";
355 $this->Checkline($s); 376 $this->Checkline($s);
356 } 377 }
381 $this->Ln(5); 402 $this->Ln(5);
382 $this->Checkheader('Hoofdgisting'); 403 $this->Checkheader('Hoofdgisting');
383 } 404 }
384 foreach($ferms as $item1) { 405 foreach($ferms as $item1) {
385 if ($item1['f_added'] == 2) { 406 if ($item1['f_added'] == 2) {
386 $s = sprintf("%.3f",$item1['f_amount']).' kg `'; 407 $s = sprintf("%.3f",$item1['f_amount']*$factor).' kg `';
387 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` op dag 3 of 4 toevoegen'; 408 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` op dag 3 of 4 toevoegen';
388 $this->Checkline($s); 409 $this->Checkline($s);
389 } 410 }
390 } 411 }
391 foreach($miscs as $item3) { 412 foreach($miscs as $item3) {
392 if ($item3['m_use_use'] == 3) { 413 if ($item3['m_use_use'] == 3) {
393 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml "; 414 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml ";
394 $s = sprintf("%.1f",$item3['m_amount']*1000).$unit.'`'; 415 $s = sprintf("%.1f",$item3['m_amount']*$factor*1000).$unit.'`';
395 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` op dag 3 of 4 toevoegen'; 416 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` op dag 3 of 4 toevoegen';
396 $this->Checkline($s); 417 $this->Checkline($s);
397 } 418 }
398 } 419 }
420 if ($this->Checksplit(4, $row))
421 $factor = 1;
399 422
400 /* 423 /*
401 * During secondary fermentation: yeast 424 * During secondary fermentation: yeast
402 */ 425 */
403 $lines = 0; 426 $lines = 0;
413 $this->Checkheader('Nagisting'); 436 $this->Checkheader('Nagisting');
414 } 437 }
415 foreach ($yeasts as $item4) { 438 foreach ($yeasts as $item4) {
416 if ($item4['y_use'] == 1) { 439 if ($item4['y_use'] == 1) {
417 if ($item4['y_form'] == 0) { // Liquid 440 if ($item4['y_form'] == 0) { // Liquid
418 $this->Checkline($item4['y_amount'].' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)'); 441 $this->Checkline(($item4['y_amount']*$factor).' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)');
419 } else if ($item['y_form'] == 1) { // Dry 442 } else if ($item['y_form'] == 1) { // Dry
420 $s = sprintf("%.1f",$item4['y_amount']*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name']; 443 $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name'];
421 $s .= ' gist'; 444 $s .= ' gist';
422 $this->Checkline($s); 445 $this->Checkline($s);
423 } else { // Slant/Culture/Frozen/Bottle 446 } else { // Slant/Culture/Frozen/Bottle
424 $s = sprintf("%.0f",$item4['y_amount']*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)'; 447 $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)';
425 $this->Checkline($s); 448 $this->Checkline($s);
426 } 449 }
427 } 450 }
428 } 451 }
452 if ($this->Checksplit(5, $row))
453 $factor = 1;
429 454
430 /* 455 /*
431 * During tertiary fermentation: fermentables, hop, yeast, misc 456 * During tertiary fermentation: fermentables, hop, yeast, misc
432 */ 457 */
433 $lines = 0; 458 $lines = 0;
454 $this->Ln(5); 479 $this->Ln(5);
455 $this->Checkheader('Lagering'); 480 $this->Checkheader('Lagering');
456 } 481 }
457 foreach($ferms as $item1) { 482 foreach($ferms as $item1) {
458 if ($item1['f_added'] == 3) { 483 if ($item1['f_added'] == 3) {
459 $s = sprintf("%.3f",$item1['f_amount']).' kg `'; 484 $s = sprintf("%.3f",$item1['f_amount']*$factor).' kg `';
460 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` toevoegen'; 485 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` toevoegen';
461 $this->Checkline($s); 486 $this->Checkline($s);
462 } 487 }
463 } 488 }
464 foreach($hops as $item2) { 489 foreach($hops as $item2) {
465 if ($item2['h_useat'] == 5) { 490 if ($item2['h_useat'] == 5) {
466 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `'; 491 $s = sprintf("%.1f",$item2['h_amount']*$factor*1000).' gr `';
467 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` voor '; 492 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` voor ';
468 $s .= sprintf("%.0f",$item2['h_time']/1440).' dagen toevoegen'; 493 $s .= sprintf("%.0f",$item2['h_time']/1440).' dagen toevoegen';
469 $this->Checkline($s); 494 $this->Checkline($s);
470 } 495 }
471 } 496 }
472 foreach ($yeasts as $item4) { 497 foreach ($yeasts as $item4) {
473 if ($item4['y_use'] == 2) { 498 if ($item4['y_use'] == 2) {
474 if ($item4['y_form'] == 0) { // Liquid 499 if ($item4['y_form'] == 0) { // Liquid
475 $s = $item4['y_amount'].' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)'; 500 $s = ($item4['y_amount']*$factor).' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)';
476 } else if ($item4['y_form'] == 1) { // Dry 501 } else if ($item4['y_form'] == 1) { // Dry
477 $s = sprintf("%.1f",$item4['y_amount']*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name']; 502 $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name'];
478 $s .= ' gist'; 503 $s .= ' gist';
479 } else { // Slant/Culture/Frozen/Bottle 504 } else { // Slant/Culture/Frozen/Bottle
480 $s = sprintf("%.0f",$item4['y_amount']*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name']; 505 $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'];
481 $s .= ' gist (eventueel met starter)'; 506 $s .= ' gist (eventueel met starter)';
482 } 507 }
483 $this->Checkline($s); 508 $this->Checkline($s);
484 } 509 }
485 } 510 }
486 foreach($miscs as $item3) { 511 foreach($miscs as $item3) {
487 if ($item3['m_use_use'] == 4) { 512 if ($item3['m_use_use'] == 4) {
488 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml "; 513 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml ";
489 $s = sprintf("%.1f",$item3['m_amount']*1000).$unit.'`'; 514 $s = sprintf("%.1f",$item3['m_amount']*$factor*1000).$unit.'`';
490 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` voor '; 515 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` voor ';
491 $s .= sprintf("%.0f",$item3['m_time']/1440).' dagen toevoegen'; 516 $s .= sprintf("%.0f",$item3['m_time']/1440).' dagen toevoegen';
492 $this->Checkline($s); 517 $this->Checkline($s);
493 } 518 }
494 } 519 }
520 if ($this->Checksplit(6, $row))
521 $factor = 1;
495 522
496 /* 523 /*
497 * During packaging: fermentables, yeast, misc 524 * During packaging: fermentables, yeast, misc
498 */ 525 */
499 $lines = 0; 526 $lines = 0;
518 $this->Ln(5); 545 $this->Ln(5);
519 $this->Checkheader('Verpakken'); 546 $this->Checkheader('Verpakken');
520 } 547 }
521 foreach($ferms as $item1) { 548 foreach($ferms as $item1) {
522 if ($item1['f_added'] == 4) { 549 if ($item1['f_added'] == 4) {
523 $s = sprintf("%.3f",$item1['f_amount']).' kg `'; 550 $s = sprintf("%.3f",$item1['f_amount']*$factor).' kg `';
524 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'`'; 551 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'`';
525 if ($row['bottle_priming_water'] > 0) 552 if ($row['bottle_priming_water'] > 0)
526 $s .= ' met '.sprintf("%.3f",$row['bottle_priming_water']).' liter water'; 553 $s .= ' met '.sprintf("%.3f",$row['bottle_priming_water']*$factor).' liter water';
527 $s .= ' bij bottelen'; 554 $s .= ' bij bottelen';
528 $this->Checkline($s); 555 $this->Checkline($s);
529 } 556 }
530 if ($item1['f_added'] == 5) { 557 if ($item1['f_added'] == 5) {
531 $s = sprintf("%.3f",$item1['f_amount']).' kg `'; 558 $s = sprintf("%.3f",$item1['f_amount']*$factor).' kg `';
532 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'`'; 559 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'`';
533 if ($row['keg_priming_water'] > 0) 560 if ($row['keg_priming_water'] > 0)
534 $s .= ' met '.sprintf("%.3f",$row['keg_priming_water']).' liter water'; 561 $s .= ' met '.sprintf("%.3f",$row['keg_priming_water']*$factor).' liter water';
535 $s .= ' bij op fust zetten'; 562 $s .= ' bij op fust zetten';
536 $this->Checkline($s); 563 $this->Checkline($s);
537 } 564 }
538 } 565 }
539 foreach ($yeasts as $item4) { 566 foreach ($yeasts as $item4) {
540 if ($item4['y_use'] == 3) { 567 if ($item4['y_use'] == 3) {
541 if ($item4['y_form'] == 0) { // Liquid 568 if ($item4['y_form'] == 0) { // Liquid
542 $s = '`'.$item4['y_product_id'].', '.$item4['y_name']; 569 $s = '`'.$item4['y_product_id'].', '.$item4['y_name'];
543 } else if ($item4['y_form'] == 1) { // Dry 570 } else if ($item4['y_form'] == 1) { // Dry
544 $s = sprintf("%.1f",$item4['y_amount']*1000).' gram `'.$item4['y_product_id'].', '.$item4['y_name']; 571 $s = sprintf("%.1f",$item4['y_amount']*$factor*1000).' gram `'.$item4['y_product_id'].', '.$item4['y_name'];
545 } else { // Slant/Culture/Frozen/Bottle 572 } else { // Slant/Culture/Frozen/Bottle
546 $s = sprintf("%.0f",$item4['y_amount']*1000).' ml `'.$item4['y_product_id'].', '.$item4['y_name']; 573 $s = sprintf("%.0f",$item4['y_amount']*$factor*1000).' ml `'.$item4['y_product_id'].', '.$item4['y_name'];
547 } 574 }
548 $s .= '` als bottelgist'; 575 $s .= '` als bottelgist';
549 $this->Checkline($s); 576 $this->Checkline($s);
550 } 577 }
551 } 578 }
552 foreach($miscs as $item3) { 579 foreach($miscs as $item3) {
553 if ($item3['m_use_use'] == 5) { 580 if ($item3['m_use_use'] == 5) {
554 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml "; 581 $unit = ($item3['m_amount_is_weight']) ? " gr ":" ml ";
555 $s = sprintf("%.1f",$item3['m_amount']*1000).$unit.'`'; 582 $s = sprintf("%.1f",$item3['m_amount']*$factor*1000).$unit.'`';
556 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` bij bottelen toevoegen'; 583 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` bij bottelen toevoegen';
557 $this->Checkline($s); 584 $this->Checkline($s);
558 } 585 }
559 } 586 }
560 } 587 }
561
562 } 588 }
563 589
564 590
565 591
566 class PDF extends PDF_MySQL_Table { 592 class PDF extends PDF_MySQL_Table {
567 function Header() { 593 function Header() {
568 global $row; 594 global $row;
569 global $prdate; 595 global $prdate;
570 $stage = array( 'Plan', 'Wacht', 'Brouwen', 'Hoofdgisting', 'Nagisting', 'Lagering', 'Afvullen', 'Hergisten', 'Rijpen', 'Proeven', 'Gereed', 'Afgesloten' ); 596 global $stage;
571 $this->Image('images/logo.png',10,10,30); 597 $this->Image('images/logo.png',10,10,30);
572 // Title 598 // Title
573 $this->SetFont('Helvetica','B',18); 599 $this->SetFont('Helvetica','B',18);
574 $this->SetX(45); 600 $this->SetX(45);
575 $this->Cell(0,8,$row['code'].' '.$row['name'],0,1,'L'); 601 $this->Cell(0,8,$row['code'].' '.$row['name'],0,1,'L');
582 $this->Cell(17,5,'Stijl:',0,0,'L'); 608 $this->Cell(17,5,'Stijl:',0,0,'L');
583 $this->Cell(0,5,$row['st_name'],0,1,'L'); 609 $this->Cell(0,5,$row['st_name'],0,1,'L');
584 $this->SetX(45); 610 $this->SetX(45);
585 $this->Cell(17,5,'Fase:',0,0,'L'); 611 $this->Cell(17,5,'Fase:',0,0,'L');
586 $this->Cell(0,5,$stage[$row['stage']],0,1,'L'); 612 $this->Cell(0,5,$stage[$row['stage']],0,1,'L');
587 $this->Ln(6); 613 $this->SetX(45);
614 $this->Cell(17,5,'Batch:',0,0,'L');
615 if ($row['divide_parts'] == 0)
616 $this->Cell(0,5,"Niet gespitst",0,1,'L');
617 else
618 $this->Cell(0,5,"Split batch ".($row['divide_part'] + 1)." van ".($row['divide_parts'] + 1),0,1,'L');
619 $this->Ln(2);
588 // Ensure table header is printed 620 // Ensure table header is printed
589 parent::Header(); 621 parent::Header();
590 } 622 }
591 } 623 }
592 624

mercurial