From 4279dec000a298caae311eba337db314b198394d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 25 Dec 2012 18:35:12 +0530 Subject: [PATCH 1/9] fixed wn.require path for stock analytics and stock balance --- public/js/stock_analytics.js | 196 +++++++++++++++++ stock/page/stock_analytics/stock_analytics.js | 203 +----------------- stock/page/stock_balance/stock_balance.js | 2 +- 3 files changed, 208 insertions(+), 193 deletions(-) create mode 100644 public/js/stock_analytics.js diff --git a/public/js/stock_analytics.js b/public/js/stock_analytics.js new file mode 100644 index 0000000000..2bdea5e010 --- /dev/null +++ b/public/js/stock_analytics.js @@ -0,0 +1,196 @@ +// 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 . + +wn.require("app/js/stock_grid_report.js"); + +erpnext.StockAnalytics = erpnext.StockGridReport.extend({ + init: function(wrapper, opts) { + var args = { + title: "Stock Analytics", + page: wrapper, + parent: $(wrapper).find('.layout-main'), + appframe: wrapper.appframe, + doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", + "Fiscal Year"], + tree_grid: { + show: true, + parent_field: "parent_item_group", + formatter: function(item) { + if(!item.is_group) { + return repl('%(value)s', + { + value: item.name, + enc_value: encodeURIComponent(item.name) + }); + } else { + return item.name; + } + + } + }, + } + + if(opts) $.extend(args, opts); + + this._super(args); + }, + setup_columns: function() { + var std_columns = [ + {id: "check", name: "Plot", field: "check", width: 30, + formatter: this.check_formatter}, + {id: "name", name: "Item", field: "name", width: 300, + formatter: this.tree_formatter}, + {id: "brand", name: "Brand", field: "brand", width: 200}, + {id: "opening", name: "Opening", field: "opening", hidden: true, + formatter: this.currency_formatter} + ]; + + this.make_date_range_columns(); + this.columns = std_columns.concat(this.columns); + }, + filters: [ + {fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)", + "Value (FIFO)", "Quantity"], + filter: function(val, item, opts, me) { + return me.apply_zero_filter(val, item, opts, me); + }}, + {fieldtype:"Select", label: "Brand", link:"Brand", + default_value: "Select Brand...", filter: function(val, item, opts) { + return val == opts.default_value || item.brand == val || item._show; + }}, + {fieldtype:"Select", label: "Warehouse", link:"Warehouse", + default_value: "Select Warehouse..."}, + {fieldtype:"Date", label: "From Date"}, + {fieldtype:"Label", label: "To"}, + {fieldtype:"Date", label: "To Date"}, + {fieldtype:"Select", label: "Range", + options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, + {fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, + {fieldtype:"Button", label: "Reset Filters"} + ], + setup_filters: function() { + var me = this; + this._super(); + + this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]); + + this.show_zero_check(); + this.setup_plot_check(); + }, + init_filter_values: function() { + this._super(); + this.filter_inputs.range && this.filter_inputs.range.val('Monthly'); + }, + prepare_data: function() { + var me = this; + + if(!this.data) { + var items = this.prepare_tree("Item", "Item Group"); + + me.parent_map = {}; + me.item_by_name = {}; + me.data = []; + + $.each(items, function(i, v) { + var d = copy_dict(v); + + me.data.push(d); + me.item_by_name[d.name] = d; + if(d.parent_item_group) { + me.parent_map[d.name] = d.parent_item_group; + } + me.reset_item_values(d); + }); + this.set_indent(); + this.data[0].checked = true; + } else { + // otherwise, only reset values + $.each(this.data, function(i, d) { + me.reset_item_values(d); + }); + } + + this.prepare_balances(); + this.update_groups(); + + }, + prepare_balances: function() { + var me = this; + var from_date = dateutil.str_to_obj(this.from_date); + var to_date = dateutil.str_to_obj(this.to_date); + var data = wn.report_dump.data["Stock Ledger Entry"]; + + this.item_warehouse = {}; + + for(var i=0, j=data.length; i. -wn.require("app/js/stock_grid_report.js"); -// done so that it doesn't throw error when inherited in stock-balance report -if(wn.pages["stock-analytics"]) { - wn.pages['stock-analytics'].onload = function(wrapper) { - wn.ui.make_app_page({ - parent: wrapper, - title: 'Stock Analytics', - single_column: true - }); +wn.pages['stock-analytics'].onload = function(wrapper) { + wn.ui.make_app_page({ + parent: wrapper, + title: 'Stock Analytics', + single_column: true + }); - new erpnext.StockAnalytics(wrapper); + new erpnext.StockAnalytics(wrapper); - wrapper.appframe.add_home_breadcrumb() - wrapper.appframe.add_module_breadcrumb("Stock") - wrapper.appframe.add_breadcrumb("icon-bar-chart") - } + wrapper.appframe.add_home_breadcrumb() + wrapper.appframe.add_module_breadcrumb("Stock") + wrapper.appframe.add_breadcrumb("icon-bar-chart") } -erpnext.StockAnalytics = erpnext.StockGridReport.extend({ - init: function(wrapper, opts) { - var args = { - title: "Stock Analytics", - page: wrapper, - parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, - doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", - "Fiscal Year"], - tree_grid: { - show: true, - parent_field: "parent_item_group", - formatter: function(item) { - if(!item.is_group) { - return repl('%(value)s', - { - value: item.name, - enc_value: encodeURIComponent(item.name) - }); - } else { - return item.name; - } - - } - }, - } - - if(opts) $.extend(args, opts); - - this._super(args); - }, - setup_columns: function() { - var std_columns = [ - {id: "check", name: "Plot", field: "check", width: 30, - formatter: this.check_formatter}, - {id: "name", name: "Item", field: "name", width: 300, - formatter: this.tree_formatter}, - {id: "brand", name: "Brand", field: "brand", width: 200}, - {id: "opening", name: "Opening", field: "opening", hidden: true, - formatter: this.currency_formatter} - ]; - - this.make_date_range_columns(); - this.columns = std_columns.concat(this.columns); - }, - filters: [ - {fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)", - "Value (FIFO)", "Quantity"], - filter: function(val, item, opts, me) { - return me.apply_zero_filter(val, item, opts, me); - }}, - {fieldtype:"Select", label: "Brand", link:"Brand", - default_value: "Select Brand...", filter: function(val, item, opts) { - return val == opts.default_value || item.brand == val || item._show; - }}, - {fieldtype:"Select", label: "Warehouse", link:"Warehouse", - default_value: "Select Warehouse..."}, - {fieldtype:"Date", label: "From Date"}, - {fieldtype:"Label", label: "To"}, - {fieldtype:"Date", label: "To Date"}, - {fieldtype:"Select", label: "Range", - options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, - {fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, - {fieldtype:"Button", label: "Reset Filters"} - ], - setup_filters: function() { - var me = this; - this._super(); - - this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]); - - this.show_zero_check(); - this.setup_plot_check(); - }, - init_filter_values: function() { - this._super(); - this.filter_inputs.range && this.filter_inputs.range.val('Monthly'); - }, - prepare_data: function() { - var me = this; - - if(!this.data) { - var items = this.prepare_tree("Item", "Item Group"); - - me.parent_map = {}; - me.item_by_name = {}; - me.data = []; - - $.each(items, function(i, v) { - var d = copy_dict(v); - - me.data.push(d); - me.item_by_name[d.name] = d; - if(d.parent_item_group) { - me.parent_map[d.name] = d.parent_item_group; - } - me.reset_item_values(d); - }); - this.set_indent(); - this.data[0].checked = true; - } else { - // otherwise, only reset values - $.each(this.data, function(i, d) { - me.reset_item_values(d); - }); - } - - this.prepare_balances(); - this.update_groups(); - - }, - prepare_balances: function() { - var me = this; - var from_date = dateutil.str_to_obj(this.from_date); - var to_date = dateutil.str_to_obj(this.to_date); - var data = wn.report_dump.data["Stock Ledger Entry"]; - - this.item_warehouse = {}; - - for(var i=0, j=data.length; i. -wn.require("../app/stock/page/stock_analytics/stock_analytics.js"); +wn.require("app/js/stock_analytics.js"); wn.pages['stock-balance'].onload = function(wrapper) { wn.ui.make_app_page({ From 6ff2f6690fb5a531f1fe4498791f7c072ecf814a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 25 Dec 2012 18:39:00 +0530 Subject: [PATCH 2/9] reduced width of brand in stock analytics report --- public/js/stock_analytics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/stock_analytics.js b/public/js/stock_analytics.js index 2bdea5e010..35b3f563e1 100644 --- a/public/js/stock_analytics.js +++ b/public/js/stock_analytics.js @@ -53,7 +53,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ formatter: this.check_formatter}, {id: "name", name: "Item", field: "name", width: 300, formatter: this.tree_formatter}, - {id: "brand", name: "Brand", field: "brand", width: 200}, + {id: "brand", name: "Brand", field: "brand", width: 100}, {id: "opening", name: "Opening", field: "opening", hidden: true, formatter: this.currency_formatter} ]; From b7f0cbf91491deea57952d597e657d91b44f48cf Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 25 Dec 2012 18:43:15 +0530 Subject: [PATCH 3/9] fix in production order patch --- patches/november_2012/production_order_patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/november_2012/production_order_patch.py b/patches/november_2012/production_order_patch.py index e6a11922f1..b49cd72633 100644 --- a/patches/november_2012/production_order_patch.py +++ b/patches/november_2012/production_order_patch.py @@ -8,5 +8,5 @@ def execute(): set use_multi_level_bom = if(consider_sa_items_as_raw_materials='Yes', 0, 1)""") webnotes.conn.sql("""update `tabProduction Order` - set use_multi_level_bom = if(consider_sa_items_as_raw_materials='Yes', 0, 1) + set use_multi_level_bom = if(consider_sa_items='Yes', 0, 1) where use_multi_level_bom is null""") From da2d82cf6df1be8ce724368a8132b0e0710a9482 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 25 Dec 2012 18:45:35 +0530 Subject: [PATCH 4/9] fixes in sms control --- utilities/doctype/sms_control/sms_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/doctype/sms_control/sms_control.py b/utilities/doctype/sms_control/sms_control.py index a1a886e74f..61b45b1a76 100644 --- a/utilities/doctype/sms_control/sms_control.py +++ b/utilities/doctype/sms_control/sms_control.py @@ -41,7 +41,7 @@ class DocType: d = d.replace(x, '') # mobile no validation for erpnext gateway - if webnotes.conn.webnotes.conn.get_value('SMS Settings', None, 'sms_gateway_url'): + if webnotes.conn.get_value('SMS Settings', None, 'sms_gateway_url'): mob_no = d else: if not d.startswith("0") and len(d) == 10: From 98d588cd7d006becf5378d4d5a3fc60f994e04bd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 25 Dec 2012 18:53:25 +0530 Subject: [PATCH 5/9] deprecated form 16 print format --- .../Form 16A Print Format.txt | 20 -------------- .../page/accounts_home/accounts_home.html | 27 +------------------ .../delete_form16_print_format.py | 3 +++ patches/patch_list.py | 4 +++ 4 files changed, 8 insertions(+), 46 deletions(-) delete mode 100644 accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt create mode 100644 patches/december_2012/delete_form16_print_format.py diff --git a/accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt b/accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt deleted file mode 100644 index 2e5436bb0e..0000000000 --- a/accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2010-09-27 17:30:34", - "modified_by": "Administrator", - "modified": "2011-10-19 14:19:27" - }, - { - "name": "__common__", - "module": "Accounts", - "standard": "Yes", - "html": "\n \n\n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n

