Sat, 11 May 2019 23:13:40 +0200
Added flags for each ingredient group for the supplies state. On the main screen show the state of the supplies if the product stage is not yet packaged. Calculate the state of the supplies for fermentables, hops, yeasts and miscs. In the grids don't show the inventory values after they are used and reduced. On the fermentables tab show the weight of the grains to mash.
14 | 1 | /***************************************************************************** |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
14 | 3 | * |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of BrewCloud | |
7 | * | |
8 | * This is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the | |
10 | * Free Software Foundation; either version 2, or (at your option) any | |
11 | * later version. | |
12 | * | |
13 | * BrewCloud is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
21 | *****************************************************************************/ | |
22 | ||
23 | ||
24 | function createDelElements() { | |
25 | $('#eventWindow').jqxWindow({ | |
26 | theme: theme, | |
27 | position: { x: 490, y: 210 }, | |
28 | width: 300, | |
34 | 29 | height: 175, |
14 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
14 | 38 | $('#delCancel').focus(); |
39 | } | |
40 | }); | |
41 | $('#eventWindow').jqxWindow('hide'); | |
42 | } | |
43 | ||
44 | ||
45 | $(document).ready(function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
46 | |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
47 | var dataRecord = {}; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
48 | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
49 | function calcTotal() { |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
50 | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
51 | $('#totval').val(dataRecord.cost * dataRecord.inventory); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
52 | if (dataRecord.form == 0) { // Liquid |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
53 | $("#pmpt_cost").html('Prijs per pak:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
54 | $("#pmpt_inventory").html('Voorraad pak(ken):'); |
278
dc22dd5d77fd
Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
55 | $("#pmpt_cells").html('Miljard cellen per pak:'); |
dc22dd5d77fd
Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
56 | $("#inventory").jqxNumberInput({ decimalDigits: 0 }); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
57 | } else if (dataRecord.form == 1) { // Dry |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
58 | $("#pmpt_cost").html('Prijs per kg:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
59 | $("#pmpt_inventory").html('Voorraad gram:'); |
278
dc22dd5d77fd
Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
60 | $("#pmpt_cells").html('Miljard cellen per gram:'); |
dc22dd5d77fd
Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
61 | $("#inventory").jqxNumberInput({ decimalDigits: 1 }); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
62 | } else { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
63 | $("#pmpt_cost").html('Prijs per liter:'); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
64 | $("#pmpt_inventory").html('Voorraad ml:'); |
278
dc22dd5d77fd
Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
65 | $("#pmpt_cells").html('Miljard cellen per ml:'); |
dc22dd5d77fd
Initial design of a yeast starter calculator based on the Braukaiser model. Changed the yeast inventory prompts to the correct Dutch amounts. The pitchrate calculator makes a difference between light and heavy beers, turning point is a SG 1.060. Some code is from Homebrew Dad's calculator.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
66 | $("#inventory").jqxNumberInput({ decimalDigits: 1 }); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
67 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
68 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
69 | |
14 | 70 | var url = "includes/db_inventory_yeasts.php"; |
71 | // prepare the data | |
72 | var source = { | |
73 | datatype: "json", | |
74 | cache: false, | |
75 | datafields: [ | |
76 | { name: 'record', type: 'number' }, | |
77 | { name: 'name', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
78 | { name: 'type', type: 'int' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
79 | { name: 'form', type: 'int' }, |
14 | 80 | { name: 'laboratory', type: 'string' }, |
81 | { name: 'product_id', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
82 | { name: 'min_temperature', type: 'float' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
83 | { name: 'max_temperature', type: 'float' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
84 | { name: 'flocculation', type: 'int' }, |
14 | 85 | { name: 'attenuation', type: 'float' }, |
86 | { name: 'notes', type: 'string' }, | |
87 | { name: 'best_for', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
88 | { name: 'max_reuse', type: 'int' }, |
14 | 89 | { name: 'inventory', type: 'float' }, |
90 | { name: 'cost', type: 'float' }, | |
91 | { name: 'production_date', type: 'string' }, | |
200
7b2f11652d67
Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
92 | { name: 'tht_date', type: 'string' }, |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
93 | { name: 'cells', type: 'float' }, |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
94 | { name: 'tolerance', type: 'float' } |
14 | 95 | ], |
96 | id: 'record', | |
97 | url: url, | |
98 | deleterow: function (rowid, commit) { | |
99 | // synchronize with the server - send delete command | |
100 | var data = "delete=true&" + $.param({ record: rowid }); | |
101 | $.ajax({ | |
102 | dataType: 'json', | |
103 | url: url, | |
104 | cache: false, | |
105 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
106 | type: "POST", |
14 | 107 | success: function (data, status, xhr) { |
108 | // delete command is executed. | |
109 | commit(true); | |
110 | }, | |
111 | error: function (jqXHR, textStatus, errorThrown) { | |
112 | commit(false); | |
113 | } | |
114 | }); | |
115 | }, | |
116 | addrow: function (rowid, rowdata, position, commit) { | |
117 | var data = "insert=true&" + $.param(rowdata); | |
118 | $.ajax({ | |
119 | dataType: 'json', | |
120 | url: url, | |
121 | cache: false, | |
122 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
123 | type: "POST", |
14 | 124 | success: function (data, status, xhr) { |
125 | commit(true); | |
126 | }, | |
127 | error: function(jqXHR, textStatus, errorThrown) { | |
128 | commit(false); | |
129 | } | |
130 | }); | |
131 | }, | |
132 | updaterow: function (rowid, rowdata, commit) { | |
133 | var data = "update=true&" + $.param(rowdata); | |
134 | $.ajax({ | |
135 | dataType: 'json', | |
136 | url: url, | |
137 | cache: false, | |
138 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
139 | type: "POST", |
14 | 140 | success: function (data, status, xhr) { |
141 | // update command is executed. | |
142 | commit(true); | |
143 | }, | |
144 | error: function(jqXHR, textStatus, errorThrown) { | |
145 | commit(false); | |
146 | } | |
147 | }); | |
148 | } | |
149 | }; | |
150 | // initialize the input fields. | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
151 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
152 | $("#laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
153 | $("#product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
154 | $("#type").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
155 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
156 | source: YeastTypeAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
157 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
158 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
159 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
160 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
161 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
162 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
163 | $("#form").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
164 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
165 | source: YeastFormAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
166 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
167 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
168 | selectedIndex: 0, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
169 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
170 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
171 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
172 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
173 | $("#notes").jqxInput({ theme: theme, width: 800, height: 120 }); |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
174 | $("#best_for").jqxInput({ theme: theme, width: 320, height: 100 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
175 | $("#inventory").jqxNumberInput( Spin1dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
176 | $("#production_date").jqxDateTimeInput( Dateopts ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
177 | $("#min_temperature").jqxNumberInput( YeastT ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
178 | $("#max_temperature").jqxNumberInput( YeastT ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
179 | $("#flocculation").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
180 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
181 | source: FlocculationAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
182 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
183 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
184 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
185 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
186 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
187 | }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
188 | $("#attenuation").jqxNumberInput( Perc1dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
189 | $("#max_reuse").jqxNumberInput( PosInt ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
190 | $("#max_reuse").jqxNumberInput({ max: 10 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
191 | $("#cost").jqxNumberInput( Spin2dec ); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
192 | $("#tht_date").jqxDateTimeInput( Dateopts ); |
269 | 193 | $("#totval").jqxNumberInput( Show2dec ); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
201
diff
changeset
|
194 | $("#cells").jqxNumberInput( Spin1dec ); |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
195 | $("#tolerance").jqxNumberInput( Perc1dec ); |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
196 | $("#tolerance").jqxNumberInput({ max: 25 }); |
14 | 197 | |
198 | var dataAdapter = new $.jqx.dataAdapter(source); | |
199 | var editrow = -1; | |
200 | // initialize jqxGrid | |
201 | $("#jqxgrid").jqxGrid({ | |
202 | width: 1280, | |
203 | height: 630, | |
204 | source: dataAdapter, | |
205 | theme: theme, | |
206 | showstatusbar: true, | |
207 | renderstatusbar: function (statusbar) { | |
208 | var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); | |
34 | 209 | 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>"); |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
210 | var impButton = $("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>"); |
14 | 211 | container.append(addButton); |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
212 | container.append(impButton); |
14 | 213 | statusbar.append(container); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
214 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
215 | impButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
14 | 216 | // add new row. |
217 | addButton.click(function (event) { | |
218 | editrow = -1; | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
219 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
14 | 220 | $("#name").val(''); |
221 | $("#laboratory").val(''); | |
222 | $("#product_id").val(''); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
223 | $("#type").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
224 | $("#form").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
225 | $("#min_temperature").val(18); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
226 | $("#max_temperature").val(22); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
227 | $("#flocculation").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
228 | $("#attenuation").val(77); |
14 | 229 | $("#notes").val(''); |
230 | $("#best_for").val(''); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
231 | $("#max_reuse").val(10); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
232 | $("#inventory").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
233 | $("#cost").val(0); |
14 | 234 | $("#production_date").val(''); |
235 | $("#tht_date").val(''); | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
236 | $("#cells").val(1); |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
237 | $("#tolerance").val(0); |
14 | 238 | $("#popupWindow").jqxWindow('open'); |
239 | }); | |
311
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
240 | impButton.click(function (event) { |
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
241 | var url="import_ingredients.php?select=yeasts"; |
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
242 | window.location.href = url; |
f6fafccd8a6d
Added xml import for fermentables, hops, miscs, yeasts and styles. Fixed update IBU calculation in the editor hop popups.
Michiel Broek <mbroek@mbse.eu>
parents:
286
diff
changeset
|
243 | }); |
14 | 244 | }, |
245 | filterable: true, | |
246 | filtermode: 'excel', | |
247 | columns: [ | |
248 | { text: 'Laboratorium', datafield: 'laboratory', width: 150 }, | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
249 | { text: 'Product ID', datafield: 'product_id', width: 120, menu: false }, |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
250 | { text: 'Gist naam', datafield: 'name', menu: false }, |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
251 | { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', menu: false, width: 110, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
252 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
253 | return "<div style='margin: 4px;' class='jqx-center-align'>" + YeastTypeData[value].nl + "</div>"; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
254 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
255 | }, |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
256 | { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', menu: false, width: 110, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
257 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
258 | return "<div style='margin: 4px;' class='jqx-center-align'>" + YeastFormData[value].nl + "</div>"; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
259 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
260 | }, |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
261 | { text: 'SVG', datafield: 'attenuation', width: 70, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
262 | { text: 'Tol%', datafield: 'tolerance', width: 60, align: 'right', cellsalign: 'right', menu: false, |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
263 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
264 | var amount = ""; |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
265 | if (value > 0) |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
266 | amount = dataAdapter.formatNumber(value, "p0"); |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
267 | return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
268 | } |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
269 | }, |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
270 | { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
271 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
272 | var amount = ""; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
273 | if (value > 0) { |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
274 | if ((rowdata.form == 0) && (value > 1)) |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
275 | amount = dataAdapter.formatNumber(value,"f0")+" pakken"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
276 | else if (rowdata.form == 0) |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
277 | amount = dataAdapter.formatNumber(value,"f0")+" pak"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
278 | else if (rowdata.form == 1) |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
279 | amount = dataAdapter.formatNumber(value * 1000,"f1")+" gram"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
280 | else |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
281 | amount = dataAdapter.formatNumber(value * 1000,"f1")+" ml"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
282 | } |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
283 | return "<span style='margin: 3px; margin-top: 6px; float: right;'>" + amount + "</span>"; |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
284 | } |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
285 | }, |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
278
diff
changeset
|
286 | { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', menu: false, cellsrenderer: function () { |
34 | 287 | return "Wijzig"; |
14 | 288 | }, buttonclick: function (row) { |
289 | // open the popup window when the user clicks a button. | |
290 | editrow = row; | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
291 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
14 | 292 | // get the clicked row's data and initialize the input fields. |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
293 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
14 | 294 | $("#name").val(dataRecord.name); |
295 | $("#laboratory").val(dataRecord.laboratory); | |
296 | $("#product_id").val(dataRecord.product_id); | |
297 | $("#type").val(dataRecord.type); | |
298 | $("#form").val(dataRecord.form); | |
299 | $("#min_temperature").val(dataRecord.min_temperature); | |
300 | $("#max_temperature").val(dataRecord.max_temperature); | |
301 | $("#flocculation").val(dataRecord.flocculation); | |
302 | $("#attenuation").val(dataRecord.attenuation); | |
303 | $("#notes").val(dataRecord.notes); | |
304 | $("#best_for").val(dataRecord.best_for); | |
305 | $("#max_reuse").val(dataRecord.max_reuse); | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
306 | if (dataRecord.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
307 | $("#inventory").val(dataRecord.inventory); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
308 | else |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
309 | $("#inventory").val(dataRecord.inventory * 1000); |
14 | 310 | $("#cost").val(dataRecord.cost); |
311 | $("#production_date").val(dataRecord.production_date); | |
312 | $("#tht_date").val(dataRecord.tht_date); | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
313 | $("#cells").val(dataRecord.cells); |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
314 | $("#tolerance").val(dataRecord.tolerance); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
315 | calcTotal(); |
14 | 316 | // show the popup window. |
317 | $("#popupWindow").jqxWindow('open'); | |
318 | } | |
319 | } | |
320 | ] | |
321 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
322 | |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
323 | $('#popupWindow').on('open', function (event) { calcTotal(); }); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
324 | $("#cost").on('change', function (event) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
325 | dataRecord.cost = parseFloat(event.args.value); |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
326 | calcTotal(); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
327 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
328 | $("#inventory").on('change', function (event) { |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
329 | if (dataRecord.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
330 | dataRecord.inventory = parseFloat(event.args.value); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
331 | else |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
332 | dataRecord.inventory = parseFloat(event.args.value) / 1000.0; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
333 | calcTotal(); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
334 | }); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
335 | $("#form").on('select', function (event) { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
336 | if (event.args) { |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
337 | dataRecord.form = event.args.index; |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
338 | calcTotal(); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
339 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
340 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
341 | |
14 | 342 | // initialize the popup window and buttons. |
343 | $("#popupWindow").jqxWindow({ | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
344 | width: 1050, |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
345 | height: 575, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
346 | resizable: false, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
347 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
348 | isModal: true, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
349 | autoOpen: false, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
350 | cancelButton: $("#Cancel"), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
351 | modalOpacity: 0.40 |
14 | 352 | }); |
353 | $("#popupWindow").on('open', function () { | |
354 | $("#name").jqxInput('selectAll'); | |
355 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
356 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
14 | 357 | $("#Delete").click(function () { |
358 | if (editrow >= 0) { | |
359 | // Open a popup to confirm this action. | |
360 | $('#eventWindow').jqxWindow('open'); | |
361 | $("#delOk").click(function () { | |
362 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
363 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
364 | }); | |
365 | } | |
366 | $("#popupWindow").jqxWindow('hide'); | |
367 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
368 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
314
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
369 | $("#Clone").jqxButton({ template: "warning", width: '90px', theme: theme }); |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
370 | $("#Clone").click(function () { |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
371 | var row = { |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
372 | record: -1, |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
373 | name: $("#name").val()+" kopie", |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
374 | type: $("#type").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
375 | form: $("#form").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
376 | laboratory: $("#laboratory").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
377 | product_id: $("#product_id").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
378 | min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
379 | max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
380 | flocculation: $("#flocculation").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
381 | attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
382 | notes: $("#notes").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
383 | best_for: $("#best_for").val(), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
384 | max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
385 | inventory: 0, |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
386 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
387 | production_date: '', |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
388 | tht_date: '', |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
389 | cells: parseFloat($("#cells").jqxNumberInput('decimal')), |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
390 | tolerance: parseFloat($("#tolerance").jqxNumberInput('decimal')) |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
391 | }; |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
392 | $('#jqxgrid').jqxGrid('addrow', null, row); |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
393 | $("#popupWindow").jqxWindow('hide'); |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
394 | location.reload( true ); // reload ourself. |
f943efa07d9f
Added yeast duplicate button
Michiel Broek <mbroek@mbse.eu>
parents:
313
diff
changeset
|
395 | }); |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
396 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
14 | 397 | // update the edited row when the user clicks the 'Save' button. |
398 | $("#Save").click(function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
399 | var rowID = -1; |
14 | 400 | if (editrow >= 0) { |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
401 | rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
402 | } |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
403 | if (dataRecord.form == 0) |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
404 | var n_inventory = parseFloat($("#inventory").jqxNumberInput('decimal')); |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
405 | else |
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
406 | var n_inventory = parseFloat($("#inventory").jqxNumberInput('decimal')) / 1000.0; |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
407 | var row = { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
408 | record: rowID, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
409 | name: $("#name").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
410 | type: $("#type").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
411 | form: $("#form").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
412 | laboratory: $("#laboratory").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
413 | product_id: $("#product_id").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
414 | min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
415 | max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
416 | flocculation: $("#flocculation").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
417 | attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
418 | notes: $("#notes").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
419 | best_for: $("#best_for").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
420 | max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')), |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
421 | inventory: n_inventory, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
422 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
423 | production_date: $("#production_date").val(), |
201
f9b7e3f6be7c
Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
424 | tht_date: $("#tht_date").val(), |
313
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
425 | cells: parseFloat($("#cells").jqxNumberInput('decimal')), |
9f45d09c2071
Added alcohol tolerance field in the yeasts database.
Michiel Broek <mbroek@mbse.eu>
parents:
311
diff
changeset
|
426 | tolerance: parseFloat($("#tolerance").jqxNumberInput('decimal')) |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
427 | }; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
428 | if (editrow >= 0) { |
14 | 429 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
430 | } else { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
431 | $('#jqxgrid').jqxGrid('addrow', null, row); |
14 | 432 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
433 | $("#popupWindow").jqxWindow('hide'); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
434 | location.reload( true ); // reload ourself. |
14 | 435 | }); |
436 | createDelElements(); | |
437 | }); | |
438 |