203 }); |
203 }); |
204 }, |
204 }, |
205 filterable: true, |
205 filterable: true, |
206 filtermode: 'excel', |
206 filtermode: 'excel', |
207 columns: [ |
207 columns: [ |
208 { text: 'Ingredient naam', datafield: 'name' }, |
208 { text: 'Ingredient naam', datafield: 'name', menu: false }, |
209 { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 120, |
209 { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 120, |
210 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
210 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
211 return "<div style='margin: 4px;' class='jqx-center-align'>" + MiscTypeData[value].nl + "</div>"; |
211 return "<div style='margin: 4px;' class='jqx-center-align'>" + MiscTypeData[value].nl + "</div>"; |
212 } |
212 } |
213 }, |
213 }, |
214 { text: 'Gebruik', datafield: 'use_use', align: 'center', cellsalign: 'center', width: 120, |
214 { text: 'Gebruik', datafield: 'use_use', align: 'center', cellsalign: 'center', width: 120, |
215 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
215 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
216 return "<div style='margin: 4px;' class='jqx-center-align'>" + MiscUseData[value].nl + "</div>"; |
216 return "<div style='margin: 4px;' class='jqx-center-align'>" + MiscUseData[value].nl + "</div>"; |
217 } |
217 } |
218 }, |
218 }, |
219 { text: 'Tijd', datafield: 'time', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'f0', |
219 { text: 'Tijd', datafield: 'time', width: 90, align: 'left', menu: false, |
|
220 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
|
221 if (value == 0) |
|
222 return "<div style='margin: 4px;' class='jqx-left-align'></div>"; |
|
223 if (value == 1) |
|
224 return "<div style='margin: 4px;' class='jqx-left-align'>1 minuut</div>"; |
|
225 if (value < 60) |
|
226 return "<div style='margin: 4px;' class='jqx-left-align'>"+dataAdapter.formatNumber(value, "f0")+" minuten</div>"; |
|
227 if (value == 60) |
|
228 return "<div style='margin: 4px;' class='jqx-left-align'>1 uur</div>"; |
|
229 if (value < 1440) |
|
230 return "<div style='margin: 4px;' class='jqx-left-align'>"+dataAdapter.formatNumber(value / 60, "f0")+" uren</div>"; |
|
231 if (value == 1440) |
|
232 return "<div style='margin: 4px;' class='jqx-left-align'>1 dag</div>"; |
|
233 return "<div style='margin: 4px;' class='jqx-left-align'>"+dataAdapter.formatNumber(value / 1440, "f0")+" dagen</div>"; |
|
234 } |
|
235 }, |
|
236 { text: 'Voorraad', datafield: 'inventory', width: 110, menu: false, align: 'right', cellsalign: 'right', |
220 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
237 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
221 if (value == 0) |
238 if (value == 0) |
222 return "<div style='margin: 4px;' class='jqx-right-align'></div>"; |
239 return "<div style='margin: 4px;' class='jqx-right-align'></div>"; |
223 if (value == 1) |
240 if (rowdata.amount_is_weight) |
224 return "<div style='margin: 4px;' class='jqx-right-align'>1 minuut</div>"; |
241 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f1")+" gr</div>"; |
225 if (value < 60) |
242 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f1")+" ml</div>"; |
226 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" minuten</div>"; |
|
227 if (value == 60) |
|
228 return "<div style='margin: 4px;' class='jqx-right-align'>1 uur</div>"; |
|
229 if (value < 1440) |
|
230 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value / 60, "f0")+" uren</div>"; |
|
231 if (value == 1440) |
|
232 return "<div style='margin: 4px;' class='jqx-right-align'>1 dag</div>"; |
|
233 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value / 1440, "f0")+" dagen</div>"; |
|
234 } |
243 } |
235 }, |
244 }, |
236 { text: 'Voor. gr/ml.', datafield: 'inventory', width: 110, align: 'right', cellsalign: 'right' }, |
245 { text: 'THT datum', datafield: 'tht_date', width: 100, menu: false, align: 'center', cellsalign: 'center' }, |
237 { text: 'Prijs kg/l', datafield: 'cost', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, |
246 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', width: 100, menu: false, align: 'center', cellsrenderer: function () { |
238 { text: 'THT datum', datafield: 'tht_date', width: 100, align: 'center', cellsalign: 'center' }, |
|
239 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { |
|
240 return "Wijzig"; |
247 return "Wijzig"; |
241 }, buttonclick: function (row) { |
248 }, buttonclick: function (row) { |
242 // open the popup window when the user clicks a button. |
249 // open the popup window when the user clicks a button. |
243 editrow = row; |
250 editrow = row; |
244 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
251 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |