# HG changeset patch # User Michiel Broek # Date 1551626859 -3600 # Node ID 9f45d09c20714df9bce0838dbd47679c4c82b148 # Parent ec26ad6ff509224a9476c290305cf98a9a88626e Added alcohol tolerance field in the yeasts database. diff -r ec26ad6ff509 -r 9f45d09c2071 README.design --- a/README.design Sun Mar 03 13:26:58 2019 +0100 +++ b/README.design Sun Mar 03 16:27:39 2019 +0100 @@ -143,3 +143,9 @@ Export ingredienten naar xml. +Extra: + +Gisten alcohol_tolerance veld toevoegen. +Gist typen: kveik en brett? Apart of niet. + + diff -r ec26ad6ff509 -r 9f45d09c2071 www/includes/db_inventory_yeasts.php --- a/www/includes/db_inventory_yeasts.php Sun Mar 03 13:26:58 2019 +0100 +++ b/www/includes/db_inventory_yeasts.php Sun Mar 03 16:27:39 2019 +0100 @@ -32,6 +32,7 @@ $sql .= "', best_for='" . mysqli_real_escape_string($connect, $_POST['best_for']); $sql .= "', max_reuse='" . $_POST['max_reuse']; $sql .= "', cells='" . floatval($_POST['cells']) * 1000000000.0; + $sql .= "', tolerance='" . $_POST['tolerance']; $sql .= "', inventory='" . $_POST['inventory']; $sql .= "', cost='" . $_POST['cost'] . "'"; if ($_POST['production_date'] == '') @@ -97,7 +98,8 @@ 'cost' => $row['cost'], 'production_date' => $row['production_date'], 'tht_date' => $row['tht_date'], - 'cells' => floatval($row['cells']) / 1000000000.0 + 'cells' => floatval($row['cells']) / 1000000000.0, + 'tolerance' => $row['tolerance'] ); } header("Content-type: application/json"); diff -r ec26ad6ff509 -r 9f45d09c2071 www/inv_yeasts.php --- a/www/inv_yeasts.php Sun Mar 03 13:26:58 2019 +0100 +++ b/www/inv_yeasts.php Sun Mar 03 16:27:39 2019 +0100 @@ -45,8 +45,8 @@
- Geschikt voor: - + Geschikt voor: + Maximum Hergebruik:
@@ -59,6 +59,10 @@
+
Alcohol tolerantie:
+
+ +
diff -r ec26ad6ff509 -r 9f45d09c2071 www/js/inv_yeasts.js --- a/www/js/inv_yeasts.js Sun Mar 03 13:26:58 2019 +0100 +++ b/www/js/inv_yeasts.js Sun Mar 03 16:27:39 2019 +0100 @@ -90,7 +90,8 @@ { name: 'cost', type: 'float' }, { name: 'production_date', type: 'string' }, { name: 'tht_date', type: 'string' }, - { name: 'cells', type: 'float' } + { name: 'cells', type: 'float' }, + { name: 'tolerance', type: 'float' } ], id: 'record', url: url, @@ -170,7 +171,7 @@ autoDropDownHeight: true }); $("#notes").jqxInput({ theme: theme, width: 800, height: 120 }); - $("#best_for").jqxInput({ theme: theme, width: 320, height: 75 }); + $("#best_for").jqxInput({ theme: theme, width: 320, height: 100 }); $("#inventory").jqxNumberInput( Spin1dec ); $("#production_date").jqxDateTimeInput( Dateopts ); $("#min_temperature").jqxNumberInput( YeastT ); @@ -191,6 +192,8 @@ $("#tht_date").jqxDateTimeInput( Dateopts ); $("#totval").jqxNumberInput( Show2dec ); $("#cells").jqxNumberInput( Spin1dec ); + $("#tolerance").jqxNumberInput( Perc1dec ); + $("#tolerance").jqxNumberInput({ max: 25 }); var dataAdapter = new $.jqx.dataAdapter(source); var editrow = -1; @@ -231,6 +234,7 @@ $("#production_date").val(''); $("#tht_date").val(''); $("#cells").val(1); + $("#tolerance").val(0); $("#popupWindow").jqxWindow('open'); }); impButton.click(function (event) { @@ -254,7 +258,15 @@ return "
" + YeastFormData[value].nl + "
"; } }, - { text: 'SVG', datafield: 'attenuation', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, + { text: 'SVG', datafield: 'attenuation', width: 70, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, + { text: 'Tol%', datafield: 'tolerance', width: 60, align: 'right', cellsalign: 'right', menu: false, + cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { + var amount = ""; + if (value > 0) + amount = dataAdapter.formatNumber(value, "p0"); + return '' + amount + ''; + } + }, { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { var amount = ""; @@ -299,6 +311,7 @@ $("#production_date").val(dataRecord.production_date); $("#tht_date").val(dataRecord.tht_date); $("#cells").val(dataRecord.cells); + $("#tolerance").val(dataRecord.tolerance); calcTotal(); // show the popup window. $("#popupWindow").jqxWindow('open'); @@ -329,7 +342,7 @@ // initialize the popup window and buttons. $("#popupWindow").jqxWindow({ width: 1050, - height: 550, + height: 575, resizable: false, theme: theme, isModal: true, @@ -382,7 +395,8 @@ cost: parseFloat($("#cost").jqxNumberInput('decimal')), production_date: $("#production_date").val(), tht_date: $("#tht_date").val(), - cells: parseFloat($("#cells").jqxNumberInput('decimal')) + cells: parseFloat($("#cells").jqxNumberInput('decimal')), + tolerance: parseFloat($("#tolerance").jqxNumberInput('decimal')) }; if (editrow >= 0) { $('#jqxgrid').jqxGrid('updaterow', rowID, row);