www/rec_print.php

changeset 86
e977a505ea8c
parent 85
ca7a37586551
child 87
7f1d0abe5571
equal deleted inserted replaced
85:ca7a37586551 86:e977a505ea8c
140 $this->TableX=$this->lMargin; 140 $this->TableX=$this->lMargin;
141 $this->TableHeader(); 141 $this->TableHeader();
142 $this->ProcessingTable=true; 142 $this->ProcessingTable=true;
143 143
144 $sugf = 0; 144 $sugf = 0;
145 $tot = 0; 145 // $tot = 0;
146 $this->SetFont('Helvetica','',9); 146 $this->SetFont('Helvetica','',9);
147 $this->SetFillColor(250, 195, 65); 147 $this->SetFillColor(250, 195, 65);
148 $arr = json_decode($row['json_fermentables'], true); 148 $arr = json_decode($row['json_fermentables'], true);
149 foreach($arr as $item) { //foreach element in $arr 149 foreach($arr as $item) { //foreach element in $arr
150 $name = iconv('UTF-8','windows-1252',$item['f_name']); 150 $name = iconv('UTF-8','windows-1252',$item['f_name']);
162 /* Calculate the amount of sugars */ 162 /* Calculate the amount of sugars */
163 $d = $amount * ($yield / 100) * (1 - $moisture / 100); 163 $d = $amount * ($yield / 100) * (1 - $moisture / 100);
164 if ($added == "Mash") 164 if ($added == "Mash")
165 $d = floatval($row['efficiency']) / 100 * $d; 165 $d = floatval($row['efficiency']) / 100 * $d;
166 $sugf += $d; 166 $sugf += $d;
167 $tot += $amount; 167 // $tot += $amount;
168 //$plato = 100 * $d / $amount; 168 //$plato = 100 * $d / $amount;
169 //$this->Cell(0,5,$tot.' sugf: '.$sugf.' d: '.$d.' pt: '.$plato.' moisture: '.$moisture,0,0,'L',false); 169 //$this->Cell(0,5,$tot.' sugf: '.$sugf.' d: '.$d.' pt: '.$plato.' moisture: '.$moisture,0,0,'L',false);
170 //$this->Ln(); 170 //$this->Ln();
171 171
172 $this->Cell($vul,5,$name,0,0,'L',true); 172 $this->Cell($vul,5,$name,0,0,'L',true);
180 $this->Ln(); 180 $this->Ln();
181 } 181 }
182 182
183 $plato = 100 * $sugf / floatval($row['batch_size']); 183 $plato = 100 * $sugf / floatval($row['batch_size']);
184 $sg = plato_to_sg($plato); 184 $sg = plato_to_sg($plato);
185 /* Average loops, HansH 5x. Brouwhulp 20x, about 10x is enough so keep 20. */ 185 /* Average loops, HansH 5x. Brouwhulp 20x, about 10x is enough so keep 20. */
186 for ($i = 0; $i < 20; $i++) { 186 for ($i = 0; $i < 20; $i++) {
187 if ($sg > 0) 187 if ($sg > 0)
188 $plato = 100 * $sugf / (floatval($row['batch_size']) * $sg); 188 $plato = 100 * $sugf / (floatval($row['batch_size']) * $sg);
189 $sg = plato_to_sg($plato); 189 $sg = plato_to_sg($plato);
190 } 190 }

mercurial