FORM No. 16 A

\n

Certificate No:

\n

[See rule 31 (1)(b)]

\n

Certifiction of deduction of tax at source under section 203 of the Income-tax Act, 1961

\n

[For interest on securities; dividends; interests other than 'interests on securities';winnings from lottery or crossword puzzle;\n winnings from horse race; payments to contractors and sub-contractors;insurance comission;payments to\n \n non-resident sportsmen/ sports associations;payments in respect of deposits under National Savings Scheme:\n payments on account of repurchase of units by Mutual Fund or Unit Trust of India; commission, remuneration or prize\n \n on sale of lottery tickets; comission or brokerage;rent;fees for professional or technical services;royalty and any sum \n under section 28(va);income in respect of units; payment of compensation on acquisition of certain immovable property;\n\n other sums under section 195; income in respect of units of non-residents referred to in section 196A; income from units\n referred to in section 196B;income from foreign currency bonds or shares of an Indian Company referred to in section

\n 196C; income of Foreign Institutional Investors from securities referred to in section 196D]\n
Name and address of person deducing taxAcknowledgement No.s of all quarterly statements of TDS under sub-section(3) of section 200 as provided by TIN Facilitation Centre or NSDL web-siteName and address of the person to whom payment is made or in whose account it is credited
\n \n

