111 $this->cMargin=2; |
111 $this->cMargin=2; |
112 $this->TableX=$this->lMargin; |
112 $this->TableX=$this->lMargin; |
113 $this->TableHeader(); |
113 $this->TableHeader(); |
114 $this->ProcessingTable=true; |
114 $this->ProcessingTable=true; |
115 |
115 |
116 $sugf = 0; |
116 $sugarsf = 0; |
|
117 $sugarsm = 0; |
117 $this->SetFont('Helvetica','',9); |
118 $this->SetFont('Helvetica','',9); |
118 $this->SetFillColor(250, 195, 65); |
119 $this->SetFillColor(250, 195, 65); |
119 $arr = json_decode($row['json_fermentables'], true); |
120 $arr = json_decode($row['json_fermentables'], true); |
120 foreach($arr as $item) { //foreach element in $arr |
121 foreach($arr as $item) { //foreach element in $arr |
121 $name = iconv('UTF-8','windows-1252',$item['f_name']); |
122 $name = iconv('UTF-8','windows-1252',$item['f_name']); |
138 $cost = $amount * $costkg; |
139 $cost = $amount * $costkg; |
139 $cost_fermentables += $cost; |
140 $cost_fermentables += $cost; |
140 $total_fermentables += $amount; |
141 $total_fermentables += $amount; |
141 /* Calculate the amount of sugars */ |
142 /* Calculate the amount of sugars */ |
142 $d = $amount * ($yield / 100) * (1 - $moisture / 100); |
143 $d = $amount * ($yield / 100) * (1 - $moisture / 100); |
143 if ($added == "Mash") |
144 if ($added == "Mash") { |
144 $d = floatval($row['efficiency']) / 100 * $d; |
145 $d = floatval($row['efficiency']) / 100 * $d; |
145 $sugf += $d; |
146 $sugarsm += $d; |
|
147 } |
|
148 $sugarsf += $d; |
146 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436; |
149 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436; |
147 |
150 |
148 $this->Cell($vul,5,$name,0,0,'L',true); |
151 $this->Cell($vul,5,$name,0,0,'L',true); |
149 $this->Cell(30,5,$supplier,0,0,'L',true); |
152 $this->Cell(30,5,$supplier,0,0,'L',true); |
150 $this->Cell(15,5,sprintf("%.0f",$color),0,0,'R',true); |
153 $this->Cell(15,5,sprintf("%.0f",$color),0,0,'R',true); |
154 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true); |
157 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true); |
155 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); |
158 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); |
156 $this->Ln(); |
159 $this->Ln(); |
157 } |
160 } |
158 |
161 |
159 $row['est_og'] = estimate_sg($sugf, floatval($row['batch_size'])); |
162 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size'])); |
160 $preboil_sg = estimate_sg($sugf, floatval($row['boil_size'])); |
163 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size'])); |
161 $this->SetFillColor(210,245,255); |
164 $this->SetFillColor(210,245,255); |
162 $this->Cell($vul+62,5,'',0,0,'L',false); |
165 $this->Cell($vul+62,5,'',0,0,'L',false); |
163 $this->Cell(20,5,sprintf("%8.3f",$total_fermentables),0,0,'R',true); |
166 $this->Cell(20,5,sprintf("%8.3f",$total_fermentables),0,0,'R',true); |
164 $this->Cell(30,5,'',0,0,'L',false); |
167 $this->Cell(30,5,'',0,0,'L',false); |
165 $this->Cell(20,5,sprintf("%8.3f",$cost_fermentables).EURO,0,0,'R',true); |
168 $this->Cell(20,5,sprintf("%8.3f",$cost_fermentables).EURO,0,0,'R',true); |