diff -r 22c277be7e7e -r 92d6bc8a4cdd www/rec_print.php --- a/www/rec_print.php Thu Nov 15 22:36:09 2018 +0100 +++ b/www/rec_print.php Fri Nov 16 16:20:17 2018 +0100 @@ -113,7 +113,8 @@ $this->TableHeader(); $this->ProcessingTable=true; - $sugf = 0; + $sugarsf = 0; + $sugarsm = 0; $this->SetFont('Helvetica','',9); $this->SetFillColor(250, 195, 65); $arr = json_decode($row['json_fermentables'], true); @@ -140,9 +141,11 @@ $total_fermentables += $amount; /* Calculate the amount of sugars */ $d = $amount * ($yield / 100) * (1 - $moisture / 100); - if ($added == "Mash") + if ($added == "Mash") { $d = floatval($row['efficiency']) / 100 * $d; - $sugf += $d; + $sugarsm += $d; + } + $sugarsf += $d; $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436; $this->Cell($vul,5,$name,0,0,'L',true); @@ -156,8 +159,8 @@ $this->Ln(); } - $row['est_og'] = estimate_sg($sugf, floatval($row['batch_size'])); - $preboil_sg = estimate_sg($sugf, floatval($row['boil_size'])); + $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size'])); + $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size'])); $this->SetFillColor(210,245,255); $this->Cell($vul+62,5,'',0,0,'L',false); $this->Cell(20,5,sprintf("%8.3f",$total_fermentables),0,0,'R',true);