moved directory structure

This commit is contained in:
Rushabh Mehta
2012-09-24 19:13:42 +05:30
parent e47a6779e9
commit 2fa2f7178d
1637 changed files with 47 additions and 11450 deletions

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,56 @@
// 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.hide_all_filters();
//Add filter
this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice', report_default:'Sales Order', ignore : 1,parent:'Sales Person', single_select :1, in_first_page:1});
this.add_filter({fieldname:'transaction_date', label:'Date', fieldtype:'Date', options:'', ignore : 1,parent:'Sales Person', in_first_page:1});
this.add_filter({fieldname:'voucher_id', label:'Voucher Id', fieldtype:'Data', options:'', ignore : 1,parent:'Sales Person', in_first_page:1});
this.add_filter({fieldname:'territory', label:'Territory', fieldtype:'Link', options:'Territory', ignore : 1,parent:'Sales Person', in_first_page:1});
this.add_filter({fieldname:'sales_person', label:'Sales Person', fieldtype:'Link', options:'Sales Person', ignore : 1,parent:'Sales Person', in_first_page:1});
}
// hide sections
this.mytabs.items['More Filters'].hide();
this.mytabs.items['Select Columns'].hide();
// Get query
report.get_query = function() {
based_on = this.get_filter('Sales Person', 'Based On').get_value();
from_date = this.get_filter('Sales Person', 'From Date').get_value();
to_date = this.get_filter('Sales Person', 'To Date').get_value();
vid = this.get_filter('Sales Person', 'Voucher Id').get_value();
terr = this.get_filter('Sales Person', 'Territory').get_value();
sp = this.get_filter('Sales Person', 'Sales Person').get_value();
date_fld = 'transaction_date';
if(based_on == 'Sales Invoice') {
based_on = 'Sales Invoice';
date_fld = 'posting_date';
}
sp_cond = '';
if (from_date) sp_cond += ' AND t1.' + date_fld + '>= "' + from_date + '"';
if (to_date) sp_cond += ' AND t1.' + date_fld + '<= "' + to_date + '"';
if (vid) sp_cond += ' AND t1.name LIKE "%' + vid + '%"';
if (terr) sp_cond += ' AND t1.territory = "' + terr + '"';
if (sp) sp_cond += ' AND t2.sales_person = "' + sp + '"';
return 'SELECT t1.`name`, t1.`customer_name`, t1.`territory`, t1.`' + date_fld + '`, t1.`net_total`, t1.`grand_total`, t2.`sales_person`, t2.`allocated_percentage`, t2.`allocated_amount` FROM `tab' + based_on + '` t1, `tabSales Team` t2 WHERE t1.docstatus=1 AND t2.`parenttype` = "' + based_on + '" AND t2.`parent` = t1.`name`' + sp_cond + ' ORDER BY t1.`name` DESC';
}

View File

@@ -0,0 +1,30 @@
# 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/>.
from __future__ import unicode_literals
if filter_values.get('based_on') == 'Sales Invoice':
based_on_dt = 'Sales Invoice'
else:
based_on_dt = filter_values.get('based_on')
cols = [[filter_values.get('based_on'), 'Link','150px', based_on_dt], ['Customer', 'Link','150px','Customer'], ['Territory', 'Link','120px','Territory'], ['Transaction Date', 'Date', '120px', ''], ['Net Total', 'Currency', '80px', ''], ['Grand Total', 'Currency', '80px', ''], ['Sales Person', 'Link', '150px', 'Sales Person'], ['% Contribution', 'Currency', '120px', ''], ['Contribution Amt', 'Currency', '120px', '']]
for c in cols:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)-1

View File

@@ -0,0 +1,33 @@
# Search Criteria, sales_personwise_transaction_summary
[
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:52',
'docstatus': 0,
'modified': '2012-04-03 12:49:52',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Search Criteria
{
'columns': u'Sales Person\x01ID',
'criteria_name': u'Sales Personwise Transaction Summary',
'doc_type': u'Sales Person',
'doctype': 'Search Criteria',
'filters': u"{'Sales Person\x01Saved':1,'Sales Person\x01Submitted':1,'Sales Person\x01Country':'','Sales Person\x01State':''}",
'module': u'Selling',
'name': '__common__',
'page_len': 50,
'sort_by': u'`tabSales Person`.`name`',
'sort_order': u'DESC',
'standard': u'Yes'
},
# Search Criteria, sales_personwise_transaction_summary
{
'doctype': 'Search Criteria',
'name': u'sales_personwise_transaction_summary'
}
]