function newExtra(e,c,d,b){var a={id:e,name:c,price:d,maxamount:b,createTableStructureLine:function(g,f){if(e!=null){var h="
";return h}else{var h="";return h}},insertValuesIntoMenuTable:function(){$("#extra_"+this.id+" input.extraname").val(this.name);$("#extra_"+this.id+" input.extramaxamount").val(this.maxamount);if(this.price!=null){$("#extra_"+this.id+" input.extraprice").val(this.price)}},createApplyArea:function(g){var f='";return f}};return a}function ExtrasManagement(){this.assignedextras=[];this.allextras=[];this.initAllExtras=function(){this.allextras.forEach(function(b,a){b.amount=0})};this.setAllExtras=function(a){if((a!=null)&&(a.length>0)){this.allextras=a}else{this.allextras=[]}this.initAllExtras()};this._renderMobile=function(d,i,a,f,b,g){var e='";var h='";return h};this.renderExtras=function(e,n,a){var m="";for(var g=0;g0){c="f";k="check";l='"}var d=l+toHtml(j);if(a){m+='"}else{if(h==0){m+=""}else{m+=""}}}return m};this.extraClicked=function(a){for(var c=0;c=parseInt(d.maxamount)){d.amount=0}else{d.amount++}}}};this.getAssignedExtras=function(){var b=[];for(var e=0;e0){b[b.length]={id:a,name:d,price:f.price,amount:c}}}return b};this.calcPriceOfAssignedExtras=function(b){var c=0;if(b!=null){for(var a=0;a