function Trview() {
	this.setTranspack = function(pack) {
		this.transpack = pack;
	};
	
	this.getQuantity = function () {
	      return this.quantity;
	};
	
	this.render = function(quantity) {
		var html = '<table class="inputTable">';

        var q = 20;
        if(quantity != undefined)
            q = quantity;

		var i = 0;
        var eThis = this;
        
        this.transpack.transactions= $(this.transpack.transactions).sort("date", "desc");
        
		$(this.transpack.transactions).each(function() {
			html += eThis.renderRow(this);

			i++;
			if (i == q) return false;
		});
        
        if(i>=q)
            html += '<tr><td colspan="4"><a href="#" id="showMore">Visa fler</a></td></tr>';
            

        html += '</table>';
        this.quantity = q;

		return html;
	};
	
	this.renderRow = function (transaction) {
	       var html ='';
	       html += '<tr><td>'+transaction.getName()+'</td><td>'+transaction.getAmount()+'</td><td>'+transaction.getDate()+'</td><td>'+transaction.getCategory()+'</td></tr>';
	       return html;
	};

}
