zoom for stock ledger report
diff --git a/public/js/all-app.js b/public/js/all-app.js
index a626980..c7f904b 100644
--- a/public/js/all-app.js
+++ b/public/js/all-app.js
@@ -1097,15 +1097,10 @@
    </div>').appendTo(this.wrapper);this.bind_show();wn.cur_grid_report=this;this.apply_filters_from_route();$(this.wrapper).trigger('make');},apply_filters_from_route:function(){var hash=window.location.hash;var me=this;if(hash.indexOf('/')!=-1){$.each(hash.split('/').splice(1).join('/').split('&'),function(i,f){var f=f.split("=");if(me.filter_inputs[f[0]]){me.filter_inputs[f[0]].val(decodeURIComponent(f[1]));}else{console.log("Invalid filter: "+f[0]);}});}else{this.init_filter_values();}},set_route:function(){wn.set_route(wn.container.page.page_name,$.map(this.filter_inputs,function(v){var val=v.val();var opts=v.get(0).opts;if(val&&val!=opts.default_value)
 return encodeURIComponent(opts.fieldname)
 +'='+encodeURIComponent(val);}).join('&'))},render:function(){this.grid=new Slick.Grid("#"+this.id,this.dataView,this.dataview_columns,this.options);var me=this;this.dataView.onRowsChanged.subscribe(function(e,args){me.grid.invalidateRows(args.rows);me.grid.render();});this.dataView.onRowCountChanged.subscribe(function(e,args){me.grid.updateRowCount();me.grid.render();});this.add_grid_events&&this.add_grid_events();},prepare_data_view:function(items){this.dataView=new Slick.Data.DataView({inlineFilters:true});this.dataView.beginUpdate();this.dataView.setItems(items);if(this.dataview_filter)this.dataView.setFilter(this.dataview_filter);this.dataView.endUpdate();},export:function(){var me=this;var res=[$.map(this.columns,function(v){return v.name;})].concat(this.get_view_data());wn.require("js/lib/downloadify/downloadify.min.js");wn.require("js/lib/downloadify/swfobject.js");var id=wn.dom.set_unique_id();var msgobj=msgprint('<p id="'+id+'">You must have Flash 10 installed to download this file.</p>');Downloadify.create(id,{filename:function(){return me.title+'.csv';},data:function(){return wn.to_csv(res);},swf:'js/lib/downloadify/downloadify.swf',downloadImage:'js/lib/downloadify/download.png',onComplete:function(){msgobj.hide();},onCancel:function(){msgobj.hide();},onError:function(){msgobj.hide();},width:100,height:30,transparent:true,append:false});return false;},render_plot:function(){var plot_data=this.get_plot_data?this.get_plot_data():null;if(!plot_data){this.wrapper.find('.plot').toggle(false);return;}
-wn.require('js/lib/flot/jquery.flot.js');var plot_options=this.get_plot_options();var plot_area=this.wrapper.find('.plot');$.plot(plot_area.toggle(true),plot_data,plot_options);this.setup_plot_hover();if(plot_options.zoom)this.setup_plot_zoom(plot_area);},setup_plot_hover:function(){var me=this;this.tooltip_id=wn.dom.set_unique_id();function showTooltip(x,y,contents){$('<div id="'+me.tooltip_id+'">'+contents+'</div>').css({position:'absolute',display:'none',top:y+5,left:x+5,border:'1px solid #fdd',padding:'2px','background-color':'#fee',opacity:0.80}).appendTo("body").fadeIn(200);}
+wn.require('js/lib/flot/jquery.flot.js');var plot_options=this.get_plot_options();var plot_area=this.wrapper.find('.plot');if(plot_options.zoom)wn.require('js/lib/flot/jquery.flot.navigate.js');this.plot=$.plot(plot_area.toggle(true),plot_data,plot_options);this.setup_plot_hover();if(plot_options.zoom)this.setup_plot_zoom(plot_area);},setup_plot_hover:function(){var me=this;this.tooltip_id=wn.dom.set_unique_id();function showTooltip(x,y,contents){$('<div id="'+me.tooltip_id+'">'+contents+'</div>').css({position:'absolute',display:'none',top:y+5,left:x+5,border:'1px solid #fdd',padding:'2px','background-color':'#fee',opacity:0.80}).appendTo("body").fadeIn(200);}
 this.previousPoint=null;this.wrapper.find('.plot').bind("plothover",function(event,pos,item){if(item){if(me.previousPoint!=item.dataIndex){me.previousPoint=item.dataIndex;$("#"+me.tooltip_id).remove();showTooltip(item.pageX,item.pageY,me.get_tooltip_text(item.series.label,item.datapoint[0],item.datapoint[1]));}}
-else{$("#"+me.tooltip_id).remove();me.previousPoint=null;}});},setup_plot_zoom:function(plot_area){wn.require('js/lib/flot/jquery.flot.navigate.js');plot_area.bind('plotpan',function(event,plot){var axes=plot.getAxes();$(".message").html("Panning to x: "+axes.xaxis.min.toFixed(2)
-+" &ndash; "+axes.xaxis.max.toFixed(2)
-+" and y: "+axes.yaxis.min.toFixed(2)
-+" &ndash; "+axes.yaxis.max.toFixed(2));});plot_area.bind('plotzoom',function(event,plot){var axes=plot.getAxes();$(".message").html("Zooming to x: "+axes.xaxis.min.toFixed(2)
-+" &ndash; "+axes.xaxis.max.toFixed(2)
-+" and y: "+axes.yaxis.min.toFixed(2)
-+" &ndash; "+axes.yaxis.max.toFixed(2));});$('<div class="button" style="right:20px;top:20px">zoom out</div>').appendTo(plot_area).click(function(e){e.preventDefault();plot.zoomOut();});function addArrow(dir,right,top,offset){$('<img class="button" src="arrow-'+dir+'.gif" style="right:'+right+'px;top:'+top+'px">').appendTo(plot_area).click(function(e){e.preventDefault();plot.pan(offset);});}},get_tooltip_text:function(label,x,y){var date=dateutil.obj_to_user(new Date(x));var value=fmt_money(y);return value+" on "+date;},get_view_data:function(){var res=[];var col_map=$.map(this.columns,function(v){return v.field;});for(var i=0,len=this.dataView.getLength();i<len;i++){var d=this.dataView.getItem(i);var row=[];$.each(col_map,function(i,col){var val=d[col];if(val===null||val===undefined){val=""}
+else{$("#"+me.tooltip_id).remove();me.previousPoint=null;}});},setup_plot_zoom:function(plot_area){var me=this;$('<span class="link_type">zoom in</span>').appendTo(plot_area).click(function(e){e.preventDefault();me.plot.zoom();});$('<span class="link_type">zoom out</span>').appendTo(plot_area).click(function(e){e.preventDefault();me.plot.zoomOut();});function addArrow(direction,style,offset){var t=$('<span><i class="icon icon-arrow-'+direction+'"></i></span>').appendTo(plot_area).click(function(e){e.preventDefault();me.plot.pan(offset);});}
+addArrow('left',"top:100px; left: 600px",{left:-100});addArrow('right',"top: 100px; left: 650px",{left:100});addArrow('up',"top: 50px; left: 625px",{top:-100});addArrow('down',"top: 150px; left: 625px",{top:100});},get_tooltip_text:function(label,x,y){var date=dateutil.obj_to_user(new Date(x));var value=fmt_money(y);return value+" on "+date;},get_view_data:function(){var res=[];var col_map=$.map(this.columns,function(v){return v.field;});for(var i=0,len=this.dataView.getLength();i<len;i++){var d=this.dataView.getItem(i);var row=[];$.each(col_map,function(i,col){var val=d[col];if(val===null||val===undefined){val=""}
 row.push(val);})
 res.push(row);}
 return res;},options:{editable:false,enableColumnReorder:false},apply_filters:function(item){var filters=this.filter_inputs;if(item._show)return true;for(i in filters){if(!this.apply_filter(item,i))return false;}