diff -r 217ba4596c4d -r 3c680d1dea35 www/inv_instock.php --- a/www/inv_instock.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/inv_instock.php Wed Oct 16 21:05:03 2019 +0200 @@ -1,5 +1,6 @@ AddCol( 26,'Type','L'); $this->AddCol( 26,'Leverancier','L'); $this->AddCol( 68,'Vergistbaar ingredient','L'); @@ -85,7 +87,6 @@ $this->ColorIndex=0; $this->ProcessingTable=true; - $type = array( 'Mout', 'Suiker', 'V Extract', 'Extract', 'Ongemout graan' ); $sql = "SELECT type,name,supplier,inventory,cost FROM inventory_fermentables WHERE inventory > 0 ORDER BY type,supplier,name"; $result = mysqli_query($link, $sql); $tot_fermentables = 0.0; @@ -97,7 +98,7 @@ $this->SetX($this->TableX); $ci=$this->ColorIndex; $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]); - $this->Cell(26,5,$type[$row['type']],0,0,'L',true); + $this->Cell(26,5,$fermentabletype[$row['type']],0,0,'L',true); $this->Cell(26,5,iconv('UTF-8','windows-1252',$row['supplier']),0,0,'L',true); $this->Cell(68,5,iconv('UTF-8','windows-1252',$row['name']),0,0,'L',true); $this->Cell(30,5,sprintf("%10.3f kg",$row['inventory']),0,0,'R',true); @@ -119,6 +120,7 @@ } function TableHops($link,$prop) { + global $hopform; $this->AddCol( 30,'Land','L'); $this->AddCol( 75,'Hoppen','L'); $this->AddCol( 15,'Soort','L'); @@ -135,7 +137,6 @@ $this->ColorIndex=0; $this->ProcessingTable=true; - $type = array( 'Pellets', 'Plugs', 'Bellen' ); $result = mysqli_query($link, "SELECT name,form,origin,inventory,cost FROM inventory_hops WHERE inventory > 0 ORDER BY origin,name"); $tot_hops = 0.0; @@ -149,7 +150,7 @@ $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]); $this->Cell(30,5,iconv('UTF-8','windows-1252',$row['origin']),0,0,'L',true); $this->Cell(75,5,iconv('UTF-8','windows-1252',$row['name']),0,0,'L',true); - $this->Cell(15,5,$type[$row['form']],0,0,'L',true); + $this->Cell(15,5,$hopform[$row['form']],0,0,'L',true); $this->Cell(30,5,sprintf("%10.1f gr",$stock),0,0,'R',true); $this->Cell(20,5,sprintf("%8.2f ",$row['cost']).EURO,0,0,'R',true); $this->Cell(20,5,sprintf("%8.2f ",$value).EURO,0,0,'R',true); @@ -223,6 +224,7 @@ } function TableMiscs($link,$prop) { + global $misctype; $this->AddCol( 30,'Type','L'); $this->AddCol( 90,'Ingredient','L'); $this->AddCol( 30,'Voorraad','R'); @@ -240,7 +242,6 @@ $result = mysqli_query($link, "SELECT name,type,amount_is_weight,inventory,cost FROM inventory_miscs WHERE inventory > 0 ORDER BY type,name"); $tot_miscs = 0.0; - $type = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); while($row=mysqli_fetch_array($result)) { $value = $row['inventory'] * $row['cost']; @@ -251,7 +252,7 @@ $this->SetX($this->TableX); $ci=$this->ColorIndex; $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]); - $this->Cell(30,5,$type[$row['type']],0,0,'L',true); + $this->Cell(30,5,$misctype[$row['type']],0,0,'L',true); $this->Cell(90,5,iconv('UTF-8','windows-1252',$row['name']),0,0,'L',true); $this->Cell(30,5,sprintf("%10.1f ",$stock).$amount,0,0,'R',true); $this->Cell(20,5,sprintf("%8.2f ",$row['cost']).EURO,0,0,'R',true);