www/js/inv_equipments.js

Fri, 30 Nov 2018 17:40:39 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 30 Nov 2018 17:40:39 +0100
changeset 116
ac993ef43b13
parent 34
a720353fada9
child 117
9e378e37f20f
permissions
-rw-r--r--

Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.

27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * Copyright (C) 2014-2018
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BrewCloud
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 function createDelElements() {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 $('#eventWindow').jqxWindow({
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 theme: theme,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 position: { x: 490, y: 210 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 width: 300,
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
29 height: 175,
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 resizable: false,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 isModal: true,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 modalOpacity: 0.4,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 okButton: $('#delOk'),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 cancelButton: $('#delCancel'),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 initContent: function () {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 $('#delOk').jqxButton({ width: '65px', theme: theme });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 $('#delCancel').jqxButton({ width: '65px', theme: theme });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 $('#delCancel').focus();
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 $('#eventWindow').jqxWindow('hide');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 $(document).ready(function () {
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
46
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
47 function calcBatchVolume() {
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
48 var calc = $("#calc_boil_volume").val();
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
49 var boil_size = parseFloat($("#boil_size").jqxNumberInput('decimal'));
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
50 var evap_rate = parseFloat($("#evap_rate").jqxNumberInput('decimal'));
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
51 var boil_time = parseFloat($("#boil_time").jqxNumberInput('decimal'));
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
52
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
53 if (calc) { // If checked, calculate the batch size.
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
54 var batch = boil_size - (evap_rate * boil_time / 60);
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
55 $("#batch_size").val(batch);
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
56 }
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
57 }
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
58
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 var url = "includes/db_inventory_equipments.php";
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 // tooltips
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 $("#name").jqxTooltip({ content: 'The unique name of this brew equipment.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 $("#notes").jqxTooltip({ content: 'Some notes about the equipment.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 $("#tun_volume").jqxTooltip({ content: 'Mash TUN volume.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 $("#tun_height").jqxTooltip({ content: 'Mash TUN height in cm.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 $("#tun_weight").jqxTooltip({ content: 'Mash TUN weight in Kg.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 $("#tun_material").jqxTooltip({ content: 'Mash TUN material. Needed to calculate the right strike temperature.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 $("#mash_volume").jqxTooltip({ content: 'Mash water for the first step.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 $("#lauter_volume").jqxTooltip({ content: 'Total lauter volume.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 $("#lauter_height").jqxTooltip({ content: 'Height of the lauter TUN in cm.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 $("#lauter_deadspace").jqxTooltip({ content: 'Volume loss in the lauter TUN.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 $("#efficiency").jqxTooltip({ content: 'Average efficiency.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 $("#kettle_volume").jqxTooltip({ content: 'Boil kettle volume in liters.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 $("#kettle_height").jqxTooltip({ content: 'Boil kettle height in cm.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 $("#boil_size").jqxTooltip({ content: 'Normal boil volume in liters' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 $("#evap_rate").jqxTooltip({ content: 'Evaporation in liters per hour.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $("#boil_time").jqxTooltip({ content: 'Normal boil time in minutes.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 $("#top_up_kettle").jqxTooltip({ content: 'Extra water added to the boil.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $("#hop_utilization").jqxTooltip({ content: '100% for smaller installations, higher for large breweries.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $("#batch_size").jqxTooltip({ content: 'Calculated batch size, liters at end of the boil.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $("#trub_chiller_loss").jqxTooltip({ content: 'Standard loss in liters during transfer to the fermenter.' });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 // prepare the data
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 var source = {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 datatype: "json",
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 cache: false,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 datafields: [
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 { name: 'record', type: 'number' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 { name: 'name', type: 'string' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 { name: 'boil_size', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 { name: 'batch_size', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 { name: 'tun_volume', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 { name: 'tun_weight', type: 'float' },
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
93 { name: 'tun_specific_heat', type: 'float' },
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
94 { name: 'tun_material', type: 'string' },
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
95 { name: 'tun_height', type: 'float' },
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
96 { name: 'top_up_water', type: 'float' },
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 { name: 'trub_chiller_loss', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 { name: 'evap_rate', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 { name: 'boil_time', type: 'float' },
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
100 { name: 'calc_boil_volume', type: 'bool' },
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 { name: 'top_up_kettle', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 { name: 'hop_utilization', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 { name: 'notes', type: 'string' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 { name: 'lauter_volume', type: 'float' },
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
105 { name: 'lauter_height', type: 'float' },
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
106 { name: 'lauter_deadspace', type: 'float' },
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 { name: 'kettle_volume', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 { name: 'kettle_height', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 { name: 'mash_volume', type: 'float' },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 { name: 'efficiency', type: 'float' }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 ],
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 id: 'record',
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 url: url,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 deleterow: function (rowid, commit) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 // synchronize with the server - send delete command
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 var data = "delete=true&" + $.param({ record: rowid });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 $.ajax({
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 dataType: 'json',
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 url: url,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 cache: false,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 data: data,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 success: function (data, status, xhr) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 // delete command is executed.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 commit(true);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 error: function (jqXHR, textStatus, errorThrown) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 commit(false);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 addrow: function (rowid, rowdata, position, commit) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 var data = "insert=true&" + $.param(rowdata);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 $.ajax({
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 dataType: 'json',
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 url: url,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 cache: false,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 data: data,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 success: function (data, status, xhr) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 commit(true);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 error: function(jqXHR, textStatus, errorThrown) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 commit(false);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 updaterow: function (rowid, rowdata, commit) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 var data = "update=true&" + $.param(rowdata);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 $.ajax({
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 dataType: 'json',
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 url: url,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 cache: false,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 data: data,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 success: function (data, status, xhr) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 // update command is executed.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 commit(true);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 error: function(jqXHR, textStatus, errorThrown) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 commit(false);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 };
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 // initialize the input fields.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 var srcMaterial= [ "RVS", "Aluminium", "Kunststof", "Koper" ];
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 $("#name").jqxInput({ theme: theme, width: 250, height: 23 });
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
167 $("#boil_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
168 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.5 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
169 $("#tun_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
170 $("#tun_weight").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
171 $("#tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 3 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
172 $("#tun_material").jqxDropDownList({ theme: theme, source: srcMaterial, selectedIndex: 0, width: 110, height: 23, dropDownHeight: 130 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
173 $("#tun_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
174 $("#top_up_water").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
175 $("#trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
176 $("#evap_rate").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
177 $("#boil_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 0, spinButtons: true });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
178 $("#calc_boil_volume").jqxCheckBox({ theme: theme, width: 120, height: 23 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
179 $("#calc_boil_volume").on('checked', function (event) {
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
180 $("#batch_size").jqxNumberInput({ readOnly: true, width: 70, spinButtons: false });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
181 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
182 $("#calc_boil_volume").on('unchecked', function (event) {
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
183 $("#batch_size").jqxNumberInput({ readOnly: false, width: 90, spinButtons: true });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
184 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
185 $("#top_up_kettle").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
186 $("#hop_utilization").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 0, spinButtons: true });
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 $("#notes").jqxInput({ theme: theme, width: 640, height: 100 });
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
188 $("#lauter_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
189 $("#lauter_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
190 $("#lauter_deadspace").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
191 $("#kettle_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
192 $("#kettle_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
193 $("#mash_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
194 $("#efficiency").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 var dataAdapter = new $.jqx.dataAdapter(source);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 var editrow = -1;
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 // initialize jqxGrid
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 $("#jqxgrid").jqxGrid({
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 width: 1280,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 height: 630,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 source: dataAdapter,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 theme: theme,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 showstatusbar: true,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 localization: getLocalization(),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 renderstatusbar: function (statusbar) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
207 var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 container.append(addButton);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 statusbar.append(container);
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
210 addButton.jqxButton({ theme: theme, width: 120, height: 20 });
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 // add new row.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 addButton.click(function (event) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 editrow = -1;
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
214 $("#popupWindow").jqxWindow({ position: { x: 180, y: 30 } });
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 $("#name").val('');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 $("#boil_size").val('18');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 $("#batch_size").val('15.3');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 $("#tun_volume").val('20');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 $("#tun_weight").val('2');
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
220 $("#tun_specific_heat").val('0.11');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
221 $("#tun_material").val('RVS');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
222 $("#tun_height").val('20');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
223 $("#top_up_water").val('0');
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 $("#trub_chiller_loss").val('0.5');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 $("#evap_rate").val('1.8');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226 $("#boil_time").val('90');
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
227 $("#calc_boil_volume").val('0');
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
228 $("#top_up_kettle").val('0');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
229 $("#hop_utilization").val('100');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230 $("#notes").val('');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 $("#lauter_volume").val('20');
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
232 $("#lauter_height").val('20');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
233 $("#lauter_deadspace").val('0.5');
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 $("#kettle_volume").val('20');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 $("#kettle_height").val('20');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 $("#mash_volume").val('18');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 $("#efficiency").val('75');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 $("#popupWindow").jqxWindow('open');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 },
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 filterable: true,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 filtermode: 'excel',
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
243 ready: function() {
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
244 $('#boil_size').on('change', function (event) { calcBatchVolume(); });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
245 $('#evap_rate').on('change', function (event) { calcBatchVolume(); });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
246 $('#boil_time').on('change', function (event) { calcBatchVolume(); });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
247 $("#calc_boil_volume").on('change', function (event) { calcBatchVolume(); });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
248 $('#tun_material').on('change', function (event) {
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
249 switch ($('#tun_material').val()) {
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
250 case 'RVS': $("#tun_specific_heat").val('0.11');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
251 break;
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
252 case 'Aluminium': $("#tun_specific_heat").val('0.22');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
253 break;
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
254 case 'Kunststof': $("#tun_specific_heat").val('0.46');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
255 break;
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
256 case 'Koper': $("#tun_specific_heat").val('0.092');
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
257 break;
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
258 }
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
259 });
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
260 },
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 columns: [
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
262 { text: 'Installatie naam', datafield: 'name', width: 200 },
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
263 { text: 'Kook volume', datafield: 'boil_size', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
264 { text: 'Batch volume', datafield: 'batch_size', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
265 { text: 'Opmerkingen', datafield: 'notes' },
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
266 { text: 'Wijzig', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () {
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
267 return "Wijzig";
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 }, buttonclick: function (row) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269 // open the popup window when the user clicks a button.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
270 editrow = row;
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
271 $("#popupWindow").jqxWindow({ position: { x: 180, y: 30 } });
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 // get the clicked row's data and initialize the input fields.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 $("#name").val(dataRecord.name);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275 $("#boil_size").val(dataRecord.boil_size);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276 $("#batch_size").val(dataRecord.batch_size);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 $("#tun_volume").val(dataRecord.tun_volume);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 $("#tun_weight").val(dataRecord.tun_weight);
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
279 $("#tun_specific_heat").val(dataRecord.tun_specific_heat);
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
280 $("#tun_material").val(dataRecord.tun_material);
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
281 $("#tun_height").val(dataRecord.tun_height);
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
282 $("#top_up_water").val(dataRecord.top_up_water);
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 $("#trub_chiller_loss").val(dataRecord.trub_chiller_loss);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 $("#evap_rate").val(dataRecord.evap_rate);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 $("#boil_time").val(dataRecord.boil_time);
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
286 $("#calc_boil_volume").val(dataRecord.calc_boil_volume);
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 $("#top_up_kettle").val(dataRecord.top_up_kettle);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 $("#hop_utilization").val(dataRecord.hop_utilization);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 $("#notes").val(dataRecord.notes);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 $("#lauter_volume").val(dataRecord.lauter_volume);
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
291 $("#lauter_height").val(dataRecord.lauter_height);
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
292 $("#lauter_deadspace").val(dataRecord.lauter_deadspace);
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293 $("#kettle_volume").val(dataRecord.kettle_volume);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
294 $("#kettle_height").val(dataRecord.kettle_height);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 $("#mash_volume").val(dataRecord.mash_volume);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 $("#efficiency").val(dataRecord.efficiency);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 // show the popup window.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 $("#popupWindow").jqxWindow('open');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 ]
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 // initialize the popup window and buttons.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 $("#popupWindow").jqxWindow({
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 27
diff changeset
305 width: 900, resizable: false, theme: theme, isModal: true, autoOpen: false, cancelButton: $("#Cancel"), modalOpacity: 0.40
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 $("#popupWindow").on('open', function () {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308 $("#name").jqxInput('selectAll');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 $("#Delete").jqxButton({ theme: theme });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 $("#Delete").click(function () {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 if (editrow >= 0) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 // Open a popup to confirm this action.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 $('#eventWindow').jqxWindow('open');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 $("#delOk").click(function () {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317 $("#jqxgrid").jqxGrid('deleterow', rowID);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
318 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 $("#popupWindow").jqxWindow('hide');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 $("#Cancel").jqxButton({ theme: theme });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 $("#Save").jqxButton({ theme: theme });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 // update the edited row when the user clicks the 'Save' button.
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 $("#Save").click(function () {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 if (editrow >= 0) {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 var row = {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 record: rowID,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 name: $("#name").val(),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 tun_volume: parseFloat($("#tun_volume").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 tun_weight: parseFloat($("#tun_weight").jqxNumberInput('decimal')),
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
335 tun_specific_heat: parseFloat($("#tun_specific_heat").jqxNumberInput('decimal')),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
336 tun_material: $("#tun_material").val(),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
337 tun_height: parseFloat($("#tun_height").jqxNumberInput('decimal')),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
338 top_up_water: parseFloat($("#top_up_water").jqxNumberInput('decimal')),
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339 trub_chiller_loss: parseFloat($("#trub_chiller_loss").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
340 evap_rate: parseFloat($("#evap_rate").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')),
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
342 calc_boil_volume: $("#calc_boil_volume").val(),
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
343 top_up_kettle: parseFloat($("#top_up_kettle").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 hop_utilization: parseFloat($("#hop_utilization").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 notes: $("#notes").val(),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346 lauter_volume: parseFloat($("#lauter_volume").jqxNumberInput('decimal')),
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
347 lauter_height: parseFloat($("#lauter_height").jqxNumberInput('decimal')),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
348 lauter_deadspace: parseFloat($("#lauter_deadspace").jqxNumberInput('decimal')),
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 kettle_volume: parseFloat($("#kettle_volume").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 kettle_height: parseFloat($("#kettle_height").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 mash_volume: parseFloat($("#mash_volume").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal'))
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353 };
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 $('#jqxgrid').jqxGrid('updaterow', rowID, row);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 $("#popupWindow").jqxWindow('hide');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356 } else {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 // Insert a record
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358 var newrow = {
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 record: -1,
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
360 name: $("#name").val(),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 tun_volume: parseFloat($("#tun_volume").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 tun_weight: parseFloat($("#tun_weight").jqxNumberInput('decimal')),
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
365 tun_specific_heat: parseFloat($("#tun_specific_heat").jqxNumberInput('decimal')),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
366 tun_material: $("#tun_material").val(),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
367 tun_height: parseFloat($("#tun_height").jqxNumberInput('decimal')),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
368 top_up_water: parseFloat($("#top_up_water").jqxNumberInput('decimal')),
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
369 trub_chiller_loss: parseFloat($("#trub_chiller_loss").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370 evap_rate: parseFloat($("#evap_rate").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
371 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')),
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
372 calc_boil_volume: $("#calc_boil_volume").val(),
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
373 top_up_kettle: parseFloat($("#top_up_kettle").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
374 hop_utilization: parseFloat($("#hop_utilization").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375 notes: $("#notes").val(),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 lauter_volume: parseFloat($("#lauter_volume").jqxNumberInput('decimal')),
116
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
377 lauter_height: parseFloat($("#lauter_height").jqxNumberInput('decimal')),
ac993ef43b13 Removed all calculations from the equipemnts database script and added missing fields. Added missing fields to the inventory equipemnts edit screen. Added conditional batch size calculation to the equipments editor. Added specific heat settings to the equipments editor.
Michiel Broek <mbroek@mbse.eu>
parents: 34
diff changeset
378 lauter_deadspace: parseFloat($("#lauter_deadspace").jqxNumberInput('decimal')),
27
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
379 kettle_volume: parseFloat($("#kettle_volume").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380 kettle_height: parseFloat($("#kettle_height").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 mash_volume: parseFloat($("#mash_volume").jqxNumberInput('decimal')),
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal'))
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 };
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 $('#jqxgrid').jqxGrid('addrow', null, newrow);
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 $("#popupWindow").jqxWindow('hide');
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 }
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 createDelElements();
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 });
d702a41a7021 Added inventory equipments
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390

mercurial