www/js/prod_edit.js

changeset 515
9d771385a8a0
parent 500
8d53ad389204
child 518
00e110567fee
--- a/www/js/prod_edit.js	Wed Oct 16 21:05:03 2019 +0200
+++ b/www/js/prod_edit.js	Thu Oct 17 16:00:10 2019 +0200
@@ -1403,7 +1403,7 @@
       var amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml';
       if (rowdata.y_form == 0) // Liquid
        amount = dataAdapter.formatNumber(value, 'f0') + ' pk';
-      else if (rowdata.y_form == 1) // Dry
+      else if (rowdata.y_form == 1 || rowdata.y_form == 6) // Dry
        amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr';
       return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>';
      }
@@ -1421,7 +1421,7 @@
        amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml';
        if (rowdata.y_form == 0)        // Liquid
         amount = dataAdapter.formatNumber(value, 'f0') + ' pk';
-       else if (rowdata.y_form == 1)   // Dry
+       else if (rowdata.y_form == 1 || rowdata.y_form == 6)   // Dry
         amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr';
        return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>';
       } else {
@@ -1442,7 +1442,7 @@
         $('#wy_pmpt_amount').html('Pak(ken):');
         $('#wy_amount').val(yeastData.y_amount);
         $('#wy_amount').jqxNumberInput({ decimalDigits: 0 });
-       } else if (yeastData.y_form == 1) {
+       } else if (yeastData.y_form == 1 || yeastData.y_form == 6) {
         $('#wy_pmpt_amount').html('Gewicht gram:');
         $('#wy_amount').val(yeastData.y_amount * 1000);
         $('#wy_amount').jqxNumberInput({ decimalDigits: 1 });
@@ -2354,6 +2354,8 @@
 //   pitchrate = 1.25;       // Wyeast labs. http://www.wyeastlab.com/hb_pitchrates.cfm
     if (row.y_type == 0) // lager yeast
      pitchrate *= 2;
+    if (row.y_type == 6) // Kveik
+     pitchrate = 0.25; // Who knows.
 
 //    if (row.y_form == 1) { // dry yeast
 //    } else { // possible starter needed
@@ -2472,7 +2474,7 @@
    return;
   for (i = 0; i < rowscount; i++) {
    row = $('#yeastGrid').jqxGrid('getrowdata', i);
-   if (row.y_form == 1) { // Only adjust dry yeast
+   if (! dataRecord.starter_enable) { // Only adjust without a starter
     amount = row.y_amount * factor;
     $('#yeastGrid').jqxGrid('setcellvalue', i, 'y_amount', amount);
    }
@@ -5255,7 +5257,7 @@
    yeastData.y_inventory = datarecord.inventory;
    if (yeastData.y_form == 0) {
     $('#wy_pmpt_amount').html('Pak(ken):');
-   } else if (yeastData.y_form == 1) {
+   } else if (yeastData.y_form == 1 || yeastData.y_form == 6) {
     $('#wy_pmpt_amount').html('Gewicht gram:');
    } else {
     $('#wy_pmpt_amount').html('Volume ml:');

mercurial