# HG changeset patch # User Michiel Broek # Date 1560536344 -7200 # Node ID 077ada2dda9b0f845deb22130f23c6b6e2ebf56c # Parent 72ba4a5e8ebc60639b0a276fa5d0ad5cfe258d4b Reduce fermentables after packaging. Always enable the packaging tab but only enable the packaging date in the lagering state. This allows early priming sugar settings. diff -r 72ba4a5e8ebc -r 077ada2dda9b www/includes/db_product.php --- a/www/includes/db_product.php Fri Jun 14 17:08:05 2019 +0200 +++ b/www/includes/db_product.php Fri Jun 14 20:19:04 2019 +0200 @@ -1054,7 +1054,7 @@ * Stage 4+, after primary, reduce sugars(2-fermention), yeasts(0-Primary), miscs(3-primary) * Stage 5+, after secondary, reduce yeasts(1-Secondary) * Stage 6+, after tertiary, reduce sugars(3-lagering), hops(5-dry-hop), yeasts(2-Tertiary), miscs(4-secondary) - * Stage 7+, after packaging, reduce sugars(4-bottle), yeasts(3-Bottle), miscs(5-bottling) + * Stage 7+, after packaging, reduce sugars(4-bottle, 5-kegs), yeasts(3-Bottle), miscs(5-bottling) */ function inventory_reduce() { @@ -1254,12 +1254,19 @@ /* * After packaging - * reduce sugars(4-bottle), yeasts(3-Bottle), miscs(5-bottling) + * reduce sugars(4/5-bottle), yeasts(3-Bottle), miscs(5-bottling) */ if (($stage >= 6) && ($inventory_reduced < 7)) { syslog(LOG_NOTICE, "Reduce Packaging inventory from " . $_POST['code'] . " " . $_POST['name']); - // Bottle sugar, how? + if (isset($_POST['fermentables'])) { + $array = $_POST['fermentables']; + foreach($array as $key => $item) { + if ($item['f_added'] >= 4) { // Bottling or Kegging + reduce_fermentables($item); + } + } + } if (isset($_POST['yeasts'])) { $array = $_POST['yeasts']; diff -r 72ba4a5e8ebc -r 077ada2dda9b www/js/prod_edit.js --- a/www/js/prod_edit.js Fri Jun 14 17:08:05 2019 +0200 +++ b/www/js/prod_edit.js Fri Jun 14 20:19:04 2019 +0200 @@ -2000,10 +2000,11 @@ $("#brew_fermenter_extrawater").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); $("#brew_aeration_speed").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); } - if (dataRecord.stage < 5) { // At least secondary - $('#jqxTabs').jqxTabs('disableAt', 10); // Packaging tab - } else { - $('#jqxTabs').jqxTabs('enableAt', 10); + if (dataRecord.stage == 5) // Lagering, allow packaging + $("#package_date").jqxDateTimeInput({ disabled: false }); + else + $("#package_date").jqxDateTimeInput({ disabled: true }); + if (dataRecord.stage >= 5) { // At least secondary $("#primary_start_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); $("#primary_max_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); $("#primary_end_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });