www/rec_print.php

changeset 232
daf2d9d6fa18
parent 231
9881453a49b3
child 233
14a84d42031d
--- a/www/rec_print.php	Sat Feb 02 11:53:39 2019 +0100
+++ b/www/rec_print.php	Sat Feb 02 14:57:41 2019 +0100
@@ -252,7 +252,7 @@
 		$this->AddCol(20,'Gebruik','L');
 		$this->AddCol(15,'Attn','R');
 		$this->AddCol(22,'Vorm','L');
-		$this->AddCol(18,'Gram','R');
+		$this->AddCol(18,'Hoeveel','R');
 		$this->AddCol(20,'Prijs','R');
 
 		$cMargin=$this->cMargin;
@@ -269,22 +269,26 @@
 			$name       = iconv('UTF-8','windows-1252',$item['y_name']);
 			$laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
 			$product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
-			$amount     = floatval($item['y_amount']) * 1000;
-			$costg      = floatval($item['y_cost']);
 			$attenuation = floatval($item['y_attenuation']);
-			$cost        = $amount * $costg;
+			$cost        = floatval($item['y_amount']) * floatval($item['y_cost']);
 			$cost_yeasts += $cost;
 
 			if ($item['y_use'] == 0)	// Primary
 				$svg = $attenuation;
 
+			if ($item['y_form'] == 0)	// Liquid
+				$amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
+			else if ($item['y_form'] == 1)	// Dry
+				$amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
+			else
+				$amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
 			$this->Cell(27,5,$laboratory,0,0,'L',true);
 			$this->Cell(18,5,$product_id,0,0,'L',true);
 			$this->Cell($vul,5,$name,0,0,'L',true);
 			$this->Cell(20,5,$yeastuse[$item['y_use']],0,0,'L',true);
 			$this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true);
 			$this->Cell(22,5,$yeastform[$item['y_form']],0,0,'L',true);
-			$this->Cell(18,5,sprintf("%.1f",$amount),0,0,'R',true);
+			$this->Cell(18,5,$amount,0,0,'R',true);
 			$this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
 			$this->Ln();
 		}

mercurial