1401 { text: 'Hoeveel', datafield: 'y_amount', width: 90, align: 'right', |
1401 { text: 'Hoeveel', datafield: 'y_amount', width: 90, align: 'right', |
1402 cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
1402 cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
1403 var amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml'; |
1403 var amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml'; |
1404 if (rowdata.y_form == 0) // Liquid |
1404 if (rowdata.y_form == 0) // Liquid |
1405 amount = dataAdapter.formatNumber(value, 'f0') + ' pk'; |
1405 amount = dataAdapter.formatNumber(value, 'f0') + ' pk'; |
1406 else if (rowdata.y_form == 1) // Dry |
1406 else if (rowdata.y_form == 1 || rowdata.y_form == 6) // Dry |
1407 amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; |
1407 amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; |
1408 return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; |
1408 return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; |
1409 } |
1409 } |
1410 }, |
1410 }, |
1411 { text: 'Voorraad', datafield: 'y_inventory', width: 90, align: 'right', |
1411 { text: 'Voorraad', datafield: 'y_inventory', width: 90, align: 'right', |
1419 if (value < rowdata.y_amount) |
1419 if (value < rowdata.y_amount) |
1420 color = '#ff4040'; |
1420 color = '#ff4040'; |
1421 amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml'; |
1421 amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' ml'; |
1422 if (rowdata.y_form == 0) // Liquid |
1422 if (rowdata.y_form == 0) // Liquid |
1423 amount = dataAdapter.formatNumber(value, 'f0') + ' pk'; |
1423 amount = dataAdapter.formatNumber(value, 'f0') + ' pk'; |
1424 else if (rowdata.y_form == 1) // Dry |
1424 else if (rowdata.y_form == 1 || rowdata.y_form == 6) // Dry |
1425 amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; |
1425 amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gr'; |
1426 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>'; |
1426 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + color + ';">' + amount + '</span>'; |
1427 } else { |
1427 } else { |
1428 return '<span></span>'; |
1428 return '<span></span>'; |
1429 } |
1429 } |
1440 yeastData = $('#yeastGrid').jqxGrid('getrowdata', yeastRow); |
1440 yeastData = $('#yeastGrid').jqxGrid('getrowdata', yeastRow); |
1441 if (yeastData.y_form == 0) { |
1441 if (yeastData.y_form == 0) { |
1442 $('#wy_pmpt_amount').html('Pak(ken):'); |
1442 $('#wy_pmpt_amount').html('Pak(ken):'); |
1443 $('#wy_amount').val(yeastData.y_amount); |
1443 $('#wy_amount').val(yeastData.y_amount); |
1444 $('#wy_amount').jqxNumberInput({ decimalDigits: 0 }); |
1444 $('#wy_amount').jqxNumberInput({ decimalDigits: 0 }); |
1445 } else if (yeastData.y_form == 1) { |
1445 } else if (yeastData.y_form == 1 || yeastData.y_form == 6) { |
1446 $('#wy_pmpt_amount').html('Gewicht gram:'); |
1446 $('#wy_pmpt_amount').html('Gewicht gram:'); |
1447 $('#wy_amount').val(yeastData.y_amount * 1000); |
1447 $('#wy_amount').val(yeastData.y_amount * 1000); |
1448 $('#wy_amount').jqxNumberInput({ decimalDigits: 1 }); |
1448 $('#wy_amount').jqxNumberInput({ decimalDigits: 1 }); |
1449 } else { |
1449 } else { |
1450 $('#wy_pmpt_amount').html('Volume ml:'); |
1450 $('#wy_pmpt_amount').html('Volume ml:'); |
2352 pitchrate = 1.0; |
2352 pitchrate = 1.0; |
2353 // if (dataRecord.est_og > 1.076) |
2353 // if (dataRecord.est_og > 1.076) |
2354 // pitchrate = 1.25; // Wyeast labs. http://www.wyeastlab.com/hb_pitchrates.cfm |
2354 // pitchrate = 1.25; // Wyeast labs. http://www.wyeastlab.com/hb_pitchrates.cfm |
2355 if (row.y_type == 0) // lager yeast |
2355 if (row.y_type == 0) // lager yeast |
2356 pitchrate *= 2; |
2356 pitchrate *= 2; |
|
2357 if (row.y_type == 6) // Kveik |
|
2358 pitchrate = 0.25; // Who knows. |
2357 |
2359 |
2358 // if (row.y_form == 1) { // dry yeast |
2360 // if (row.y_form == 1) { // dry yeast |
2359 // } else { // possible starter needed |
2361 // } else { // possible starter needed |
2360 // } |
2362 // } |
2361 } |
2363 } |
2470 var row, i, amount, rowscount = $('#yeastGrid').jqxGrid('getdatainformation').rowscount; |
2472 var row, i, amount, rowscount = $('#yeastGrid').jqxGrid('getdatainformation').rowscount; |
2471 if (rowscount == 0) |
2473 if (rowscount == 0) |
2472 return; |
2474 return; |
2473 for (i = 0; i < rowscount; i++) { |
2475 for (i = 0; i < rowscount; i++) { |
2474 row = $('#yeastGrid').jqxGrid('getrowdata', i); |
2476 row = $('#yeastGrid').jqxGrid('getrowdata', i); |
2475 if (row.y_form == 1) { // Only adjust dry yeast |
2477 if (! dataRecord.starter_enable) { // Only adjust without a starter |
2476 amount = row.y_amount * factor; |
2478 amount = row.y_amount * factor; |
2477 $('#yeastGrid').jqxGrid('setcellvalue', i, 'y_amount', amount); |
2479 $('#yeastGrid').jqxGrid('setcellvalue', i, 'y_amount', amount); |
2478 } |
2480 } |
2479 } |
2481 } |
2480 calcYeast(); |
2482 calcYeast(); |
5253 yeastData.y_attenuation = datarecord.attenuation; |
5255 yeastData.y_attenuation = datarecord.attenuation; |
5254 yeastData.y_cells = datarecord.cells; |
5256 yeastData.y_cells = datarecord.cells; |
5255 yeastData.y_inventory = datarecord.inventory; |
5257 yeastData.y_inventory = datarecord.inventory; |
5256 if (yeastData.y_form == 0) { |
5258 if (yeastData.y_form == 0) { |
5257 $('#wy_pmpt_amount').html('Pak(ken):'); |
5259 $('#wy_pmpt_amount').html('Pak(ken):'); |
5258 } else if (yeastData.y_form == 1) { |
5260 } else if (yeastData.y_form == 1 || yeastData.y_form == 6) { |
5259 $('#wy_pmpt_amount').html('Gewicht gram:'); |
5261 $('#wy_pmpt_amount').html('Gewicht gram:'); |
5260 } else { |
5262 } else { |
5261 $('#wy_pmpt_amount').html('Volume ml:'); |
5263 $('#wy_pmpt_amount').html('Volume ml:'); |
5262 } |
5264 } |
5263 calcFermentables(); |
5265 calcFermentables(); |