www/js/prod_edit.js

changeset 356
36c72e368948
parent 352
9d2a4703bdac
child 358
3be8c2278fd7
--- a/www/js/prod_edit.js	Fri May 10 12:05:03 2019 +0200
+++ b/www/js/prod_edit.js	Sat May 11 16:55:41 2019 +0200
@@ -1899,16 +1899,12 @@
 			$("#primary_end_brix").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
 			$("#primary_end_date").jqxDateTimeInput({ disabled: true });
 		}
-		if (dataRecord.stage < 6) {	// Not yet packaged
-			$("#inventory_reduced").jqxCheckBox({ disabled : true });
-		} else {
+		if (dataRecord.stage >= 6) {	// Packaged
 			$("#secondary_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
 			$("#secondary_end_date").jqxDateTimeInput({ disabled: true });
 			$("#tertiary_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
 			$("#fg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
 			$("#final_brix").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
-			if ($('#inventory_reduced').jqxCheckBox('checked'))
-				$("#inventory_reduced").jqxCheckBox({ disabled : true });
 			$("#package_date").jqxDateTimeInput({ disabled: true });
 			$("#bottle_amount").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
 			$("#keg_amount").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
@@ -2854,7 +2850,6 @@
 			$("#birth").val(dataRecord.birth);
 			$("#stage").val(StageData[dataRecord.stage].nl);
 			$("#notes").val(dataRecord.notes);
-			$("#inventory_reduced").val(dataRecord.inventory_reduced);
 			$("#locked").val(dataRecord.locked);
 			$("#eq_name").val(dataRecord.eq_name);
 			$("#eq_notes").val(dataRecord.eq_notes);
@@ -4032,29 +4027,6 @@
 	$("#birth").jqxInput({ theme: theme, width: 120, height: 23 });
 	$("#stage").jqxTooltip({ content: 'De productie fase van dit product.' });
 	$("#stage").jqxInput({ theme: theme, width: 100, height: 23 });
-	$("#inventory_reduced").jqxCheckBox({ theme: theme, width: 120, height: 23 });
-	$('#inventory_reduced').on('checked', function (event) {
-		if (dataRecord.inventory_reduced == 0) {
-			saveRecord();
-			var data = "reduce=1&uuid="+dataRecord.uuid+"&record="+my_record;
-			var url = "prod_reduce.php";
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					console.log("success");
-					window.location.href = my_return;
-				},
-				error: function(jqXHR, textStatus, errorThrown) {
-					console.log("error");
-					window.location.href = my_return;
-				}
-			});
-		}
-	});
 	$("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true });
 	$('#locked').on('checked', function (event) {
 		if (dataRecord.stage >= 10) {

mercurial