From ebc3b6a68d476d6702a2394ec6f197c926a82c73 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 14 Sep 2012 11:25:57 +0530 Subject: [PATCH 1/2] stock ledger added --- .../search_criteria/stock_ledger/__init__.py | 0 .../stock_ledger/stock_ledger.js | 20 +++++++++++ .../stock_ledger/stock_ledger.txt | 36 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 erpnext/stock/search_criteria/stock_ledger/__init__.py create mode 100644 erpnext/stock/search_criteria/stock_ledger/stock_ledger.js create mode 100644 erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt diff --git a/erpnext/stock/search_criteria/stock_ledger/__init__.py b/erpnext/stock/search_criteria/stock_ledger/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/stock/search_criteria/stock_ledger/stock_ledger.js b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.js new file mode 100644 index 00000000000..a47806fada8 --- /dev/null +++ b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.js @@ -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 . + +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'}); +} \ No newline at end of file diff --git a/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt new file mode 100644 index 00000000000..b80578ef0c9 --- /dev/null +++ b/erpnext/stock/search_criteria/stock_ledger/stock_ledger.txt @@ -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' + } +] \ No newline at end of file From 42208085a11082f13b223130a76009679330d7a3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 14 Sep 2012 11:28:46 +0530 Subject: [PATCH 2/2] removed logs in request --- public/js/all-app.js | 4 ++-- public/js/all-web.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/all-app.js b/public/js/all-app.js index fff60312ac9..ebe52ccd4f6 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -392,8 +392,8 @@ if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');} 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(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus) if(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]);}} diff --git a/public/js/all-web.js b/public/js/all-web.js index 358c6c1dfc3..da8c6ec572c 100644 --- a/public/js/all-web.js +++ b/public/js/all-web.js @@ -279,8 +279,8 @@ if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');} 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(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});show_alert('Unable to complete request: '+textStatus) if(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]);}}