# HG changeset patch # User Michiel Broek # Date 1534685773 -7200 # Node ID f5ab22446aa5d37af01c7cf39f3591d9e3f9aeae # Parent a12d0a4d621e3d3d1b1d69239d9356de28966ad3 Inventory fermentables and hops to standard weight format. diff -r a12d0a4d621e -r f5ab22446aa5 README.design --- a/README.design Sat Aug 18 23:13:07 2018 +0200 +++ b/README.design Sun Aug 19 15:36:13 2018 +0200 @@ -30,8 +30,8 @@ Database inventaris: Werking Maten ---------------------------- ------- ------- inventory_equipments Ok. Ok. -inventory_fermentables Ok. -inventory_hops Ok. +inventory_fermentables Ok. Ok. +inventory_hops Ok. Ok. inventory_mash_profiles Ok zonder de steps. inventory_miscs Ok. inventory_styles Ok. Ok. diff -r a12d0a4d621e -r f5ab22446aa5 www/import/from_brouwhulp.php --- a/www/import/from_brouwhulp.php Sat Aug 18 23:13:07 2018 +0200 +++ b/www/import/from_brouwhulp.php Sun Aug 19 15:36:13 2018 +0200 @@ -118,7 +118,7 @@ $sql .= "', substitutes='" . mysqli_real_escape_string($db, $hop->SUBSTITUTES); ($hop->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; if ($hop->INVENTORY) - $sql .= "', inventory='" . $hop->INVENTORY; + $sql .= "', inventory='" . $hop->INVENTORY / 1000.0; if ($hop->COST) $sql .= "', cost='" . $hop->COST; if ($hop->TOTAL_OIL) @@ -433,8 +433,8 @@ -//do_fermentables(); -//do_hops(); +do_fermentables(); +do_hops(); //do_yeasts(); //do_miscs(); //do_waters(); diff -r a12d0a4d621e -r f5ab22446aa5 www/includes/db_inventory_hops.php --- a/www/includes/db_inventory_hops.php Sat Aug 18 23:13:07 2018 +0200 +++ b/www/includes/db_inventory_hops.php Sun Aug 19 15:36:13 2018 +0200 @@ -28,7 +28,7 @@ $sql .= "', origin='" . mysqli_real_escape_string($connect, $_GET['origin']); $sql .= "', substitutes='" . mysqli_real_escape_string($connect, $_GET['substitutes']); ($_GET['always_on_stock'] == 'true') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; - $sql .= "', inventory='" . $_GET['inventory']; + $sql .= "', inventory='" . $_GET['inventory'] / 1000.0; $sql .= "', cost='" . $_GET['cost']; $sql .= "', production_date='" . $_GET['production_date']; $sql .= "', tht_date='" . $_GET['tht_date']; @@ -58,7 +58,7 @@ $sql .= "', origin='" . mysqli_real_escape_string($connect, $_GET['origin']); $sql .= "', substitutes='" . mysqli_real_escape_string($connect, $_GET['substitutes']); ($_GET['always_on_stock'] == 'true') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; - $sql .= "', inventory='" . $_GET['inventory']; + $sql .= "', inventory='" . $_GET['inventory'] / 1000.0; $sql .= "', cost='" . $_GET['cost']; $sql .= "', production_date='" . $_GET['production_date']; $sql .= "', tht_date='" . $_GET['tht_date']; @@ -103,7 +103,7 @@ 'origin' => $row['origin'], 'substitutes' => $row['substitutes'], 'always_on_stock' => $row['always_on_stock'], - 'inventory' => $row['inventory'], + 'inventory' => $row['inventory'] * 1000, 'cost' => $row['cost'], 'production_date' => $row['production_date'], 'tht_date' => $row['tht_date'], diff -r a12d0a4d621e -r f5ab22446aa5 www/includes/global.inc.php --- a/www/includes/global.inc.php Sat Aug 18 23:13:07 2018 +0200 +++ b/www/includes/global.inc.php Sun Aug 19 15:36:13 2018 +0200 @@ -26,13 +26,9 @@ * * energyblue of ui-redmond */ -//$my_style = 'ui-redmond'; //$my_style = 'black'; -//$my_style = 'dark'; -//$my_style = 'metrodark'; -$my_style = 'ui-darkness'; -//$my_style = 'ui-start'; -//$my_style = 'ui-sunny'; +//$my_style = 'ui-darkness'; +$my_style = 'ui-mbse'; //$my_style = 'android'; require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); @@ -133,6 +129,7 @@
  • Maisch schemas
  • Brouw apparatuur
  • Bierstijlen
  • +
  • Voorraad lijst
  • Over diff -r a12d0a4d621e -r f5ab22446aa5 www/inv_instock.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/inv_instock.php Sun Aug 19 15:36:13 2018 +0200 @@ -0,0 +1,54 @@ + + +
    +
    +
    +query("SELECT name,inventory,cost FROM inventory_fermentables WHERE inventory > 0");
    +$tot_fermentables = 0.0;
    +printf("Vergistbaar ingredient                     Voorraad     Prijs/kg    Waarde\n");
    +printf("---------------------------------------- ----------     --------  --------\n");
    +while($row = $result->fetch_array(MYSQLI_ASSOC)) {
    +	$value = $row['inventory'] * $row['cost'];
    +	$tot_fermentables += $value;
    +//	printf("%-40s %10.5f kg  %8.2f  %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value);
    +}
    +printf("----------------------------------------                          --------\n");
    +printf("Totaal                                                            %8.2f\n\n", $tot_fermentables);
    +
    +$tot_hops = 0.0;
    +$result = $mysqli->query("SELECT name,inventory,cost FROM inventory_hops WHERE inventory > 0");
    +$tot_fermentables = 0.0;
    +printf("Hoppen                                     Voorraad     Prijs/kg    Waarde\n");
    +printf("---------------------------------------- ----------     --------  --------\n");
    +while($row = $result->fetch_array(MYSQLI_ASSOC)) {
    +        $value = $row['inventory'] * $row['cost'];
    +        $tot_hops += $value;
    +	printf("%-40s %10.5f kg  %8.2f  %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value);
    +}
    +printf("----------------------------------------                          --------\n\n");
    +printf("Totaal                                                            %8.2f\n", $tot_hops );
    +
    +$tot_yeats = 0.0;
    +$result = $mysqli->query("SELECT name,inventory,cost FROM inventory_yeasts WHERE inventory > 0");
    +$tot_fermentables = 0.0;
    +printf("Hoppen                                     Voorraad     Prijs/kg    Waarde\n");
    +printf("---------------------------------------- ----------     --------  --------\n");
    +while($row = $result->fetch_array(MYSQLI_ASSOC)) {
    +        $value = $row['inventory'] * $row['cost'];
    +        $tot_yeasts += $value;
    +        printf("%-40s %10.5f kg  %8.2f  %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value);
    +}
    +printf("----------------------------------------                          --------\n\n");
    +printf("Totaal                                                            %8.2f\n", $tot_yeasts );
    +?>
    +    
    +
    + + diff -r a12d0a4d621e -r f5ab22446aa5 www/js/inv_fermentables.js --- a/www/js/inv_fermentables.js Sat Aug 18 23:13:07 2018 +0200 +++ b/www/js/inv_fermentables.js Sun Aug 19 15:36:13 2018 +0200 @@ -200,15 +200,15 @@ filtermode: 'excel', columns: [ { text: 'Vergistbaar product', datafield: 'name', width: 250 }, - { text: 'Soort', datafield: 'type', width: 90 }, - { text: 'Mout type', datafield: 'graintype', width: 90 }, + { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 90 }, + { text: 'Mout type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 90 }, { text: 'Herkomst', datafield: 'origin', width: 150 }, { text: 'Producent', datafield: 'supplier', width: 150 }, - { text: 'Kleur', datafield: 'color', width: 70, cellsalign: 'right' }, - { text: 'Opbrengst', datafield: 'yield', width: 70, cellsalign: 'right' }, - { text: 'Inv.', datafield: 'inventory', width: 70, cellsalign: 'right' }, - { text: 'Prijs', datafield: 'cost', width: 70, cellsalign: 'right', cellsformat: 'c2' }, - { text: 'Edit', datafield: 'Edit', width: 120, columntype: 'button', cellsrenderer: function () { + { text: 'Kleur', datafield: 'color', width: 70, align: 'right', cellsalign: 'right' }, + { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, + { text: 'Vooraad', datafield: 'inventory', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, + { text: 'Prijs', datafield: 'cost', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, + { text: 'Edit', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () { return "Edit"; }, buttonclick: function (row) { // open the popup window when the user clicks a button. diff -r a12d0a4d621e -r f5ab22446aa5 www/js/inv_hops.js --- a/www/js/inv_hops.js Sat Aug 18 23:13:07 2018 +0200 +++ b/www/js/inv_hops.js Sun Aug 19 15:36:13 2018 +0200 @@ -191,17 +191,17 @@ filtermode: 'excel', columns: [ { text: 'Hop Naam', datafield: 'name', width: 250 }, - { text: 'Soort', datafield: 'type', width: 90 }, - { text: 'Vorm', datafield: 'form', width: 90 }, - { text: 'Alpha %', datafield: 'alpha', width: 80, cellsalign: 'right', cellsformat: 'p1' }, - { text: 'Beta %', datafield: 'beta', width: 80, cellsalign: 'right', cellsformat: 'p1' }, - { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, cellsalign: 'right', cellsformat: 'p1' }, - { text: 'HSI', datafield: 'hsi', width: 60, cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Herkomst', datafield: 'origin', width: 150 }, - { text: 'Oogst datum', datafield: 'production_date', width: 100 }, - { text: 'Voorraad', datafield: 'inventory', width: 70, cellsalign: 'right' }, - { text: 'Prijs /kg', datafield: 'cost', width: 70, cellsalign: 'right', cellsformat: 'c2' }, - { text: 'Edit', datafield: 'Edit', columntype: 'button', cellsrenderer: function () { + { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 90 }, + { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 90 }, + { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, + { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, + { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, + { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, + { text: 'Herkomst', datafield: 'origin', align: 'center', cellsalign: 'center', width: 150 }, + { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', width: 100 }, + { text: 'Voor, gr.', datafield: 'inventory', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, + { text: 'Prijs /kg', datafield: 'cost', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, + { text: 'Edit', datafield: 'Edit', columntype: 'button', align: 'center', cellsrenderer: function () { return "Edit"; }, buttonclick: function (row) { // open the popup window when the user clicks a button.