www/includes/db_product.php

changeset 411
077ada2dda9b
parent 408
a93c9473a7c3
child 419
99a7f2a6976e
equal deleted inserted replaced
410:72ba4a5e8ebc 411:077ada2dda9b
1052 * Reduce inventory depending on the production stage. 1052 * Reduce inventory depending on the production stage.
1053 * Stage 3+, after brew, reduce sugars(0-mash, 1-boil), hops(0-mash, 1-fwh, 2-boil, 3-aroma, 4-whirlpool), miscs(0-starter, 1-mash, 2-boil) 1053 * Stage 3+, after brew, reduce sugars(0-mash, 1-boil), hops(0-mash, 1-fwh, 2-boil, 3-aroma, 4-whirlpool), miscs(0-starter, 1-mash, 2-boil)
1054 * Stage 4+, after primary, reduce sugars(2-fermention), yeasts(0-Primary), miscs(3-primary) 1054 * Stage 4+, after primary, reduce sugars(2-fermention), yeasts(0-Primary), miscs(3-primary)
1055 * Stage 5+, after secondary, reduce yeasts(1-Secondary) 1055 * Stage 5+, after secondary, reduce yeasts(1-Secondary)
1056 * Stage 6+, after tertiary, reduce sugars(3-lagering), hops(5-dry-hop), yeasts(2-Tertiary), miscs(4-secondary) 1056 * Stage 6+, after tertiary, reduce sugars(3-lagering), hops(5-dry-hop), yeasts(2-Tertiary), miscs(4-secondary)
1057 * Stage 7+, after packaging, reduce sugars(4-bottle), yeasts(3-Bottle), miscs(5-bottling) 1057 * Stage 7+, after packaging, reduce sugars(4-bottle, 5-kegs), yeasts(3-Bottle), miscs(5-bottling)
1058 */ 1058 */
1059 function inventory_reduce() { 1059 function inventory_reduce() {
1060 1060
1061 global $connect; 1061 global $connect;
1062 1062
1252 $savethis = 1; 1252 $savethis = 1;
1253 } 1253 }
1254 1254
1255 /* 1255 /*
1256 * After packaging 1256 * After packaging
1257 * reduce sugars(4-bottle), yeasts(3-Bottle), miscs(5-bottling) 1257 * reduce sugars(4/5-bottle), yeasts(3-Bottle), miscs(5-bottling)
1258 */ 1258 */
1259 if (($stage >= 6) && ($inventory_reduced < 7)) { 1259 if (($stage >= 6) && ($inventory_reduced < 7)) {
1260 syslog(LOG_NOTICE, "Reduce Packaging inventory from " . $_POST['code'] . " " . $_POST['name']); 1260 syslog(LOG_NOTICE, "Reduce Packaging inventory from " . $_POST['code'] . " " . $_POST['name']);
1261 1261
1262 // Bottle sugar, how? 1262 if (isset($_POST['fermentables'])) {
1263 $array = $_POST['fermentables'];
1264 foreach($array as $key => $item) {
1265 if ($item['f_added'] >= 4) { // Bottling or Kegging
1266 reduce_fermentables($item);
1267 }
1268 }
1269 }
1263 1270
1264 if (isset($_POST['yeasts'])) { 1271 if (isset($_POST['yeasts'])) {
1265 $array = $_POST['yeasts']; 1272 $array = $_POST['yeasts'];
1266 foreach($array as $key => $item) { 1273 foreach($array as $key => $item) {
1267 if ($item['y_use'] == 3) { // Bottle 1274 if ($item['y_use'] == 3) { // Bottle

mercurial