\n \n
\n
\n \n \n \n

\n \n
\n
\n \n Registration Details OF THE DEDUCTOR
\n \n
\n
\n \n
NATURE OF PAYMENT


\n
\n \n
\n
\n \n PAN NO. OF THE PAYEE
\n \n \n
\n
DETAILS OF PAYMENT, TAX DEDUCTION AND DEPOSIT OF TAX INTO CENTRAL GOVERNMENT ACCOUNT\n

(The deductor is to provide transaction wise details of tax deducted and deposited)

\n
\n \n
\n Certified that a sum of Rs. has been deducted at source and paid to the credit of the Central Government as per details given above



\n

Signature of person responsible for deduction of tax \n

\n \n \n \n \n \n \n \n \n \n
Place: Full Name:
Date: Designation:
\n
\n\n", - "doctype": "Print Format" - }, - { - "name": "Form 16A Print Format", - "doctype": "Print Format" - } -] \ No newline at end of file diff --git a/accounts/page/accounts_home/accounts_home.html b/accounts/page/accounts_home/accounts_home.html index 0e71487c26..498f811732 100644 --- a/accounts/page/accounts_home/accounts_home.html +++ b/accounts/page/accounts_home/accounts_home.html @@ -123,33 +123,8 @@
-
Tax Deduction (India)
+
India Specific
- - - - -
- Form 16A -
Date: Tue, 25 Dec 2012 20:57:00 +0530 Subject: [PATCH 6/9] support system fetching now replyed emails --- support/doctype/support_ticket/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/doctype/support_ticket/__init__.py b/support/doctype/support_ticket/__init__.py index a53c76b939..0295e32ec7 100644 --- a/support/doctype/support_ticket/__init__.py +++ b/support/doctype/support_ticket/__init__.py @@ -81,7 +81,7 @@ class SupportMailbox(POP3Mailbox): if exists and exists[0] and exists[0][0]: st = webnotes.get_obj('Support Ticket', thread_id) - from support.doctype.communication.communication import make + from core.doctype.communication.communication import make make(content=content, sender=full_email_id, doctype="Support Ticket", name=thread_id, lead = st.doc.lead, contact=st.doc.contact) From 5ea807829a03d6c1db9e2a355cf828eec8e5437d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 27 Dec 2012 13:07:50 +0530 Subject: [PATCH 7/9] added company in lead list --- selling/doctype/lead/lead_list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selling/doctype/lead/lead_list.js b/selling/doctype/lead/lead_list.js index 227a2329a4..a56602144b 100644 --- a/selling/doctype/lead/lead_list.js +++ b/selling/doctype/lead/lead_list.js @@ -5,6 +5,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({ 'tabLead.lead_name', 'tabLead.status', 'tabLead.source', + 'tabLead.company', 'tabLead.modified_by' ]); this.stats = this.stats.concat(['status', 'source', 'rating', 'company']); @@ -29,7 +30,8 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({ {width: '5%', content:'avatar_modified'}, {width: '30%', content:'lead_name'}, {width: '12%', content:'status_html'}, - {width: '38%', content:'lead_status+tags', css: {color:'#222'}}, + {width: '15%', content:'lead_status+tags', css: {color:'#222'}}, + {width: '23%', content: 'company'}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] }) From bde1f4f454d2d9bbbd4408b50f33ec6b3d945b18 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 27 Dec 2012 13:32:11 +0530 Subject: [PATCH 8/9] minor fix in support ticket --- selling/doctype/customer/customer.js | 2 +- support/doctype/support_ticket/support_ticket.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/selling/doctype/customer/customer.js b/selling/doctype/customer/customer.js index 845f543467..9c748e6e8c 100644 --- a/selling/doctype/customer/customer.js +++ b/selling/doctype/customer/customer.js @@ -60,7 +60,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn) { cur_frm.communication_view = new wn.views.CommunicationList({ list: wn.model.get("Communication", {"customer": doc.name}), parent: cur_frm.fields_dict.communication_html.wrapper, - doc: doc + doc: doc, }); } } diff --git a/support/doctype/support_ticket/support_ticket.js b/support/doctype/support_ticket/support_ticket.js index 3e607fbb25..3484bf346e 100644 --- a/support/doctype/support_ticket/support_ticket.js +++ b/support/doctype/support_ticket/support_ticket.js @@ -51,6 +51,7 @@ $.extend(cur_frm.cscript, { var comm_list = wn.model.get("Communication", {"support_ticket": doc.name}) comm_list.push({ "sender": doc.raised_by, + "creation": doc.creation, "modified": doc.creation, "content": doc.description}); From a85b2e4ee349c544acb7a1949351e9a7c70f7b7c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 27 Dec 2012 13:52:47 +0530 Subject: [PATCH 9/9] show company name in lead list --- selling/doctype/lead/lead_list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selling/doctype/lead/lead_list.js b/selling/doctype/lead/lead_list.js index a56602144b..21f0ffd61f 100644 --- a/selling/doctype/lead/lead_list.js +++ b/selling/doctype/lead/lead_list.js @@ -5,7 +5,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({ 'tabLead.lead_name', 'tabLead.status', 'tabLead.source', - 'tabLead.company', + 'tabLead.company_name', 'tabLead.modified_by' ]); this.stats = this.stats.concat(['status', 'source', 'rating', 'company']); @@ -31,7 +31,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({ {width: '30%', content:'lead_name'}, {width: '12%', content:'status_html'}, {width: '15%', content:'lead_status+tags', css: {color:'#222'}}, - {width: '23%', content: 'company'}, + {width: '23%', content: 'company_name'}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] })