Edit a yeast row now checks the project stage and the use moment to allow edit.

Fri, 31 Jul 2020 13:19:14 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 31 Jul 2020 13:19:14 +0200
changeset 707
8488195b3c50
parent 706
12f9316de113
child 708
60d28976286c

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

mercurial