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);