mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-30 12:08:26 +00:00
[search criteria] [cleanup] removed search criteria folders and files
This commit is contained in:
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,32 +0,0 @@
|
||||
// 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();
|
||||
|
||||
//this.add_filter({fieldname:'item_code', label:'Item Code', fieldtype:'Link', options:'Item',ignore : 1,parent:'Delivery Note Item'});
|
||||
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Project Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Customer'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Customer Name'].df.filter_hide = 0;
|
||||
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Project Name'].df.in_first_page = 1;
|
||||
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "harshada@webnotestech.com",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-04-03 12:49:52",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:52"
|
||||
},
|
||||
{
|
||||
"parent_doc_type": "Delivery Note",
|
||||
"module": "Projects",
|
||||
"standard": "Yes",
|
||||
"sort_order": "DESC",
|
||||
"filters": "{'Delivery Note\u0001Submitted':1,'Delivery Note\u0001Status':'Submitted','Delivery Note\u0001Fiscal Year':''}",
|
||||
"doc_type": "Delivery Note Item",
|
||||
"name": "__common__",
|
||||
"add_cond": "IFNULL(`tabDelivery Note`.`project_name`,\"\")!=\"\"",
|
||||
"doctype": "Search Criteria",
|
||||
"sort_by": "`tabDelivery Note`.`name`",
|
||||
"page_len": 50,
|
||||
"criteria_name": "Projectwise Delivered Qty and Costs",
|
||||
"columns": "Delivery Note\u0001ID,Delivery Note\u0001Project Name,Delivery Note\u0001Customer,Delivery Note\u0001Customer Name,Delivery Note Item\u0001Item Code,Delivery Note Item\u0001Item Name,Delivery Note Item\u0001Quantity,Delivery Note\u0001Posting Date,Delivery Note\u0001% Billed,Delivery Note Item\u0001Amount*"
|
||||
},
|
||||
{
|
||||
"name": "projectwise_delivered_qty_and_costs",
|
||||
"doctype": "Search Criteria"
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,31 +0,0 @@
|
||||
// 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();
|
||||
|
||||
//this.add_filter({fieldname:'item_code', label:'Item Code', fieldtype:'Link', options:'Item',ignore : 1,parent:'Sales Order Item'});
|
||||
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Project Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Customer'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Customer Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Project Name'].df.in_first_page = 1;
|
||||
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "ashwini@webnotestech.com",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-04-03 12:49:52",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:52"
|
||||
},
|
||||
{
|
||||
"add_col": "SUM(`tabSales Order Item`.`qty` - `tabSales Order Item`.`delivered_qty`) AS 'Pending Qty'\nSUM((`tabSales Order Item`.`qty` - `tabSales Order Item`.`delivered_qty`)* `tabSales Order Item`.basic_rate) AS 'Pending Amount'",
|
||||
"parent_doc_type": "Sales Order",
|
||||
"module": "Projects",
|
||||
"standard": "Yes",
|
||||
"sort_order": "DESC",
|
||||
"filters": "{'Sales Order\u0001Submitted':1,'Sales Order\u0001Status':'Submitted','Sales Order\u0001Fiscal Year':''}",
|
||||
"doc_type": "Sales Order Item",
|
||||
"name": "__common__",
|
||||
"add_cond": "`tabSales Order Item`.`qty` > `tabSales Order Item`.`delivered_qty`\nIFNULL(`tabSales Order`.`project_name`,\"\")!=\"\"\n`tabSales Order`.order_type = 'Sales'",
|
||||
"doctype": "Search Criteria",
|
||||
"sort_by": "`tabSales Order`.`name`",
|
||||
"page_len": 50,
|
||||
"criteria_name": "Projectwise Pending Qty and Costs",
|
||||
"columns": "Sales Order\u0001ID,Sales Order\u0001Project Name,Sales Order\u0001Customer,Sales Order\u0001Customer Name,Sales Order Item\u0001Item Code,Sales Order Item\u0001Item Name,Sales Order\u0001% Delivered,Sales Order\u0001% Billed,Sales Order\u0001Sales Order Date,Sales Order\u0001Expected Delivery Date"
|
||||
},
|
||||
{
|
||||
"name": "projectwise_pending_qty_and_costs",
|
||||
"doctype": "Search Criteria"
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,108 +0,0 @@
|
||||
// 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() {
|
||||
//hide all filters
|
||||
//------------------------------------------------
|
||||
this.hide_all_filters();
|
||||
|
||||
//add filters
|
||||
//------------------------------------------------
|
||||
this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Purchase Order'+NEWLINE+'Purchase Invoice'+NEWLINE+'Purchase Receipt',report_default:'Purchase Order',ignore : 1,parent:'Purchase Order', single_select:1});
|
||||
|
||||
this.add_filter({fieldname:'purchase_order', label:'Purchase Order', fieldtype:'Link', options:'Purchase Order', ignore : 1, parent:'Purchase Order'});
|
||||
this.add_filter({fieldname:'purchase_receipt', label:'Purchase Receipt',fieldtype:'Link', options:'Purchase Receipt',ignore : 1, parent:'Purchase Order'});
|
||||
this.add_filter({fieldname:'purchase_invoice', label:'Purchase Invoice',fieldtype:'Link', options:'Purchase Invoice',ignore : 1, parent:'Purchase Order'});
|
||||
|
||||
//unhide filters
|
||||
//------------------------------------------------
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Project Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
|
||||
//move filter field in first page
|
||||
//------------------------------------------------
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Based On'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Project Name'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Purchase Order'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Purchase Invoice'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Purchase Receipt'].df.in_first_page = 1;
|
||||
|
||||
// default values
|
||||
//------------------------------------------------
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Purchase Order'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
}
|
||||
|
||||
//hide select columns field
|
||||
//------------------------------------------------
|
||||
this.mytabs.items['Select Columns'].hide();
|
||||
|
||||
|
||||
report.get_query = function() {
|
||||
|
||||
//get filter values
|
||||
based_on = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Based On'].get_value();
|
||||
purchase_order = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Purchase Order'].get_value();
|
||||
purchase_invoice = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Purchase Invoice'].get_value();
|
||||
purchase_receipt = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Purchase Receipt'].get_value();
|
||||
project_name = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Project Name'].get_value();
|
||||
company = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Company'].get_value();
|
||||
fy = this.filter_fields_dict['Purchase Order'+FILTER_SEP+'Fiscal Year'].get_value();
|
||||
|
||||
// make query based on transaction
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
var cond = '';
|
||||
//for purchase order
|
||||
if(based_on == 'Purchase Order'){
|
||||
|
||||
if(purchase_order) cond += ' AND `tabPurchase Order`.name = "'+purchase_order+'"';
|
||||
if(project_name) cond += ' AND `tabPurchase Order`.project_name = "'+project_name+'"';
|
||||
if(company) cond += ' AND `tabPurchase Order`.company = "'+company+'"';
|
||||
if(fy !='') cond += ' AND `tabPurchase Order`.fiscal_year = "'+fy+'"';
|
||||
|
||||
var q = 'SELECT DISTINCT `tabPurchase Order`.name, `tabPurchase Order`.status, `tabPurchase Order`.project_name, `tabPurchase Order`.supplier,`tabPurchase Order`.supplier_name,`tabPurchase Order`.per_received, `tabPurchase Order`.per_billed, `tabPurchase Order`.grand_total FROM `tabPurchase Order` WHERE IFNULL(`tabPurchase Order`.project_name,"") != ""'+cond+' AND `tabPurchase Order`.docstatus != 2';
|
||||
return q;
|
||||
}
|
||||
|
||||
//for purchase receipt
|
||||
else if(based_on == 'Purchase Receipt'){
|
||||
if(purchase_order) cond += ' t2.purchase_order = "'+purchase_order+'" AND ';
|
||||
if(purchase_receipt) cond += ' t1.name = "'+purchase_receipt+'" AND ';
|
||||
if(project_name) cond += ' t1.project_name = "'+project_name+'" AND ';
|
||||
if(company) cond += ' t1.company = "'+company+'" AND ';
|
||||
if(fy !='') cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name, t1.status, t1.project_name, t1.supplier, t1.supplier_name,t1.grand_total FROM `tabPurchase Receipt` t1, `tabPurchase Receipt Item` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
|
||||
return q;
|
||||
}
|
||||
//for purchase invoice
|
||||
else if(based_on == 'Purchase Invoice'){
|
||||
if(purchase_order) cond += ' t2.purchase_order = "'+purchase_order+'" AND ';
|
||||
if(purchase_receipt) cond += ' t2.purchase_receipt = "'+purchase_receipt+'" AND';
|
||||
if(purchase_invoice) cond += ' t1.name = "'+purchase_invoice+'" AND';
|
||||
if(project_name) cond += ' t1.project_name = "'+project_name+'" AND ';
|
||||
if(company) cond += ' t1.company = "'+company+'" AND ';
|
||||
if(fy !='') cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name , t1.credit_to , t1.project_name, t1.supplier, t1.supplier_name , t1.grand_total FROM `tabPurchase Invoice` t1, `tabPurchase Invoice Item` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
|
||||
return q;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
# 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
|
||||
based_on = filter_values.get('based_on')
|
||||
# make default columns
|
||||
#for r in res:
|
||||
col = []
|
||||
if based_on == 'Purchase Order':
|
||||
col = [['Purchase Order ID','Link','Purchase Order'],['Status','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['% Received','Data',''],['% Billed','Data',''],['Grand Total','Currency','']]
|
||||
|
||||
elif based_on == 'Purchase Invoice':
|
||||
col = [['Purchase Receipt ID','Link','Purchase Invoice'],['Status','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['Grand Total','Currency','']]
|
||||
|
||||
elif based_on == 'Purchase Receipt':
|
||||
col = [['Purchase Invoice ID','Link','Purchase Receipt'],['Credit To','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['Grand Total','Currency','']]
|
||||
|
||||
|
||||
for c in col:
|
||||
colnames.append(c[0])
|
||||
coltypes.append(c[1])
|
||||
coloptions.append(c[2])
|
||||
l = (len(c[0])*9)
|
||||
if l < 150 : col_width = '150px'
|
||||
else: col_width = '%spx'%(l)
|
||||
colwidths.append(col_width)
|
||||
col_idx[c[0]] = len(colnames)-1
|
||||
@@ -1,24 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "ashwini@webnotestech.com",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-04-03 12:49:52",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:52"
|
||||
},
|
||||
{
|
||||
"doc_type": "Purchase Order",
|
||||
"name": "__common__",
|
||||
"module": "Projects",
|
||||
"doctype": "Search Criteria",
|
||||
"sort_order": "DESC",
|
||||
"filters": "{'Purchase Order\u0001Status':'','Purchase Order\u0001Fiscal Year':''}",
|
||||
"page_len": 50,
|
||||
"criteria_name": "Projectwise Purchase Details",
|
||||
"standard": "Yes"
|
||||
},
|
||||
{
|
||||
"name": "projectwise_purchase_details",
|
||||
"doctype": "Search Criteria"
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,112 +0,0 @@
|
||||
// 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() {
|
||||
//hide all filters
|
||||
//------------------------------------------------
|
||||
this.hide_all_filters();
|
||||
|
||||
//add filters
|
||||
//------------------------------------------------
|
||||
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 Order', single_select:1});
|
||||
|
||||
this.add_filter({fieldname:'sales_order', label:'Sales Order', fieldtype:'Link', options:'Sales Order', ignore : 1, parent:'Sales Order'});
|
||||
this.add_filter({fieldname:'delivery_note', label:'Delivery Note', fieldtype:'Link', options:'Delivery Note',ignore : 1, parent:'Sales Order'});
|
||||
this.add_filter({fieldname:'sales_invoice', label:'Sales Invoice',fieldtype:'Link', options:'Sales Invoice',ignore : 1, parent:'Sales Order'});
|
||||
|
||||
//unhide filters
|
||||
//------------------------------------------------
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Project Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Customer'].df.filter_hide = 0;
|
||||
|
||||
//move filter field in first page
|
||||
//------------------------------------------------
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Based On'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Project Name'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Sales Order'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Delivery Note'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Sales Invoice'].df.in_first_page = 1;
|
||||
|
||||
// default values
|
||||
//------------------------------------------------
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
|
||||
}
|
||||
|
||||
//hide select columns field
|
||||
//------------------------------------------------
|
||||
//this.mytabs.items['Select Columns'].hide();
|
||||
|
||||
|
||||
report.get_query = function() {
|
||||
|
||||
//get filter values
|
||||
based_on = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Based On'].get_value();
|
||||
sales_order = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Sales Order'].get_value();
|
||||
delivery_note = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Delivery Note'].get_value();
|
||||
sales_invoice = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Sales Invoice'].get_value();
|
||||
project_name = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Project Name'].get_value();
|
||||
company = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Company'].get_value();
|
||||
fy = this.filter_fields_dict['Sales Order'+FILTER_SEP+'Fiscal Year'].get_value();
|
||||
|
||||
// make query based on transaction
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
var cond = '';
|
||||
//for sales order
|
||||
if(based_on == 'Sales Order'){
|
||||
|
||||
if(sales_order) cond += ' AND `tabSales Order`.name = "'+sales_order+'"';
|
||||
if(project_name) cond += ' AND `tabSales Order`.project_name = "'+project_name+'"';
|
||||
if(company) cond += ' AND `tabSales Order`.company = "'+company+'"';
|
||||
if(fy) cond += ' AND `tabSales Order`.fiscal_year = "'+fy+'"';
|
||||
|
||||
var q = 'SELECT DISTINCT `tabSales Order`.name, `tabSales Order`.order_type, `tabSales Order`.status, `tabSales Order`.project_name, `tabSales Order`.customer,`tabSales Order`.customer_name,`tabSales Order`.per_delivered, `tabSales Order`.per_billed, `tabSales Order`.grand_total FROM `tabSales Order` WHERE IFNULL(`tabSales Order`.project_name,"") != ""'+cond+' AND `tabSales Order`.docstatus != 2';
|
||||
return q;
|
||||
}
|
||||
|
||||
//for delivery note
|
||||
else if(based_on == 'Delivery Note'){
|
||||
if(sales_order) cond += ' t1.name = t2.parent AND t2.prevdoc_docname = "'+sales_order+'" AND ';
|
||||
if(delivery_note) cond += ' t1.name = "'+delivery_note+'" AND ';
|
||||
if(project_name) cond += ' t1.project_name = "'+project_name+'" AND ';
|
||||
if(company) cond += ' t1.company = "'+company+'" AND ';
|
||||
if(fy) cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name, t1.status, t1.project_name, t1.customer, t1.customer_name, t1.per_billed, t1.per_installed, t1.grand_total FROM `tabDelivery Note` t1, `tabDelivery Note Item` t2 WHERE '+cond+' IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2';
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
//for sales invoice
|
||||
else if(based_on == 'Sales Invoice'){
|
||||
if(sales_order) cond += ' t2.sales_order = "'+sales_order+'" AND ';
|
||||
if(delivery_note) cond += ' t2.delivery_note = "'+delivery_note+'" AND ';
|
||||
if(sales_invoice) cond += ' t1.name = "'+sales_invoice+'" AND ';
|
||||
if(project_name) cond += ' t1.project_name = "'+project_name+'" AND ';
|
||||
if(company) cond += ' t1.company = "'+company+'" AND ';
|
||||
if(fy) cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name , t1.debit_to , t1.project_name , t1.customer , t1.customer_name , t1.grand_total FROM `tabSales Invoice` t1, `tabSales Invoice Item` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
# 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
|
||||
based_on = filter_values.get('based_on')
|
||||
|
||||
cols=[]
|
||||
|
||||
if based_on == 'Sales Order':
|
||||
cols = [['Sales Order No','Link','150px','Sales Order'], ['Order Type','Data','100px',''], ['Status','Data','100px',''], ['Project Name','Link','150px','Project'], ['Customer','Link','150px','Customer'], ['Customer Name','Data','200px',''], ['% Delivered','Currency','100px',''], ['% Billed','Currency','100px',''], ['Grand Total','Currency','150px','']]
|
||||
|
||||
elif based_on == 'Delivery Note':
|
||||
cols = [['Delivery Note No','Link','150px','Delivery Note'], ['Status','Data','100px',''], ['Project Name','Link','200px','Project'], ['Customer','Link','150px','Customer'], ['Customer Name','Data','200px',''], ['% Installed','Currency','100px',''], ['% Billed','Currency','100px',''], ['Grand Total','Currency','150px','']]
|
||||
|
||||
elif based_on == 'Sales Invoice':
|
||||
cols = [['Sales Invoice No','Link','150px','Sales Invoice'], ['Debit To','Data','150px',''], ['Project Name','Link','200px','Project'], ['Customer','Link','150px','Customer'], ['Customer Name','Data','200px',''], ['Grand Total','Currency','150px','']]
|
||||
|
||||
|
||||
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
|
||||
@@ -1,24 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "harshada@webnotestech.com",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-04-03 12:49:52",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:52"
|
||||
},
|
||||
{
|
||||
"doc_type": "Sales Order",
|
||||
"name": "__common__",
|
||||
"module": "Projects",
|
||||
"doctype": "Search Criteria",
|
||||
"sort_order": "DESC",
|
||||
"filters": "{'Sales Order\u0001Saved':1,'Sales Order\u0001Submitted':1,'Sales Order\u0001Status':''}",
|
||||
"page_len": 50,
|
||||
"criteria_name": "Projectwise Sales Details",
|
||||
"standard": "Yes"
|
||||
},
|
||||
{
|
||||
"name": "projectwise_sales_details",
|
||||
"doctype": "Search Criteria"
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,27 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "harshada@webnotestech.com",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-04-03 12:49:52",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:52"
|
||||
},
|
||||
{
|
||||
"module": "Projects",
|
||||
"standard": "Yes",
|
||||
"sort_order": "DESC",
|
||||
"filters": "{'Sales Order\u0001Saved':1,'Sales Order\u0001Submitted':1,'Sales Order\u0001Status':'','Sales Order\u0001Fiscal Year':''}",
|
||||
"doc_type": "Sales Order",
|
||||
"name": "__common__",
|
||||
"add_cond": "ifnull(`tabSales Order`.project_name ,'') != ''",
|
||||
"doctype": "Search Criteria",
|
||||
"sort_by": "`tabSales Order`.`name`",
|
||||
"page_len": 50,
|
||||
"criteria_name": "Projectwise Sales Orders",
|
||||
"columns": "Sales Order\u0001ID,Sales Order\u0001Status,Sales Order\u0001Project Name,Sales Order\u0001Customer,Sales Order\u0001Sales Order Date,Sales Order\u0001Expected Delivery Date,Sales Order\u0001Quotation No,Sales Order\u0001% Delivered,Sales Order\u0001% Billed,Sales Order\u0001Grand Total*"
|
||||
},
|
||||
{
|
||||
"name": "projectwise_sales_orders",
|
||||
"doctype": "Search Criteria"
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,23 +0,0 @@
|
||||
// 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.filter_fields_dict['Timesheet Detail'+FILTER_SEP +'Project Name'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Timesheet Detail'+FILTER_SEP +'Task Id'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Timesheet'+FILTER_SEP +'Timesheet by'].df.filter_hide = 1;
|
||||
}
|
||||
|
||||
//this.mytabs.items['Select Columns'].hide()
|
||||
@@ -1,27 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "ashwini@webnotestech.com",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-04-03 12:49:53",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:53"
|
||||
},
|
||||
{
|
||||
"parent_doc_type": "Timesheet",
|
||||
"module": "Projects",
|
||||
"standard": "Yes",
|
||||
"sort_order": "DESC",
|
||||
"filters": "{'Timesheet\u0001Saved':1,'Timesheet\u0001Submitted':1}",
|
||||
"doc_type": "Timesheet Detail",
|
||||
"name": "__common__",
|
||||
"doctype": "Search Criteria",
|
||||
"sort_by": "`tabTimesheet`.`name`",
|
||||
"page_len": 50,
|
||||
"criteria_name": "Timesheet Report",
|
||||
"columns": "Timesheet\u0001ID,Timesheet\u0001Timesheet Date,Timesheet\u0001Timesheet by,Timesheet Detail\u0001Project Name,Timesheet Detail\u0001Task Id,Timesheet Detail\u0001Task Name,Timesheet Detail\u0001Actual Start Time,Timesheet Detail\u0001Actual End Time,Timesheet Detail\u0001Total Hours (Actual)"
|
||||
},
|
||||
{
|
||||
"name": "timesheet_report",
|
||||
"doctype": "Search Criteria"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user