www/js/prod_edit.js

changeset 331
8d7fad771dde
parent 322
167f3144210d
child 332
f0ca77097236
equal deleted inserted replaced
330:eebe99e9fd99 331:8d7fad771dde
3187 { text: 'Moment', width: 110, datafield: 'f_added', 3187 { text: 'Moment', width: 110, datafield: 'f_added',
3188 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { 3188 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
3189 return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + AddedData[value].nl + "</span>"; 3189 return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + AddedData[value].nl + "</span>";
3190 } 3190 }
3191 }, 3191 },
3192 { text:'Maxinbatch', datafield: 'f_max_in_batch', hidden: true },
3192 { text: 'Opbrengst', datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, 3193 { text: 'Opbrengst', datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' },
3193 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, 3194 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
3194 { text: 'Voorraad Kg', datafield: 'f_inventory', width: 120, align: 'right', 3195 { text: 'Voorraad Kg', datafield: 'f_inventory', width: 120, align: 'right',
3195 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) { 3196 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
3196 var color = '#ffffff'; 3197 var color = '#ffffff';
3198 color = '#ff4040'; 3199 color = '#ff4040';
3199 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + 3200 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' +
3200 color + ';">' +fermentableAdapter.formatNumber(value, "f3") + '</span>'; 3201 color + ';">' +fermentableAdapter.formatNumber(value, "f3") + '</span>';
3201 } 3202 }
3202 }, 3203 },
3203 { text: 'Procent', datafield: 'f_percentage', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, 3204 { text: 'Procent', datafield: 'f_percentage', width: 90, align: 'right',
3205 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
3206 var color = '#ffffff';
3207 if (value > rowdata.f_max_in_batch)
3208 color = '#ff4040';
3209 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' +
3210 color + ';">' +fermentableAdapter.formatNumber(value, "p1") + '</span>';
3211 }
3212 },
3204 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 70 }, 3213 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 70 },
3205 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { 3214 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () {
3206 return "Wijzig"; 3215 return "Wijzig";
3207 }, buttonclick: function (row) { 3216 }, buttonclick: function (row) {
3208 if (dataRecord.stage <= 3) { 3217 if (dataRecord.stage <= 3) {
3209 fermentableRow = row; 3218 fermentableRow = row;
3210 fermentableData = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow); 3219 fermentableData = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow);
3211 $("#wf_name").val(fermentableData.f_name); 3220 $("#wf_name").val(fermentableData.f_name);
3212 $("#wf_amount").val(fermentableData.f_amount); 3221 $("#wf_amount").val(fermentableData.f_amount);
3213 $("#wf_percentage").val(fermentableData.f_percentage); 3222 $("#wf_percentage").val(fermentableData.f_percentage);
3223 $("#wf_max_in_batch").val(fermentableData.f_max_in_batch);
3214 $("#wf_adjust_to_total_100").val(fermentableData.f_adjust_to_total_100); 3224 $("#wf_adjust_to_total_100").val(fermentableData.f_adjust_to_total_100);
3215 $("#wf_added").val(fermentableData.f_added); 3225 $("#wf_added").val(fermentableData.f_added);
3216 // show the popup window. 3226 // show the popup window.
3217 $("#popupFermentable").jqxWindow('open'); 3227 $("#popupFermentable").jqxWindow('open');
3218 } 3228 }
4314 calcIBUs(); 4324 calcIBUs();
4315 } 4325 }
4316 } 4326 }
4317 } 4327 }
4318 }); 4328 });
4329 $("#wf_max_in_batch").jqxNumberInput( Show1dec );
4319 $("#wf_adjust_to_total_100").jqxCheckBox({ theme: theme, width: 120, height: 23 }); 4330 $("#wf_adjust_to_total_100").jqxCheckBox({ theme: theme, width: 120, height: 23 });
4320 $("#wf_adjust_to_total_100").on('checked', function (event) { 4331 $("#wf_adjust_to_total_100").on('checked', function (event) {
4321 if (fermentableData.f_adjust_to_total_100 == 0) { 4332 if (fermentableData.f_adjust_to_total_100 == 0) {
4322 if (to_100) { 4333 if (to_100) {
4323 // Reset other flag first. 4334 // Reset other flag first.

mercurial