merge with master

This commit is contained in:
Rushabh Mehta 2012-09-14 11:29:52 +05:30
commit b40e93733c
5 changed files with 60 additions and 4 deletions

View File

@ -0,0 +1,20 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
report.customize_filters = function() {
this.add_filter({fieldname:'item_name', label:'Item Name', fieldtype:'Data', options:'', parent:'Item'});
this.add_filter({fieldname:'description', label:'Description', fieldtype:'Small Text', options: '', parent:'Item'});
}

View File

@ -0,0 +1,36 @@
# Search Criteria, stock_ledger
[
# These values are common in all dictionaries
{
'creation': '2012-09-13 15:18:44',
'docstatus': 0,
'modified': '2012-09-13 15:38:45',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Search Criteria
{
'add_col': u'`tabItem`.`item_name`\n`tabItem`.`description`',
'add_cond': u'`tabItem`.`name` = `tabStock Ledger Entry`.`item_code`',
'add_tab': u'`tabItem`',
'columns': u'Stock Ledger Entry\x01Item Code,Stock Ledger Entry\x01Warehouse,Stock Ledger Entry\x01Posting Date,Stock Ledger Entry\x01Posting Time,Stock Ledger Entry\x01Actual Quantity,Stock Ledger Entry\x01Bin Actual Qty After Transaction,Stock Ledger Entry\x01Voucher Type,Stock Ledger Entry\x01Voucher No',
'criteria_name': u'Stock Ledger',
'doc_type': u'Stock Ledger Entry',
'doctype': 'Search Criteria',
'filters': u'{"Stock Ledger Entry\\u0001Warehouse Type":[""],"Stock Ledger Entry\\u0001Company":[""],"Stock Ledger Entry\\u0001Is Cancelled":[""],"Stock Ledger Entry\\u0001Is Stock Entry":[""]}',
'module': u'Stock',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabStock Ledger Entry`.`posting_date`, `tabStock Ledger Entry`.`posting_time`, `tabStock Ledger Entry`.`name`',
'sort_order': u'ASC',
'standard': u'Yes'
},
# Search Criteria, stock_ledger
{
'doctype': 'Search Criteria',
'name': u'stock_ledger'
}
]

View File

@ -394,8 +394,8 @@ if(r.exc){r.exc=JSON.parse(r.exc);if(r.exc instanceof Array){$.each(r.exc,functi
if(r.docs){LocalDB.sync(r.docs);}}
wn.request.call=function(opts){wn.request.prepare(opts);var ajax_args={url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success&&opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus)
opts.error&&opts.error(xhr)}};if(opts.progress_bar){var interval=null;$.extend(ajax_args,{xhr:function(){var xhr=jQuery.ajaxSettings.xhr();interval=setInterval(function(){if(xhr.readyState>2){var total=parseInt(xhr.getResponseHeader('Content-length'));var completed=parseInt(xhr.responseText.length);var percent=(100.0/total*completed).toFixed(2)
opts.progress_bar.css('width',(percent<10?10:percent)+'%');console.log(percent);}},50);return xhr;},complete:function(){clearInterval(interval);}})}
console.log(ajax_args);$.ajax(ajax_args);}
opts.progress_bar.css('width',(percent<10?10:percent)+'%');}},50);return xhr;},complete:function(){clearInterval(interval);}})}
$.ajax(ajax_args);}
wn.call=function(opts){var args=$.extend({},opts.args)
if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
for(key in args){if(args[key]&&typeof args[key]!='string'){args[key]=JSON.stringify(args[key]);}}

View File

@ -281,8 +281,8 @@ if(r.exc){r.exc=JSON.parse(r.exc);if(r.exc instanceof Array){$.each(r.exc,functi
if(r.docs){LocalDB.sync(r.docs);}}
wn.request.call=function(opts){wn.request.prepare(opts);var ajax_args={url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success&&opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus)
opts.error&&opts.error(xhr)}};if(opts.progress_bar){var interval=null;$.extend(ajax_args,{xhr:function(){var xhr=jQuery.ajaxSettings.xhr();interval=setInterval(function(){if(xhr.readyState>2){var total=parseInt(xhr.getResponseHeader('Content-length'));var completed=parseInt(xhr.responseText.length);var percent=(100.0/total*completed).toFixed(2)
opts.progress_bar.css('width',(percent<10?10:percent)+'%');console.log(percent);}},50);return xhr;},complete:function(){clearInterval(interval);}})}
console.log(ajax_args);$.ajax(ajax_args);}
opts.progress_bar.css('width',(percent<10?10:percent)+'%');}},50);return xhr;},complete:function(){clearInterval(interval);}})}
$.ajax(ajax_args);}
wn.call=function(opts){var args=$.extend({},opts.args)
if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
for(key in args){if(args[key]&&typeof args[key]!='string'){args[key]=JSON.stringify(args[key]);}}