www/import/from_brouwhulp.php

changeset 201
f9b7e3f6be7c
parent 200
7b2f11652d67
child 202
64a9c935a66b
--- a/www/import/from_brouwhulp.php	Thu Jan 24 20:54:45 2019 +0100
+++ b/www/import/from_brouwhulp.php	Fri Jan 25 13:33:10 2019 +0100
@@ -279,15 +279,23 @@
 
 		if ($yeast->FORM == 'Liquid') {
 			$sql .= "', cells='100000000000";	// 100 billion cells per pack
+			if ($yeast->COST)
+				$sql .= "', cost='" . floatval($yeast->COST);
+			if ($yeast->INVENTORY)
+				$sql .= "', inventory='" . floatval($yeast->INVENTORY);
 		} else if ($yeast->FORM == 'Dry') {
 			$sql .= "', cells='15000000000";	// 6..15 billion per gram
+			if ($yeast->INVENTORY)
+				$sql .= "', inventory='" . floatval($yeast->INVENTORY) / 1000.0; // To kg
+			if ($yeast->COST)
+				$sql .= "', cost='" . floatval($yeast->COST) * 1000.0;  // to Euro/kg
 		} else {
 			$sql .= "', cells='1700000000";		// 1.7 billion cells per ml.
+			if ($yeast->INVENTORY)
+				$sql .= "', inventory='" . floatval($yeast->INVENTORY) / 1000.0; // To liter
+			if ($yeast->COST)
+				$sql .= "', cost='" . floatval($yeast->COST) * 1000.0; 	// to Euro/liter
 		}
-		if ($yeast->INVENTORY)
-			$sql .= "', inventory='" . floatval($yeast->INVENTORY) / 1000.0; // To kg or liter
-		if ($yeast->COST)
-			$sql .= "', cost='" . floatval($yeast->COST) * 1000.0; 	// to Euro/kg or liter
 		if ($yeast->CULTURE_DATE) {
 			$date = substr($yeast->CULTURE_DATE, 6, 4) . '-' . substr($yeast->CULTURE_DATE, 3, 2) . '-' . substr($yeast->CULTURE_DATE, 0, 2);
 			$sql .= "', production_date='" . $date;

mercurial