www/rec_print.php

changeset 392
544d7d0183b2
parent 338
a51b858aacca
child 396
804800d8e885
equal deleted inserted replaced
391:a1bcebc61ddd 392:544d7d0183b2
86 $this->Cell(35,5,'Kooktijd',0,0,'L',true); 86 $this->Cell(35,5,'Kooktijd',0,0,'L',true);
87 $this->Cell(25,5,$row['boil_time'].' minuten',0,0,'L',true); 87 $this->Cell(25,5,$row['boil_time'].' minuten',0,0,'L',true);
88 $this->Cell($vul,5,'',0,0,'L',false); 88 $this->Cell($vul,5,'',0,0,'L',false);
89 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true); 89 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true);
90 $this->Cell(25,5,$row['efficiency'].' %',0,0,'L',true); 90 $this->Cell(25,5,$row['efficiency'].' %',0,0,'L',true);
91 $this->Ln(10); 91 $this->Ln();
92 92
93 $this->cMargin=$cMargin; 93 $this->cMargin=$cMargin;
94 } 94 }
95 95
96 function TableFermentables($row) { 96 function TableFermentables($row) {
98 global $total_fermentables; 98 global $total_fermentables;
99 global $pSugar; 99 global $pSugar;
100 global $pCara; 100 global $pCara;
101 global $colorw; 101 global $colorw;
102 global $preboil_sg; 102 global $preboil_sg;
103 $added = array( 'Maischen', 'Koken', 'Vergisten', 'Nagisten/lageren', 'Bottelen' ); 103 $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen' );
104 $vul = $this->w - $this->rMargin - $this->lMargin - 132; 104 $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' );
105 $this->AddCol($vul,'Grondstof','L'); 105 $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geƫeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' );
106 $this->AddCol(30,'Leverancier','L'); 106 $vul = $this->w - $this->rMargin - $this->lMargin - 125;
107 $this->AddCol(15,'EBC','R'); 107 $this->Ln();
108 $this->AddCol(17,'Moment','L'); 108 $this->AddCol($vul,'Mout, granen en suikers','L');
109 $this->AddCol(20,'Kg','R');
110 $this->AddCol(15,'Procent','R'); 109 $this->AddCol(15,'Procent','R');
111 $this->AddCol(15,'Opbr.','R'); 110 $this->AddCol(15,'Opbr.','R');
111 $this->AddCol(25,'Soort', 'L');
112 $this->AddCol(30,'Gebruik moment','L');
113 $this->AddCol(20,'Hoeveel','R');
112 $this->AddCol(20,'Prijs','R'); 114 $this->AddCol(20,'Prijs','R');
113 115
114 $cMargin=$this->cMargin; 116 $cMargin=$this->cMargin;
115 $this->cMargin=2; 117 $this->cMargin=2;
116 $this->TableX=$this->lMargin; 118 $this->TableX=$this->lMargin;
135 if ($item['f_type'] == 1) // Sugar 137 if ($item['f_type'] == 1) // Sugar
136 $pSugar += $percent; 138 $pSugar += $percent;
137 if ($item['f_graintype'] == 2) // Crystal 139 if ($item['f_graintype'] == 2) // Crystal
138 $pCara += $percent; 140 $pCara += $percent;
139 141
142 if ($item['f_type'] == 0)
143 $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]);
144 else
145 $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]);
146
140 $cost = $amount * $costkg; 147 $cost = $amount * $costkg;
141 $cost_fermentables += $cost; 148 $cost_fermentables += $cost;
142 $total_fermentables += $amount; 149 $total_fermentables += $amount;
143 /* Calculate the amount of sugars */ 150 /* Calculate the amount of sugars */
144 $d = $amount * ($yield / 100) * (1 - $moisture / 100); 151 $d = $amount * ($yield / 100) * (1 - $moisture / 100);
147 $sugarsm += $d; 154 $sugarsm += $d;
148 } 155 }
149 $sugarsf += $d; 156 $sugarsf += $d;
150 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436; 157 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
151 158
152 $this->Cell($vul,5,$name,0,0,'L',true); 159 if ($amount > 100)
153 $this->Cell(30,5,$supplier,0,0,'L',true); 160 $amount = sprintf("%.1f",$amount).' kg';
154 $this->Cell(15,5,sprintf("%.0f",$color),0,0,'R',true); 161 else if ($amount > 10)
155 $this->Cell(17,5,$added[$item['f_added']],0,0,'L',true); 162 $amount = sprintf("%.2f",$amount).' kg';
156 $this->Cell(20,5,sprintf("%8.3f",$amount),0,0,'R',true); 163 else
164 $amount = sprintf("%.0f",$amount * 1000).' gr';
165 $this->Cell($vul,5,$name.' ('.$supplier.') '.sprintf("%.0f",$color).' EBC',0,0,'L',true);
157 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true); 166 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true);
158 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true); 167 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true);
159 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); 168 $this->Cell(25,5,$soort,0,0,'L',true);
169 $this->Cell(30,5,$added[$item['f_added']],0,0,'L',true);
170 $this->Cell(20,5,$amount,0,0,'R',true);
171 $this->Cell(20,5,sprintf("%.3f",$cost).EURO,0,0,'R',true);
160 $this->Ln(); 172 $this->Ln();
161 } 173 }
162 174
163 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size'])); 175 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size']));
164 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size'])); 176 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
165 $this->SetFillColor(210,245,255); 177 $this->SetFillColor(210,245,255);
166 $this->Cell($vul+62,5,'',0,0,'L',false); 178 $this->Cell($vul+105,5,'',0,0,'L',false);
167 $this->Cell(20,5,sprintf("%8.3f",$total_fermentables),0,0,'R',true); 179 $this->Cell(20,5,sprintf("%.3f",$cost_fermentables).EURO,0,0,'R',true);
168 $this->Cell(30,5,'',0,0,'L',false);
169 $this->Cell(20,5,sprintf("%8.3f",$cost_fermentables).EURO,0,0,'R',true);
170 $this->Ln(10);
171 $this->ProcessingTable=false; 180 $this->ProcessingTable=false;
172 $this->cMargin=$cMargin; 181 $this->cMargin=$cMargin;
173 $this->aCols=array(); 182 $this->aCols=array();
183 $this->Ln();
174 } 184 }
175 185
176 function TableHops($row) { 186 function TableHops($row) {
177 global $total_hops; 187 global $total_hops;
178 global $total_ibus; 188 global $total_ibus;
179 global $cost_hops; 189 global $cost_hops;
180 global $preboil_sg; 190 global $preboil_sg;
181 // $hoptype = array( 'Bitterhop', 'Aromahop', 'Beide' );
182 $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat' ); 191 $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat' );
183 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' ); 192 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' );
184 $vul = $this->w - $this->rMargin - $this->lMargin - 135; 193 $vul = $this->w - $this->rMargin - $this->lMargin - 122;
194 $this->Ln();
185 $this->AddCol($vul,'Hop','L'); 195 $this->AddCol($vul,'Hop','L');
186 $this->AddCol(35,'Land','L');
187 $this->AddCol(15,'Soort','L');
188 $this->AddCol(20,'Moment','L');
189 $this->AddCol(15,'Alpha','R'); 196 $this->AddCol(15,'Alpha','R');
190 $this->AddCol(12,'IBU','R'); 197 $this->AddCol(12,'IBU','R');
191 $this->AddCol(18,'Gram','R'); 198 $this->AddCol(25,'Soort','L');
199 $this->AddCol(30,'Gebruik moment','L');
200 $this->AddCol(20,'Hoeveel','R');
192 $this->AddCol(20,'Prijs','R'); 201 $this->AddCol(20,'Prijs','R');
193 202
194 $cMargin=$this->cMargin; 203 $cMargin=$this->cMargin;
195 $this->cMargin=2; 204 $this->cMargin=2;
196 $this->TableX=$this->lMargin; 205 $this->TableX=$this->lMargin;
202 211
203 $arr = json_decode($row['json_hops'], true); 212 $arr = json_decode($row['json_hops'], true);
204 foreach($arr as $item) { //foreach element in $arr 213 foreach($arr as $item) { //foreach element in $arr
205 $name = iconv('UTF-8','windows-1252',$item['h_name']); 214 $name = iconv('UTF-8','windows-1252',$item['h_name']);
206 $origin = iconv('UTF-8','windows-1252',$item['h_origin']); 215 $origin = iconv('UTF-8','windows-1252',$item['h_origin']);
207 $amount = floatval($item['h_amount']) * 1000; 216 $amount = floatval($item['h_amount']);
208 $mass = $amount; 217 $mass = $amount * 1000;
209 $costkg = floatval($item['h_cost']); 218 $costkg = floatval($item['h_cost']);
210 $time = floatval($item['h_time']); 219 $time = floatval($item['h_time']);
211 $alpha = floatval($item['h_alpha']); 220 $alpha = floatval($item['h_alpha']);
212 221
213 $cost = ($amount * $costkg) / 1000; 222 $cost = ($amount * $costkg);
214 $cost_hops += $cost; 223 $cost_hops += $cost;
215 $total_hops += $amount; 224 $total_hops += $amount;
216 225
217 $moment = $hopuse[$item['h_useat']]; 226 $moment = $hopuse[$item['h_useat']];
218 if ($item['h_useat'] == 2) { // Boil 227 if ($item['h_useat'] == 2) { // Boil
219 $moment = "Kook@".$time; 228 $moment = "Koken ".$time." min";
229 } else if ($item['h_useat'] == 5) { // Dryhop
230 $moment = 'Koudhop '.sprintf("%.0f", $time / 1440).' dagen';
220 } 231 }
221 $ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']); 232 $ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']);
222 $total_ibus += $ibu; 233 $total_ibus += $ibu;
223 234
224 $this->Cell($vul,5,$name,0,0,'L',true); 235 if ($amount > 1)
225 $this->Cell(35,5,$origin,0,0,'L',true); 236 $amount = sprintf("%.3f",$amount).' kg';
226 $this->Cell(15,5,$hopform[$item['h_form']],0,0,'L',true); 237 else
227 $this->Cell(20,5,$moment,0,0,'L',true); 238 $amount = sprintf("%.1f",$amount * 1000).' gr';
239
240 $this->Cell($vul,5,$name.' ('.$origin.')',0,0,'L',true);
228 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true); 241 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true);
229 $this->Cell(12,5,sprintf("%.1f",$ibu),0,0,'R',true); 242 $this->Cell(12,5,sprintf("%.1f",$ibu),0,0,'R',true);
230 $this->Cell(18,5,sprintf("%.1f",$amount),0,0,'R',true); 243 $this->Cell(25,5,$hopform[$item['h_form']],0,0,'L',true);
231 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); 244 $this->Cell(30,5,$moment,0,0,'L',true);
245 $this->Cell(20,5,$amount,0,0,'R',true);
246 $this->Cell(20,5,sprintf("%.3f",$cost).EURO,0,0,'R',true);
232 $this->Ln(); 247 $this->Ln();
233 } 248 }
234 249
235 $this->SetFillColor(210,245,255); 250 $this->SetFillColor(210,245,255);
236 $this->Cell($vul+85,5,'',0,0,'L',false); 251 $this->Cell($vul+102,5,'',0,0,'L',false);
237 $this->Cell(12,5,sprintf("%.1f",$total_ibus),0,0,'R',true); 252 $this->Cell(20,5,sprintf("%.3f",$cost_hops).EURO,0,0,'R',true);
238 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true);
239 $this->Cell(20,5,sprintf("%8.3f",$cost_hops).EURO,0,0,'R',true);
240 $this->Ln(10);
241 $this->ProcessingTable=false; 253 $this->ProcessingTable=false;
242 $this->cMargin=$cMargin; 254 $this->cMargin=$cMargin;
243 $this->aCols=array(); 255 $this->aCols=array();
256 $this->Ln();
244 } 257 }
245 258
246 function TableYeasts($row) { 259 function TableYeasts($row) {
247 global $cost_yeasts; 260 global $cost_yeasts;
248 global $svg; 261 global $svg;
249 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); 262 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' );
250 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); 263 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' );
251 $vul = $this->w - $this->rMargin - $this->lMargin - 140; 264 $vul = $this->w - $this->rMargin - $this->lMargin - 110;
252 $this->AddCol(27,'Laboratorium','L'); 265 $this->Ln();
253 $this->AddCol(18,'Product','L');
254 $this->AddCol($vul,'Gist','L'); 266 $this->AddCol($vul,'Gist','L');
255 $this->AddCol(20,'Gebruik','L');
256 $this->AddCol(15,'Attn','R'); 267 $this->AddCol(15,'Attn','R');
257 $this->AddCol(22,'Vorm','L'); 268 $this->AddCol(25,'Soort','L');
258 $this->AddCol(18,'Hoeveel','R'); 269 $this->AddCol(30,'Gebruik moment','L');
270 $this->AddCol(20,'Hoeveel','R');
259 $this->AddCol(20,'Prijs','R'); 271 $this->AddCol(20,'Prijs','R');
260 272
261 $cMargin=$this->cMargin; 273 $cMargin=$this->cMargin;
262 $this->cMargin=2; 274 $this->cMargin=2;
263 $this->TableX=$this->lMargin; 275 $this->TableX=$this->lMargin;
283 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak"; 295 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
284 else if ($item['y_form'] == 1) // Dry 296 else if ($item['y_form'] == 1) // Dry
285 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr"; 297 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
286 else 298 else
287 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml"; 299 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
288 $this->Cell(27,5,$laboratory,0,0,'L',true); 300 $this->Cell($vul,5,$laboratory.' '.$product_id.' ('.$name.')',0,0,'L',true);
289 $this->Cell(18,5,$product_id,0,0,'L',true);
290 $this->Cell($vul,5,$name,0,0,'L',true);
291 $this->Cell(20,5,$yeastuse[$item['y_use']],0,0,'L',true);
292 $this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true); 301 $this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true);
293 $this->Cell(22,5,$yeastform[$item['y_form']],0,0,'L',true); 302 $this->Cell(25,5,$yeastform[$item['y_form']],0,0,'L',true);
294 $this->Cell(18,5,$amount,0,0,'R',true); 303 $this->Cell(30,5,$yeastuse[$item['y_use']],0,0,'L',true);
304 $this->Cell(20,5,$amount,0,0,'R',true);
295 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); 305 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
296 $this->Ln(); 306 $this->Ln();
297 } 307 }
298 308
299 $this->SetFillColor(210,245,255); 309 $this->SetFillColor(210,245,255);
300 $this->Cell($vul+120,5,'',0,0,'L',false); 310 $this->Cell($vul+90,5,'',0,0,'L',false);
301 $this->Cell(20,5,sprintf("%8.3f",$cost_yeasts).EURO,0,0,'R',true); 311 $this->Cell(20,5,sprintf("%8.3f",$cost_yeasts).EURO,0,0,'R',true);
302 $this->Ln(10);
303 $this->ProcessingTable=false; 312 $this->ProcessingTable=false;
304 $this->cMargin=$cMargin; 313 $this->cMargin=$cMargin;
305 $this->aCols=array(); 314 $this->aCols=array();
315 $this->Ln();
306 } 316 }
307 317
308 function TableMiscs($row) { 318 function TableMiscs($row) {
309 global $cost_miscs; 319 global $cost_miscs;
310 $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); 320 $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' );
311 $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' ); 321 $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' );
312 $vul = $this->w - $this->rMargin - $this->lMargin - 100; 322 $vul = $this->w - $this->rMargin - $this->lMargin - 95;
323 if ($this->GetY() > 200)
324 $this->AddPage();
325 else
326 $this->Ln();
313 $this->AddCol($vul,'Naam','L'); 327 $this->AddCol($vul,'Naam','L');
314 $this->AddCol(30,'Soort','L'); 328 $this->AddCol(25,'Soort','L');
315 $this->AddCol(30,'Gebruik','L'); 329 $this->AddCol(30,'Gebruik moment','L');
316 $this->AddCol(20,'Hoeveel','R'); 330 $this->AddCol(20,'Hoeveel','R');
317 $this->AddCol(20,'Prijs','R'); 331 $this->AddCol(20,'Prijs','R');
318 332
319 $cMargin=$this->cMargin; 333 $cMargin=$this->cMargin;
320 $this->cMargin=2; 334 $this->cMargin=2;
351 else 365 else
352 $gebruik = $miscuse[$use_use]; 366 $gebruik = $miscuse[$use_use];
353 367
354 $hoeveel = sprintf("%.1f %s",$amount,$aiw ? "gr":"ml"); 368 $hoeveel = sprintf("%.1f %s",$amount,$aiw ? "gr":"ml");
355 $this->Cell($vul,5,$name,0,0,'L',true); 369 $this->Cell($vul,5,$name,0,0,'L',true);
356 $this->Cell(30,5,$misctype[$type],0,0,'L',true); 370 $this->Cell(25,5,$misctype[$type],0,0,'L',true);
357 $this->Cell(30,5,$gebruik,0,0,'L',true); 371 $this->Cell(30,5,$gebruik,0,0,'L',true);
358 $this->Cell(20,5,$hoeveel,0,0,'R',true); 372 $this->Cell(20,5,$hoeveel,0,0,'R',true);
359 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); 373 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
360 $this->Ln(); 374 $this->Ln();
361 } 375 }
362 376
363 $this->SetFillColor(210,245,255); 377 $this->SetFillColor(210,245,255);
364 $this->Cell($vul+80,5,'',0,0,'L',false); 378 $this->Cell($vul+75,5,'',0,0,'L',false);
365 $this->Cell(20,5,sprintf("%8.3f",$cost_miscs).EURO,0,0,'R',true); 379 $this->Cell(20,5,sprintf("%8.3f",$cost_miscs).EURO,0,0,'R',true);
366 $this->Ln(10);
367 380
368 $this->ProcessingTable=false; 381 $this->ProcessingTable=false;
369 $this->cMargin=$cMargin; 382 $this->cMargin=$cMargin;
370 $this->aCols=array(); 383 $this->aCols=array();
371 } 384 $this->Ln();
372 385 }
373 // Watercolor $this->SetFillColor(120,255,250); 386
387 function TableMashs($row) {
388 global $cost_yeasts;
389 global $svg;
390 global $mashkg;
391 $mashtype = array( 'Infusie', 'Verwarming', 'Decoctie' );
392 $vul = $this->w - $this->rMargin - $this->lMargin - 137;
393 if ($this->GetY() > 250)
394 $this->AddPage();
395 else
396 $this->Ln();
397 $this->AddCol($vul,'Maisch stap naam','L');
398 $this->AddCol(25,'Stap type','L');
399 $this->AddCol(18,'Start '.DEG.'C','R');
400 $this->AddCol(18,'Eind '.DEG.'C','R');
401 $this->AddCol(18,'Rust min','R');
402 $this->AddCol(18,'Stap min','R');
403 $this->AddCol(20,'L/Kg','R');
404 $this->AddCol(20,'Infusie L','R');
405
406 $cMargin=$this->cMargin;
407 $this->cMargin=2;
408 $this->TableX=$this->lMargin;
409 $this->TableHeader();
410 $this->ProcessingTable=true;
411
412 $this->SetFont('Helvetica','',9);
413 $this->SetFillColor(175, 175, 255);
414
415 $vol = 0;
416 $arr = json_decode($row['json_mashs'], true);
417 foreach($arr as $item) { //foreach element in $arr
418
419 if ($item['step_type'] == 0)
420 $vol += $item['step_infuse_amount'];
421 if ($mashkg > 0)
422 $thick = $vol / $mashkg;
423 else
424 $thick = 0;
425 $this->Cell($vul,5,$item['step_name'],0,0,'L',true);
426 $this->Cell(25,5,$mashtype[$item['step_type']],0,0,'L',true);
427 $this->Cell(18,5,sprintf("%.1f",$item['step_temp']),0,0,'R',true);
428 $this->Cell(18,5,sprintf("%.1f",$item['end_temp']),0,0,'R',true);
429 $this->Cell(18,5,sprintf("%.0f",$item['step_time']),0,0,'R',true);
430 $this->Cell(18,5,sprintf("%.0f",$item['ramp_time']),0,0,'R',true);
431 $this->Cell(20,5,sprintf("%.2f",$thick),0,0,'R',true);
432 $this->Cell(20,5,sprintf("%.1f",$item['step_infuse_amount']),0,0,'R',true);
433 $this->Ln();
434 }
435 $this->ProcessingTable=false;
436 $this->cMargin=$cMargin;
437 $this->aCols=array();
438 $this->Ln();
439 }
440
441 function TableWaters($row) {
442
443 $vul = $this->w - $this->rMargin - $this->lMargin - 137;
444 if ($this->GetY() > 250)
445 $this->AddPage();
446 else
447 $this->Ln();
448 $this->AddCol($vul,'Water bron','L');
449 $this->AddCol(20,'Volume','R');
450 $this->AddCol(15,'Ca','R');
451 $this->AddCol(15,'Mg','R');
452 $this->AddCol(15,'Na','R');
453 $this->AddCol(15,'CaCO3','R');
454 $this->AddCol(15,'Cl','R');
455 $this->AddCol(15,'SO4','R');
456 $this->AddCol(15,'pH','R');
457
458 $cMargin=$this->cMargin;
459 $this->cMargin=2;
460 $this->TableX=$this->lMargin;
461 $this->TableHeader();
462 $this->ProcessingTable=true;
463
464 $this->SetFont('Helvetica','',9);
465 $this->SetFillColor(120, 255, 250);
466
467 $this->Cell($vul,5,$row['w1_name'],0,0,'L',true);
468 $this->Cell(20,5,sprintf("%.1f", $row['w1_amount']).' L',0,0,'R',true);
469 $this->Cell(15,5,sprintf("%.1f", $row['w1_calcium']),0,0,'R',true);
470 $this->Cell(15,5,sprintf("%.1f", $row['w1_magnesium']),0,0,'R',true);
471 $this->Cell(15,5,sprintf("%.1f", $row['w1_sodium']),0,0,'R',true);
472 $this->Cell(15,5,sprintf("%.1f", $row['w1_total_alkalinity']),0,0,'R',true);
473 $this->Cell(15,5,sprintf("%.1f", $row['w1_chloride']),0,0,'R',true);
474 $this->Cell(15,5,sprintf("%.1f", $row['w1_sulfate']),0,0,'R',true);
475 $this->Cell(15,5,sprintf("%.1f", $row['w1_ph']),0,0,'R',true);
476 $this->Ln();
477 $this->Cell($vul,5,$row['w2_name'],0,0,'L',true);
478 $this->Cell(20,5,sprintf("%.1f", $row['w2_amount']).' L',0,0,'R',true);
479 $this->Cell(15,5,sprintf("%.1f", $row['w2_calcium']),0,0,'R',true);
480 $this->Cell(15,5,sprintf("%.1f", $row['w2_magnesium']),0,0,'R',true);
481 $this->Cell(15,5,sprintf("%.1f", $row['w2_sodium']),0,0,'R',true);
482 $this->Cell(15,5,sprintf("%.1f", $row['w2_total_alkalinity']),0,0,'R',true);
483 $this->Cell(15,5,sprintf("%.1f", $row['w2_chloride']),0,0,'R',true);
484 $this->Cell(15,5,sprintf("%.1f", $row['w2_sulfate']),0,0,'R',true);
485 $this->Cell(15,5,sprintf("%.1f", $row['w2_ph']),0,0,'R',true);
486 $this->Ln();
487 $this->Cell($vul,5,'Gemengd water',0,0,'L',true);
488 $this->Cell(20,5,sprintf("%.1f", $row['wg_amount']).' L',0,0,'R',true);
489 $this->Cell(15,5,sprintf("%.1f", $row['wg_calcium']),0,0,'R',true);
490 $this->Cell(15,5,sprintf("%.1f", $row['wg_magnesium']),0,0,'R',true);
491 $this->Cell(15,5,sprintf("%.1f", $row['wg_sodium']),0,0,'R',true);
492 $this->Cell(15,5,sprintf("%.1f", $row['wg_total_alkalinity']),0,0,'R',true);
493 $this->Cell(15,5,sprintf("%.1f", $row['wg_chloride']),0,0,'R',true);
494 $this->Cell(15,5,sprintf("%.1f", $row['wg_sulfate']),0,0,'R',true);
495 $this->Cell(15,5,sprintf("%.1f", $row['wg_ph']),0,0,'R',true);
496 $this->Ln();
497 $this->Cell($vul,5,'Behandeld water',0,0,'L',true);
498 $this->Cell(20,5,'',0,0,'R',true);
499 $this->Cell(15,5,sprintf("%.1f", $row['wb_calcium']),0,0,'R',true);
500 $this->Cell(15,5,sprintf("%.1f", $row['wb_magnesium']),0,0,'R',true);
501 $this->Cell(15,5,sprintf("%.1f", $row['wb_sodium']),0,0,'R',true);
502 $this->Cell(15,5,sprintf("%.1f", $row['wb_total_alkalinity']),0,0,'R',true);
503 $this->Cell(15,5,sprintf("%.1f", $row['wb_chloride']),0,0,'R',true);
504 $this->Cell(15,5,sprintf("%.1f", $row['wb_sulfate']),0,0,'R',true);
505 $this->Cell(15,5,sprintf("%.1f", $row['wb_ph']),0,0,'R',true);
506 $this->ProcessingTable=false;
507 $this->cMargin=$cMargin;
508 $this->aCols=array();
509 $this->Ln();
510 }
374 511
375 function TableSummary($row) { 512 function TableSummary($row) {
376 global $pSugar; 513 global $pSugar;
377 global $pCara; 514 global $pCara;
378 global $svg; 515 global $svg;
382 global $cost_miscs; 519 global $cost_miscs;
383 global $cost_yeasts; 520 global $cost_yeasts;
384 $colormethod = array( 'Morey', 'Mosher', 'Daniels' ); 521 $colormethod = array( 'Morey', 'Mosher', 'Daniels' );
385 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' ); 522 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' );
386 /* 2 Columns */ 523 /* 2 Columns */
524 if ($this->GetY() > 200)
525 $this->AddPage();
526 else
527 $this->Ln();
387 $vul = $this->w - $this->rMargin - $this->lMargin - 170; 528 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
388 $cMargin=$this->cMargin; 529 $cMargin=$this->cMargin;
389 $this->cMargin=2; 530 $this->cMargin=2;
390 $this->TableX=$this->lMargin; 531 $this->TableX=$this->lMargin;
391 $this->SetFont('Helvetica','B',9); 532 $this->SetFont('Helvetica','B',9);
440 $this->SetX($this->TableX); 581 $this->SetX($this->TableX);
441 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts; 582 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
442 $this->Cell(35,5,'Kosten',0,0,'L',true); 583 $this->Cell(35,5,'Kosten',0,0,'L',true);
443 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true); 584 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true);
444 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true); 585 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true);
445 $this->Ln(10); 586
446 587 // calorieen
447 588 $this->ProcessingTable=false;
448 // Kostprijs per liter, calorieren 589 $this->cMargin=$cMargin;
449 $this->cMargin=$cMargin; 590 $this->aCols=array();
591 $this->Ln();
450 } 592 }
451 } 593 }
452 594
453 595
454 596
484 $pdf->TableGlobal($row); 626 $pdf->TableGlobal($row);
485 $pdf->TableFermentables($row); 627 $pdf->TableFermentables($row);
486 $pdf->TableHops($row); 628 $pdf->TableHops($row);
487 $pdf->TableYeasts($row); 629 $pdf->TableYeasts($row);
488 $pdf->TableMiscs($row); 630 $pdf->TableMiscs($row);
631 $pdf->TableMashs($row);
632 $pdf->TableWaters($row);
489 $pdf->TableSummary($row); 633 $pdf->TableSummary($row);
490 if (strlen($row['notes'])) { 634 if (strlen($row['notes'])) {
635 if ($pdf->GetY() > 200)
636 $pdf->AddPage();
637 else
638 $pdf->Ln(10);
491 $pdf->SetFillColor(255,150,100); 639 $pdf->SetFillColor(255,150,100);
640 $pdf->SetFont('Helvetica','B',9);
492 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true); 641 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
493 $pdf->Ln(); 642 $pdf->Ln();
643 $pdf->SetFont('Helvetica','',9);
494 $pdf->SetFillColor(210,245,255); 644 $pdf->SetFillColor(210,245,255);
495 $pdf->MultiCell(0,4,$row['notes'],0,'L',true); 645 $pdf->MultiCell(0,4,$row['notes'],0,'L',true);
496 } 646 }
497 // Disclaimer toevoegen dat dit alleen recept ontwikkeling is. Uitkomsten zoals IBU zijn een berekende schatting. 647 // Disclaimer toevoegen dat dit alleen recept ontwikkeling is. Uitkomsten zoals IBU zijn een berekende schatting.
498 // Footer sectie met berekende/geschatte uitkomsten zoals ABV, kostprijs per liter enz. 648 // Footer sectie met berekende/geschatte uitkomsten zoals ABV, kostprijs per liter enz.

mercurial