www/js/prod_edit.js

changeset 356
36c72e368948
parent 352
9d2a4703bdac
child 358
3be8c2278fd7
equal deleted inserted replaced
355:64d6f3c857d7 356:36c72e368948
1897 $("#primary_end_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1897 $("#primary_end_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1898 $("#primary_end_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1898 $("#primary_end_sg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1899 $("#primary_end_brix").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1899 $("#primary_end_brix").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1900 $("#primary_end_date").jqxDateTimeInput({ disabled: true }); 1900 $("#primary_end_date").jqxDateTimeInput({ disabled: true });
1901 } 1901 }
1902 if (dataRecord.stage < 6) { // Not yet packaged 1902 if (dataRecord.stage >= 6) { // Packaged
1903 $("#inventory_reduced").jqxCheckBox({ disabled : true });
1904 } else {
1905 $("#secondary_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1903 $("#secondary_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1906 $("#secondary_end_date").jqxDateTimeInput({ disabled: true }); 1904 $("#secondary_end_date").jqxDateTimeInput({ disabled: true });
1907 $("#tertiary_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1905 $("#tertiary_temp").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1908 $("#fg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1906 $("#fg").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1909 $("#final_brix").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1907 $("#final_brix").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1910 if ($('#inventory_reduced').jqxCheckBox('checked'))
1911 $("#inventory_reduced").jqxCheckBox({ disabled : true });
1912 $("#package_date").jqxDateTimeInput({ disabled: true }); 1908 $("#package_date").jqxDateTimeInput({ disabled: true });
1913 $("#bottle_amount").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1909 $("#bottle_amount").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1914 $("#keg_amount").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1910 $("#keg_amount").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1915 $("#bottle_carbonation").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1911 $("#bottle_carbonation").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
1916 $("#keg_carbonation").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 }); 1912 $("#keg_carbonation").jqxNumberInput({ spinButtons: false, readOnly: true, width: 90 });
2852 $("#name").val(dataRecord.name); 2848 $("#name").val(dataRecord.name);
2853 $("#code").val(dataRecord.code); 2849 $("#code").val(dataRecord.code);
2854 $("#birth").val(dataRecord.birth); 2850 $("#birth").val(dataRecord.birth);
2855 $("#stage").val(StageData[dataRecord.stage].nl); 2851 $("#stage").val(StageData[dataRecord.stage].nl);
2856 $("#notes").val(dataRecord.notes); 2852 $("#notes").val(dataRecord.notes);
2857 $("#inventory_reduced").val(dataRecord.inventory_reduced);
2858 $("#locked").val(dataRecord.locked); 2853 $("#locked").val(dataRecord.locked);
2859 $("#eq_name").val(dataRecord.eq_name); 2854 $("#eq_name").val(dataRecord.eq_name);
2860 $("#eq_notes").val(dataRecord.eq_notes); 2855 $("#eq_notes").val(dataRecord.eq_notes);
2861 $("#eq_boil_size").val(dataRecord.eq_boil_size); 2856 $("#eq_boil_size").val(dataRecord.eq_boil_size);
2862 $("#eq_batch_size").val(dataRecord.eq_batch_size); 2857 $("#eq_batch_size").val(dataRecord.eq_batch_size);
4030 $("#code").jqxInput({ theme: theme, width: 100, height: 23 }); 4025 $("#code").jqxInput({ theme: theme, width: 100, height: 23 });
4031 $("#birth").jqxTooltip({ content: 'De ontwerp datum van dit product.' }); 4026 $("#birth").jqxTooltip({ content: 'De ontwerp datum van dit product.' });
4032 $("#birth").jqxInput({ theme: theme, width: 120, height: 23 }); 4027 $("#birth").jqxInput({ theme: theme, width: 120, height: 23 });
4033 $("#stage").jqxTooltip({ content: 'De productie fase van dit product.' }); 4028 $("#stage").jqxTooltip({ content: 'De productie fase van dit product.' });
4034 $("#stage").jqxInput({ theme: theme, width: 100, height: 23 }); 4029 $("#stage").jqxInput({ theme: theme, width: 100, height: 23 });
4035 $("#inventory_reduced").jqxCheckBox({ theme: theme, width: 120, height: 23 });
4036 $('#inventory_reduced').on('checked', function (event) {
4037 if (dataRecord.inventory_reduced == 0) {
4038 saveRecord();
4039 var data = "reduce=1&uuid="+dataRecord.uuid+"&record="+my_record;
4040 var url = "prod_reduce.php";
4041 $.ajax({
4042 dataType: 'json',
4043 url: url,
4044 cache: false,
4045 data: data,
4046 type: "POST",
4047 success: function (data, status, xhr) {
4048 console.log("success");
4049 window.location.href = my_return;
4050 },
4051 error: function(jqXHR, textStatus, errorThrown) {
4052 console.log("error");
4053 window.location.href = my_return;
4054 }
4055 });
4056 }
4057 });
4058 $("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true }); 4030 $("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true });
4059 $('#locked').on('checked', function (event) { 4031 $('#locked').on('checked', function (event) {
4060 if (dataRecord.stage >= 10) { 4032 if (dataRecord.stage >= 10) {
4061 dataRecord.locked = 1; 4033 dataRecord.locked = 1;
4062 dataRecord.stage = 11; 4034 dataRecord.stage = 11;

mercurial