Fri, 31 Jul 2020 13:19:14 +0200
Edit a yeast row now checks the project stage and the use moment to allow edit.
www/js/prod_edit.js | file | annotate | diff | comparison | revisions |
--- a/www/js/prod_edit.js Mon Jul 20 15:48:46 2020 +0200 +++ b/www/js/prod_edit.js Fri Jul 31 13:19:14 2020 +0200 @@ -1506,11 +1506,14 @@ cellsrenderer: function() { return 'Wijzig'; }, buttonclick: function(row) { - if (dataRecord.stage > 3) { + yeastRow = row; + yeastData = $('#yeastGrid').jqxGrid('getrowdata', yeastRow); + if ((dataRecord.stage > 3 && yeastData.y_use == 0) || + (dataRecord.stage > 4 && yeastData.y_use == 1) || + (dataRecord.stage > 5 && yeastData.y_use == 2) || + (dataRecord.stage > 6 && yeastData.y_use == 3)) { alert('Ingredieënt is al verwerkt.'); } else { - yeastRow = row; - yeastData = $('#yeastGrid').jqxGrid('getrowdata', yeastRow); if (yeastData.y_form == 0) { $('#wy_pmpt_amount').html('Pak(ken):'); $('#wy_amount').val(yeastData.y_amount);