(function(){u8.Crm.SerialEntry.QueryTotalsProvider=function(e){$.extend(this,e);if(this.name||this.statement){this.query=new u8.Crm.QueryCommand({name:this.name,queryLookupScope:this.queryLookupScope,statement:this.statement,link:this.parent.link})}};$.extend(u8.Crm.SerialEntry.QueryTotalsProvider.prototype,{update:function(){var e=this.values;if(!e){return}if(!this.query){return}u8.services.queries.execute(this.query,function(r,t){var i=t.resultSet,s=i.rows[0]||{values:[]};for(var u=0;u<i.columns.length;u++){var n=i.columns[u],a=u8.services.schema.getField(n.infoAreaId,n.fieldId),o=a&&a.name||"F"+n.fieldId;e.set(o,s.values[u]||0)}})}});u8.Crm.SerialEntry.QueryTotalsProvider.makeClass("SerialEntry.QueryTotalsProvider")})();