487 (row.h_inventory < row.h_amount)) |
487 (row.h_inventory < row.h_amount)) |
488 ok_hops = 0; |
488 ok_hops = 0; |
489 } |
489 } |
490 total_ibus = Math.round(total_ibus * 10) / 10; |
490 total_ibus = Math.round(total_ibus * 10) / 10; |
491 ferm_ibus = Math.round(ferm_ibus * 10) / 10; |
491 ferm_ibus = Math.round(ferm_ibus * 10) / 10; |
492 hop_flavour = Math.round(hop_flavour * 100) / 10; |
492 hop_flavour = Math.round(hop_flavour * 1000 / 5) / 10; |
493 hop_aroma = Math.round(hop_aroma * 100) / 10; |
493 hop_aroma = Math.round(hop_aroma * 1000 / 6) / 10; |
494 if (hop_flavour > 100) |
494 if (hop_flavour > 100) |
495 hop_flavour = 100; |
495 hop_flavour = 100; |
496 if (hop_aroma > 100) |
496 if (hop_aroma > 100) |
497 hop_aroma = 100; |
497 hop_aroma = 100; |
498 console.log("calcIBUs(): " + total_ibus + " flavour: " + hop_flavour + " aroma: " + hop_aroma+" fermenter:"+ferm_ibus+" supplies:"+ok_hops); |
498 console.log("calcIBUs(): " + total_ibus + " flavour: " + hop_flavour + " aroma: " + hop_aroma+" fermenter:"+ferm_ibus+" supplies:"+ok_hops); |
3746 var commit = $("#miscGrid").jqxGrid('deleterow', id); |
3760 var commit = $("#miscGrid").jqxGrid('deleterow', id); |
3747 } |
3761 } |
3748 }); |
3762 }); |
3749 }, |
3763 }, |
3750 ready: function() { |
3764 ready: function() { |
|
3765 var datainformation = $('#miscGrid').jqxGrid('getdatainformation'); |
|
3766 if (datainformation.rowscount) { |
|
3767 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc'); |
|
3768 $("#miscGrid").jqxGrid('sortby', 'm_type', 'asc'); |
|
3769 } |
3751 calcMiscs(); |
3770 calcMiscs(); |
3752 $('#jqxTabs').jqxTabs('next'); |
3771 $('#jqxTabs').jqxTabs('next'); |
3753 }, |
3772 }, |
3754 columns: [ |
3773 columns: [ |
3755 { text: 'Ingredient', datafield: 'm_name' }, |
3774 { text: 'Ingredient', datafield: 'm_name' }, |
4318 $("#est_color2").jqxNumberInput( Show0dec ); |
4342 $("#est_color2").jqxNumberInput( Show0dec ); |
4319 $("#est_og2").jqxTooltip({ content: 'Het geschatte begin SG van dit product.' }); |
4343 $("#est_og2").jqxTooltip({ content: 'Het geschatte begin SG van dit product.' }); |
4320 $("#est_og2").jqxNumberInput( Show3dec ); |
4344 $("#est_og2").jqxNumberInput( Show3dec ); |
4321 $("#mash_kg").jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); |
4345 $("#mash_kg").jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); |
4322 $("#mash_kg").jqxNumberInput( Show3dec ); |
4346 $("#mash_kg").jqxNumberInput( Show3dec ); |
4323 $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' }); |
|
4324 $("#ferm_lintner").jqxNumberInput( Show0dec ); |
|
4325 $("#perc_malts").jqxProgressBar({ |
4347 $("#perc_malts").jqxProgressBar({ |
4326 width: 300, |
4348 width: 300, |
4327 height: 23, |
4349 height: 23, |
4328 theme: theme, |
4350 theme: theme, |
4329 showText: true, |
4351 showText: true, |
|
4352 max: 120, |
4330 animationDuration: 0, |
4353 animationDuration: 0, |
4331 colorRanges: [ |
4354 colorRanges: [ |
4332 { stop: 90, color: '#008C00' }, |
4355 { stop: 90, color: '#008C00' }, |
4333 { stop: 95, color: '#EB7331' }, |
4356 { stop: 100, color: '#EB7331' }, |
4334 { stop: 100, color: '#FF0000' } |
4357 { stop: 120, color: '#FF0000' } |
4335 ] |
4358 ], |
|
4359 renderText: function (text) { |
|
4360 return (Math.round(parseInt(text) * 1.2)) + '%'; |
|
4361 } |
4336 }); |
4362 }); |
4337 $("#perc_sugars").jqxProgressBar({ |
4363 $("#perc_sugars").jqxProgressBar({ |
4338 width: 300, |
4364 width: 300, |
4339 height: 23, |
4365 height: 23, |
4340 theme: theme, |
4366 theme: theme, |
4341 showText: true, |
4367 showText: true, |
|
4368 max: 50, |
4342 animationDuration: 0, |
4369 animationDuration: 0, |
4343 colorRanges: [ |
4370 colorRanges: [ |
4344 { stop: 20, color: '#008C00' }, |
4371 { stop: 20, color: '#008C00' }, |
4345 { stop: 100, color: '#FF0000' } |
4372 { stop: 50, color: '#FF0000' } |
4346 ] |
4373 ], |
|
4374 renderText: function (text) { |
|
4375 return (Math.round(parseInt(text) * 5) / 10) + '%'; |
|
4376 } |
4347 }); |
4377 }); |
4348 $("#perc_cara").jqxProgressBar({ |
4378 $("#perc_cara").jqxProgressBar({ |
4349 width: 300, |
4379 width: 300, |
4350 height: 23, |
4380 height: 23, |
4351 theme: theme, |
4381 theme: theme, |
4352 showText: true, |
4382 showText: true, |
|
4383 max: 50, |
4353 animationDuration: 0, |
4384 animationDuration: 0, |
4354 colorRanges: [ |
4385 colorRanges: [ |
4355 { stop: 25, color: '#008C00' }, |
4386 { stop: 25, color: '#008C00' }, |
4356 { stop: 100, color: '#FF0000' } |
4387 { stop: 50, color: '#FF0000' } |
4357 ] |
4388 ], |
|
4389 renderText: function (text) { |
|
4390 return (Math.round(parseInt(text) * 5) / 10) + '%'; |
|
4391 } |
|
4392 }); |
|
4393 $("#ferm_lintner").jqxProgressBar({ |
|
4394 width: 300, |
|
4395 height: 23, |
|
4396 theme: theme, |
|
4397 showText: true, |
|
4398 max: 200, |
|
4399 animationDuration: 0, |
|
4400 colorRanges: [ |
|
4401 { stop: 30, color: '#FF0000' }, |
|
4402 { stop: 40, color: '#EB7331' }, |
|
4403 { stop: 200, color: '#008C00' } |
|
4404 ], |
|
4405 renderText: function (text) { |
|
4406 return (parseInt(text) * 2) + ' lintner'; |
|
4407 } |
4358 }); |
4408 }); |
4359 $("#popupFermentable").jqxWindow({ |
4409 $("#popupFermentable").jqxWindow({ |
4360 width: 800, |
4410 width: 800, |
4361 height: 300, |
4411 height: 300, |
4362 position: { x: 230, y: 100 }, |
4412 position: { x: 230, y: 100 }, |
4367 cancelButton: $("#FermentableReady"), |
4417 cancelButton: $("#FermentableReady"), |
4368 modalOpacity: 0.40 |
4418 modalOpacity: 0.40 |
4369 }); |
4419 }); |
4370 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4420 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4371 $("#FermentableReady").click(function () { |
4421 $("#FermentableReady").click(function () { |
4372 $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc'); |
|
4373 // Recalc percentages |
4422 // Recalc percentages |
4374 calcFermentables(); |
4423 calcFermentables(); |
4375 calcIBUs(); |
4424 calcIBUs(); |
4376 calcMash(); |
4425 calcMash(); |
4377 // Waters: yes there is impact. |
4426 // Waters: yes there is impact. |
4568 { stop: 20, color: '#004D00' }, |
4617 { stop: 20, color: '#004D00' }, |
4569 { stop: 40, color: '#008C00' }, |
4618 { stop: 40, color: '#008C00' }, |
4570 { stop: 60, color: '#00BF00' }, |
4619 { stop: 60, color: '#00BF00' }, |
4571 { stop: 80, color: '#00FF00' }, |
4620 { stop: 80, color: '#00FF00' }, |
4572 { stop: 100, color: '#80FF80' } |
4621 { stop: 100, color: '#80FF80' } |
4573 ] |
4622 ], |
|
4623 renderText: function (text) { |
|
4624 var val = parseInt(text); |
|
4625 if (val < 20) |
|
4626 return 'Weinig'; |
|
4627 else if (val < 40) |
|
4628 return 'Matig'; |
|
4629 else if (val < 60) |
|
4630 return 'Redelijk'; |
|
4631 else if (val < 80) |
|
4632 return 'Veel'; |
|
4633 else |
|
4634 return 'Zeer veel'; |
|
4635 } |
4574 }); |
4636 }); |
4575 $("#hop_aroma").jqxProgressBar({ |
4637 $("#hop_aroma").jqxProgressBar({ |
4576 width: 300, height: 23, theme: theme, showText: true, |
4638 width: 300, height: 23, theme: theme, showText: true, |
4577 animationDuration: 0, |
4639 animationDuration: 0, |
4578 colorRanges: [ |
4640 colorRanges: [ |
4579 { stop: 20, color: '#004D00' }, |
4641 { stop: 20, color: '#004D00' }, |
4580 { stop: 40, color: '#008C00' }, |
4642 { stop: 40, color: '#008C00' }, |
4581 { stop: 60, color: '#00BF00' }, |
4643 { stop: 60, color: '#00BF00' }, |
4582 { stop: 80, color: '#00FF00' }, |
4644 { stop: 80, color: '#00FF00' }, |
4583 { stop: 100, color: '#80FF80' } |
4645 { stop: 100, color: '#80FF80' } |
4584 ] |
4646 ], |
|
4647 renderText: function (text) { |
|
4648 var val = parseInt(text); |
|
4649 if (val < 20) |
|
4650 return 'Weinig'; |
|
4651 else if (val < 40) |
|
4652 return 'Matig'; |
|
4653 else if (val < 60) |
|
4654 return 'Redelijk'; |
|
4655 else if (val < 80) |
|
4656 return 'Veel'; |
|
4657 else |
|
4658 return 'Zeer veel'; |
|
4659 } |
4585 }); |
4660 }); |
4586 $("#popupHop").jqxWindow({ |
4661 $("#popupHop").jqxWindow({ |
4587 width: 800, |
4662 width: 800, |
4588 height: 300, |
4663 height: 300, |
4589 position: { x: 230, y: 100 }, |
4664 position: { x: 230, y: 100 }, |
4594 cancelButton: $("#HopReady"), |
4669 cancelButton: $("#HopReady"), |
4595 modalOpacity: 0.40 |
4670 modalOpacity: 0.40 |
4596 }); |
4671 }); |
4597 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4672 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4598 $("#HopReady").click(function () { |
4673 $("#HopReady").click(function () { |
4599 $("#hopGrid").jqxGrid('sortby', 'h_amount', 'asc'); |
|
4600 calcIBUs(); |
4674 calcIBUs(); |
4601 }); |
4675 }); |
4602 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
4676 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
4603 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 }); |
4677 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 }); |
4604 $("#wh_instock").on('change', function (event) { |
4678 $("#wh_instock").on('change', function (event) { |
4733 cancelButton: $("#MiscReady"), |
4807 cancelButton: $("#MiscReady"), |
4734 modalOpacity: 0.40 |
4808 modalOpacity: 0.40 |
4735 }); |
4809 }); |
4736 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4810 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4737 $("#MiscReady").click(function () { |
4811 $("#MiscReady").click(function () { |
4738 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc'); |
|
4739 calcMiscs(); |
4812 calcMiscs(); |
4740 }); |
4813 }); |
4741 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
4814 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
4742 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 }); |
4815 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 }); |
4743 $("#wm_instock").on('change', function (event) { |
4816 $("#wm_instock").on('change', function (event) { |
4841 }); |
4914 }); |
4842 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4915 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme }); |
4843 $("#YeastReady").click(function () { |
4916 $("#YeastReady").click(function () { |
4844 calcFermentables(); |
4917 calcFermentables(); |
4845 calcYeast(); |
4918 calcYeast(); |
4846 $("#yeastGrid").jqxGrid('sortby', 'y_use', 'asc'); |
|
4847 }); |
4919 }); |
4848 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
4920 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 }); |
4849 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
4921 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
4850 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
4922 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
4851 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 }); |
4923 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 }); |