[report] deleted old reports based on search_criteria
diff --git a/accounts/page/accounts_home/accounts_home.js b/accounts/page/accounts_home/accounts_home.js
index 07c8b66..31660eb 100644
--- a/accounts/page/accounts_home/accounts_home.js
+++ b/accounts/page/accounts_home/accounts_home.js
@@ -171,11 +171,6 @@
page: "financial-analytics"
},
{
- "label":wn._("Trend Analyzer"),
- route: "Report/Profile/Trend Analyzer",
- doctype: "Sales Invoice"
- },
- {
"label":wn._("Gross Profit"),
route: "query-report/Gross Profit",
doctype: "Sales Invoice"
diff --git a/accounts/search_criteria/__init__.py b/accounts/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/accounts_payable/__init__.py b/accounts/search_criteria/accounts_payable/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/accounts_payable/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.js b/accounts/search_criteria/accounts_payable/accounts_payable.js
deleted file mode 100644
index 8d8f1ab..0000000
--- a/accounts/search_criteria/accounts_payable/accounts_payable.js
+++ /dev/null
@@ -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/>.
-
-report.customize_filters = function() {
- this.hide_all_filters();
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
-
- this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Purchase Invoice', report_default:'Aging Date'});
- this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:30});
- this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:45});
- this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:60});
- this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:90});
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default']=dateutil.obj_to_str(new Date());
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
-
- this.dt.set_no_limit(1);
-}
-
-this.mytabs.items['Select Columns'].hide()
\ No newline at end of file
diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.py b/accounts/search_criteria/accounts_payable/accounts_payable.py
deleted file mode 100644
index 3a5b899..0000000
--- a/accounts/search_criteria/accounts_payable/accounts_payable.py
+++ /dev/null
@@ -1,183 +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/>.
-
-# Check mandatory filters
-# ------------------------------------------------------------------
-
-from __future__ import unicode_literals
-if not filter_values.get('posting_date1'):
- msgprint("Please select To Posting Date ")
- raise Exception
-else:
- to_date = filter_values.get('posting_date1')
-
-if not filter_values['range_1'] or not filter_values['range_2'] \
- or not filter_values['range_3'] or not filter_values['range_4']:
- msgprint("Please select aging ranges in no of days in 'More Filters' ")
- raise Exception
-
-# validate Range
-range_list = ['range_1','range_2','range_3','range_4']
-for r in range(len(range_list)-1):
- if not cint(filter_values[range_list[r]]) < cint(filter_values[range_list[r + 1]]):
- msgprint("Range %s should be less than Range %s." % (cstr(r+1),cstr(r+2)))
- raise Exception
-
-
-# Add columns
-# ------------------------------------------------------------------
-data = [['Aging Date','Date','80px',''],
- ['Account','Data','120px',''],
- ['Against Voucher Type','Data','120px',''],
- ['Against Voucher','Data','120px',''],
- ['Voucher Type','Data','120px',''],
- ['Voucher No','Data','120px',''],
- ['Remarks','Data','160px',''],
- ['Supplier Type', 'Data', '80px', ''],
- ['Due Date', 'Data', '80px', ''],
- ['Bill No','Data','80px',''],
- ['Bill Date','Data','80px',''],
- ['Opening Amt','Currency','120px',''],
- ['Outstanding Amt','Currency','120px',''],
- ['Age (Days)', 'Currency', '150px', ''],
- ['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
- [cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
- [cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
- [cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
- [cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
-
-
-for d in data:
- colnames.append(d[0])
- coltypes.append(d[1])
- colwidths.append(d[2])
- coloptions.append(d[3])
- col_idx[d[0]] = len(colnames)-1
-
-# ageing based on
-# ------------------------------------------------------------------
-aging_based_on = 'Aging Date'
-if filter_values.has_key('aging_based_on') and filter_values['aging_based_on']:
- aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1]
-
-if len(res) > 2000 and from_export == 0:
- msgprint("""This is a very large report and cannot be shown in the browser
- as it is likely to make your browser very slow.
- Please select Account or click on 'Export' to open in excel""", raise_exception=1)
-
-# get supplier type
-supp_type_dict = {}
-for each in sql("""select t2.name, t1.supplier_type from tabSupplier t1, tabAccount t2
- where t1.name = t2.account_name group by t2.name"""):
- supp_type_dict[each[0]] = each[1]
-
-# get due_date, bill_no, bill_date from PV
-pv_dict = {}
-for t in sql("""select name, due_date, bill_no, bill_date
- from `tabPurchase Invoice` group by name"""):
- pv_dict[t[0]] = [cstr(t[1]), t[2], cstr(t[3])]
-
-# pv after to-date
-pv_after_to_date = [d[0] for d in sql("""select distinct name from `tabPurchase Invoice`
- where posting_date > %s and docstatus = 1""", (to_date,))]
-
-
-from webnotes.utils import nowdate
-
-out = []
-total_booking_amt, total_outstanding_amt = 0,0
-
-for r in res:
- outstanding_amt, due_date, bill_no, bill_date, cond = 0, '','','', ''
- booking_amt = r.pop(7)
-
- # supplier type
- r.append(supp_type_dict.get(r[col_idx['Account']], ''))
-
- if r[col_idx['Voucher Type']] == 'Purchase Invoice':
- r += pv_dict.get(r[col_idx['Voucher No']], ['', '', ''])
- else:
- r += ['', '', '']
-
- # if entry against Purchase Invoice
- if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Purchase Invoice':
- cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']]
-
- # if entry against JV & and not adjusted within period
- elif r[col_idx['Against Voucher Type']] == 'Purchase Invoice' \
- and r[col_idx['Against Voucher']] in pv_after_to_date:
- booking_amt = 0
- cond = """ and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'""" \
- % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
-
- # if un-adjusted
- elif not r[col_idx['Against Voucher']]:
- booking_amt = 0
- cond = """ and ((voucher_no = '%s' and ifnull(against_voucher, '') = '')
- or (ifnull(against_voucher, '') = '%s' and voucher_type = 'Journal Voucher'))""" \
- % (r[col_idx['Voucher No']], r[col_idx['Voucher No']])
-
- if cond:
- outstanding_amt = flt(sql("""select sum(ifnull(credit, 0))-sum(ifnull(debit, 0))
- from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'No'
- and posting_date <= %s %s"""
- % ('%s', '%s', cond), (r[col_idx['Account']], to_date,))[0][0] or 0)
-
- # add to total outstanding
- total_outstanding_amt += flt(outstanding_amt)
-
- # add to total booking amount
- if outstanding_amt and r[col_idx['Voucher Type']] == 'Purchase Invoice' \
- and r[col_idx['Against Voucher']]:
- total_booking_amt += flt(booking_amt)
-
- r += [booking_amt, outstanding_amt]
-
- # split into date ranges
- val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above= 0
- if r[col_idx[aging_based_on]]:
- if getdate(to_date) > getdate(nowdate()):
- to_date = nowdate()
- diff = (getdate(to_date) - getdate(r[col_idx[aging_based_on]])).days
- if diff < cint(filter_values['range_1']):
- val_l1 = outstanding_amt
- if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
- val_l2 = outstanding_amt
- if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
- val_l3 = outstanding_amt
- if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
- val_l4 = outstanding_amt
- if diff >= cint(filter_values['range_4']):
- val_l5_above = outstanding_amt
-
- r += [diff, val_l1, val_l2, val_l3, val_l4, val_l5_above]
-
- # Only show that entry which has outstanding
- if abs(flt(outstanding_amt)) > 0.001:
- out.append(r)
-
-if len(out) > 300 and from_export == 0:
- msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
- raise Exception
-
-
-# Append Extra rows to RES
-# ------------------------------------------------------------------
-t_row = ['' for i in range(len(colnames))]
-t_row[col_idx['Voucher No']] = 'Total'
-t_row[col_idx['Opening Amt']] = total_booking_amt
-t_row[col_idx['Outstanding Amt']] = total_outstanding_amt
-out.append(t_row)
diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.sql b/accounts/search_criteria/accounts_payable/accounts_payable.sql
deleted file mode 100644
index 56ff4cf..0000000
--- a/accounts/search_criteria/accounts_payable/accounts_payable.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-SELECT DISTINCT
- `tabGL Entry`.`Aging_date`,`tabGL Entry`.`account`, `tabGL Entry`.`against_voucher_type`,
- `tabGL Entry`.`against_voucher`,`tabGL Entry`.`voucher_type`,`tabGL Entry`.`voucher_no`,
- `tabGL Entry`.`remarks`, `tabGL Entry`.`credit`
-FROM
- `tabGL Entry`,`tabAccount`
-WHERE
- `tabGL Entry`.`posting_date`<= '%(posting_date1)s'
- AND `tabGL Entry`.`account` LIKE '%(account)s%%'
- AND `tabGL Entry`.`company` LIKE '%(company)s%%'
- AND ((ifnull(`tabGL Entry`.`voucher_type`,'') = 'Purchase Invoice'
- AND `tabGL Entry`.`credit`>0) OR `tabGL Entry`.voucher_type = 'Journal Voucher')
- AND `tabGL Entry`.`is_cancelled` = 'No'
- AND `tabAccount`.master_type = 'Supplier'
- AND `tabAccount`.name = `tabGL Entry`.account
-ORDER BY `tabGL Entry`.`posting_date`
diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.txt b/accounts/search_criteria/accounts_payable/accounts_payable.txt
deleted file mode 100644
index 7f9151c..0000000
--- a/accounts/search_criteria/accounts_payable/accounts_payable.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-05-14 18:05:41",
- "modified_by": "Administrator",
- "modified": "2012-10-17 10:51:41"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"GL Entry\\u0001Voucher Type\":[\"\"],\"GL Entry\\u0001Is Cancelled\":[\"\"],\"GL Entry\\u0001Is Opening\":[\"\"],\"GL Entry\\u0001Fiscal Year\":[\"\"],\"Purchase Invoice\\u0001Aging Based On\":[\"Aging Date\"],\"GL Entry\\u0001Range 1\":\"30\",\"GL Entry\\u0001Range 2\":\"45\",\"GL Entry\\u0001Range 3\":\"60\",\"GL Entry\\u0001Range 4\":\"90\"}",
- "doctype": "Search Criteria",
- "doc_type": "GL Entry",
- "name": "__common__",
- "sort_by": "`tabGL Entry`.`name`",
- "page_len": 50,
- "criteria_name": "Accounts Payable",
- "columns": "GL Entry\u0001Posting Date,GL Entry\u0001Account,GL Entry\u0001Against Voucher,GL Entry\u0001Voucher No"
- },
- {
- "name": "accounts_payable",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/accounts_receivable/__init__.py b/accounts/search_criteria/accounts_receivable/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/accounts_receivable/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/accounts_receivable/accounts_receivable.js b/accounts/search_criteria/accounts_receivable/accounts_receivable.js
deleted file mode 100644
index e8ed3e3..0000000
--- a/accounts/search_criteria/accounts_receivable/accounts_receivable.js
+++ /dev/null
@@ -1,35 +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.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
-
- this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Sales Invoice', report_default:'Aging Date'});
- this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
- this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
- this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
- this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default']=dateutil.obj_to_str(new Date());
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
-
- this.dt.set_no_limit(1);
-}
\ No newline at end of file
diff --git a/accounts/search_criteria/accounts_receivable/accounts_receivable.py b/accounts/search_criteria/accounts_receivable/accounts_receivable.py
deleted file mode 100644
index 34aafe5..0000000
--- a/accounts/search_criteria/accounts_receivable/accounts_receivable.py
+++ /dev/null
@@ -1,168 +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/>.
-
-
-# Check mandatory filters
-#------------------------------
-from __future__ import unicode_literals
-if not filter_values.get('posting_date1'):
- msgprint("Please select To Posting Date", raise_exception=1)
-else:
- to_date = filter_values.get('posting_date1')
-
-if not filter_values['range_1'] or not filter_values['range_2'] or \
- not filter_values['range_3'] or not filter_values['range_4']:
- msgprint("Please select aging ranges in no of days in 'More Filters' section")
- raise Exception
-
-# validate Range
-range_list = ['range_1','range_2','range_3','range_4']
-for r in range(len(range_list)-1):
- if not cint(filter_values[range_list[r]]) < cint(filter_values[range_list[r + 1]]):
- msgprint("Range %s should be less than Range %s." % (cstr(r+1),cstr(r+2)))
- raise Exception
-
-
-# Add columns
-# -----------
-data = [['Aging Date','Date','80px',''],
- ['Account','Data','120px',''],
- ['Against Voucher Type','Data','120px',''],
- ['Against Voucher','Data','120px',''],
- ['Voucher Type','Data','120px',''],
- ['Voucher No','Data','120px',''],
- ['Remarks','Data','160px',''],
- ['Territory','Data','120px',''],
- ['Due Date', 'Date', '80px', ''],
- ['Opening Amt','Currency','120px',''],
- ['Outstanding Amt','Currency','120px',''],
- ['Age (Days)', 'Data', '60px', ''],
- ['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
- [cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
- [cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
- [cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
- [cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
-
-
-for d in data:
- colnames.append(d[0])
- coltypes.append(d[1])
- colwidths.append(d[2])
- coloptions.append(d[3])
- col_idx[d[0]] = len(colnames)-1
-
-# ageing based on
-aging_based_on = filter_values.get('aging_based_on') and filter_values['aging_based_on'].split(NEWLINE)[-1] or 'Aging Date'
-
-if len(res) > 2000 and from_export == 0:
- msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
- raise Exception
-
-
-# get supplier type
-territory_dict = {}
-for each in sql("""select t2.name, t1.territory from `tabCustomer` t1, `tabAccount` t2
- where t1.name = t2.master_name group by t2.name"""):
- territory_dict[each[0]] = each[1]
-
-# get due_date from sales invoice
-si_dict = {}
-for t in sql("""select name, due_date from `tabSales Invoice` group by name"""):
- si_dict[t[0]] = t[1]
-
-# sales invoice after to-date
-si_after_to_date = [d[0] for d in sql("""select distinct name from `tabSales Invoice`
- where posting_date > %s and docstatus = 1""", (to_date,))]
-
-
-from webnotes.utils import nowdate
-out = []
-total_booking_amt, total_outstanding_amt = 0,0
-for r in res:
- outstanding_amt = 0
- cond = due_date = ''
- booking_amt = r.pop(7)
-
- # get customer territory
- r.append(territory_dict.get(r[col_idx['Account']], ''))
-
- # if entry against Sales Invoice
- if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Sales Invoice':
- # get due date
- due_date = si_dict.get(r[col_idx['Voucher No']], '')
- cond = """ and ifnull(against_voucher, '') = '%s'""" % r[col_idx['Against Voucher']]
-
- # if entry against JV & and not adjusted within period
- elif r[col_idx['Against Voucher Type']] == 'Sales Invoice' \
- and r[col_idx['Against Voucher']] in si_after_to_date:
- booking_amt = 0
- cond = """ and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'""" \
- % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
- # if entry against JV and unadjusted
- elif not r[col_idx['Against Voucher']]:
- booking_amt = 0
- cond = """ and ((voucher_no = '%s' and ifnull(against_voucher, '') = '')
- or (ifnull(against_voucher, '') = '%s' and voucher_type = 'Journal Voucher'))""" \
- % (r[col_idx['Voucher No']], r[col_idx['Voucher No']])
-
- if cond:
- outstanding_amt = flt(sql("""select ifnull(sum(debit),0) - ifnull(sum(credit),0)
- from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'No'
- and posting_date <= %s %s"""
- % ('%s', '%s', cond), (r[col_idx['Account']], to_date,))[0][0] or 0)
-
- # add to total outstanding
- total_outstanding_amt += flt(outstanding_amt)
- # add to total booking amount
- if outstanding_amt and r[col_idx['Voucher Type']] == 'Sales Invoice' and r[col_idx['Against Voucher']]:
- total_booking_amt += flt(booking_amt)
-
- r += [due_date, booking_amt, outstanding_amt]
-
- #Ageing Outstanding
- val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above = 0
- diff = 0
- if r[col_idx[aging_based_on]]:
- if getdate(to_date) > getdate(nowdate()):
- to_date = nowdate()
- diff = (getdate(to_date) - getdate(r[col_idx[aging_based_on]])).days
- if diff <= cint(filter_values['range_1']):
- val_l1 = outstanding_amt
- if diff > cint(filter_values['range_1']) and diff <= cint(filter_values['range_2']):
- val_l2 = outstanding_amt
- if diff > cint(filter_values['range_2']) and diff <= cint(filter_values['range_3']):
- val_l3 = outstanding_amt
- if diff > cint(filter_values['range_3']) and diff <= cint(filter_values['range_4']):
- val_l4 = outstanding_amt
- if diff > cint(filter_values['range_4']):
- val_l5_above = outstanding_amt
- r += [diff, val_l1, val_l2, val_l3, val_l4, val_l5_above]
-
- # Only show that entry which has outstanding
- if abs(flt(outstanding_amt)) > 0.001:
- out.append(r)
-
-if len(out) > 500 and from_export == 0:
- msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
- raise Exception
-
-# Append Extra rows to res
-if len(out) > 0:
- t_row = ['' for i in range(len(colnames))]
- t_row[col_idx['Voucher No']] = 'Total'
- t_row[col_idx['Opening Amt']] = total_booking_amt
- t_row[col_idx['Outstanding Amt']] = total_outstanding_amt
- out.append(t_row)
\ No newline at end of file
diff --git a/accounts/search_criteria/accounts_receivable/accounts_receivable.sql b/accounts/search_criteria/accounts_receivable/accounts_receivable.sql
deleted file mode 100644
index 6f1c459..0000000
--- a/accounts/search_criteria/accounts_receivable/accounts_receivable.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-SELECT
- `tabGL Entry`.`aging_date`,`tabGL Entry`.`account`, `tabGL Entry`.`against_voucher_type`,
- `tabGL Entry`.`against_voucher`,`tabGL Entry`.`voucher_type`,`tabGL Entry`.`voucher_no`,
- `tabGL Entry`.`remarks`, `tabGL Entry`.`debit`
-FROM
- `tabGL Entry`,`tabAccount`
-WHERE
- `tabGL Entry`.`posting_date`<= '%(posting_date1)s'
- AND `tabGL Entry`.`account` LIKE '%(account)s%%'
- AND `tabGL Entry`.`company` LIKE '%(company)s%%'
- AND ((`tabGL Entry`.`voucher_type` = 'Sales Invoice' and `tabGL Entry`.`debit`>0)
- OR `tabGL Entry`.`voucher_type` = 'Journal Voucher')
- AND `tabGL Entry`.`is_cancelled` = 'No'
- AND `tabAccount`.`master_type` = 'Customer'
- AND `tabAccount`.`name` = `tabGL Entry`.`account`
-ORDER BY `tabGL Entry`.`posting_date`, `tabGL Entry`.`account`
diff --git a/accounts/search_criteria/accounts_receivable/accounts_receivable.txt b/accounts/search_criteria/accounts_receivable/accounts_receivable.txt
deleted file mode 100644
index cfa496e..0000000
--- a/accounts/search_criteria/accounts_receivable/accounts_receivable.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "ASC",
- "filters": "{'GL Entry\u0001Is Cancelled':'No','GL Entry\u0001Fiscal Year':'','GL Entry\u0001Company':'','GL Entry\u0001Range 1':'30','GL Entry\u0001Range 2':'45','GL Entry\u0001Range 3':'60','GL Entry\u0001Range 4':'90'}",
- "doctype": "Search Criteria",
- "doc_type": "GL Entry",
- "name": "__common__",
- "sort_by": "`tabGL Entry`.`name`",
- "criteria_name": "Accounts Receivable",
- "columns": "GL Entry\u0001Posting Date,GL Entry\u0001Transaction Date,GL Entry\u0001Account,GL Entry\u0001Against Voucher,GL Entry\u0001Voucher No"
- },
- {
- "name": "accounts_receivable",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/bank_clearance_report/__init__.py b/accounts/search_criteria/bank_clearance_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/bank_clearance_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/bank_clearance_report/bank_clearance_report.js b/accounts/search_criteria/bank_clearance_report/bank_clearance_report.js
deleted file mode 100644
index b5f9ffd..0000000
--- a/accounts/search_criteria/bank_clearance_report/bank_clearance_report.js
+++ /dev/null
@@ -1,50 +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['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Voucher Type'].df.in_first_page = 0;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Clearance Date'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.in_first_page = 1;
-
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'ID'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Owner'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Saved'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Submitted'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Cancelled'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Against Receivable'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'TDS Category'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Cost Center'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Against Payable'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Owner'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'TDS Applicable'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Is Opening'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Debit >='].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Debit <='].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Credit >='].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Credit <='].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'User Remark'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Voucher Date'].df.filter_hide = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Voucher Date'].df.filter_hide = 1;
-}
-
-this.mytabs.items['More Filters'].hide()
\ No newline at end of file
diff --git a/accounts/search_criteria/bank_clearance_report/bank_clearance_report.txt b/accounts/search_criteria/bank_clearance_report/bank_clearance_report.txt
deleted file mode 100644
index 8aa94bf..0000000
--- a/accounts/search_criteria/bank_clearance_report/bank_clearance_report.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-[
- {
- "creation": "2012-05-14 18:05:41",
- "docstatus": 0,
- "modified": "2013-04-30 14:49:06",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "columns": "Journal Voucher\u0001ID,Journal Voucher Detail\u0001Account,Journal Voucher Detail\u0001Debit,Journal Voucher Detail\u0001Credit,Journal Voucher\u0001Clearance Date,Journal Voucher\u0001Cheque No,Journal Voucher\u0001Cheque Date,Journal Voucher\u0001Voucher Date,Journal Voucher\u0001Posting Date,Journal Voucher Detail\u0001Against Payable,Journal Voucher Detail\u0001Against Receivable",
- "criteria_name": "Bank Clearance report",
- "custom_query": "",
- "description": "Bank Clearance report",
- "dis_filters": "fiscal_year",
- "disabled": 0,
- "doc_type": "Journal Voucher Detail",
- "doctype": "Search Criteria",
- "filters": "{'Journal Voucher\u0001Submitted':1,'Journal Voucher\u0001Voucher Type':'','Journal Voucher\u0001Is Opening':'','Journal Voucher\u0001Fiscal Year':'','Journal Voucher\u0001Company':'','Journal Voucher\u0001TDS Applicable':'','Journal Voucher\u0001TDS Category':''}",
- "module": "Accounts",
- "name": "__common__",
- "page_len": 50,
- "parent_doc_type": "Journal Voucher",
- "report_script": null,
- "sort_by": "ID",
- "sort_order": "DESC",
- "standard": "Yes"
- },
- {
- "doctype": "Search Criteria",
- "name": "bank_clearance_report"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/bank_reconciliation_statement/__init__.py b/accounts/search_criteria/bank_reconciliation_statement/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/bank_reconciliation_statement/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.js b/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.js
deleted file mode 100644
index f6bec4b..0000000
--- a/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.js
+++ /dev/null
@@ -1,34 +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.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.filter_hide = 0;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df.filter_hide = 0;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
-
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.in_first_page = 1;
-
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df['report_default'] = dateutil.obj_to_str(new Date());
-
- this.dt.set_no_limit(1);
-}
-
-this.mytabs.items['More Filters'].hide();
\ No newline at end of file
diff --git a/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.py b/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.py
deleted file mode 100644
index 1ab94a4..0000000
--- a/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.py
+++ /dev/null
@@ -1,66 +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/>.
-
-#get company
-from __future__ import unicode_literals
-
-import webnotes.defaults
-company = filter_values.get('company') or webnotes.defaults.get_user_default('company')
-
-# To date
-if not filter_values.get('clearance_date1'):
- msgprint('Please enter To Clearance Date')
- raise Exception
-else:
- to_date = filter_values['clearance_date1']
-
-
-#Fiscal year and year start date
-#----------------------------------
-ysd, fiscal_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",to_date)[0]
-# Account
-if not filter_values.get('account'):
- msgprint('Please select Account in filter section')
- raise Exception
-else:
- acc_name = filter_values.get('account')
-
-
-if len(res) > 300 and from_export == 0:
- msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
- raise Exception
-
-acc = sql("select debit_or_credit, is_pl_account, lft, rgt from tabAccount where name = '%s'" % acc_name)
-
-from accounts.utils import get_balance_on
-opening = get_balance_on(acc_name, to_date)
-
-total_debit, total_credit = 0,0
-out = []
-
-for r in res:
- total_debit = flt(total_debit) + flt(r[col_idx['Debit']])
- total_credit = flt(total_credit) + flt(r[col_idx['Credit']])
- out.append(r)
-
-if acc and acc[0][0] == 'Debit':
- bank_bal = flt(opening)-flt(total_debit)+flt(total_credit)
-else:
- bank_bal = flt(opening)+flt(total_debit)-flt(total_credit)
-
-out.append(['','','','<font color = "#000"><b>Balance as per Company Books: </b></font>', opening,'', ''])
-out.append(['','','','<font color = "#000"><b>Amounts not reflected in Bank: </b></font>', total_debit,total_credit,''])
-out.append(['','','','<font color = "#000"><b>Balance as per Bank: </b></font>', bank_bal,'',''])
diff --git a/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.txt b/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.txt
deleted file mode 100644
index 4d5d5fc..0000000
--- a/accounts/search_criteria/bank_reconciliation_statement/bank_reconciliation_statement.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "parent_doc_type": "Journal Voucher",
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Journal Voucher\u0001Submitted':1,'Journal Voucher\u0001Voucher Type':'','Journal Voucher\u0001Is Opening':'','Journal Voucher\u0001Company':'','Journal Voucher\u0001TDS Applicable':'','Journal Voucher\u0001TDS Category':''}",
- "dis_filters": "clearance_date\nfiscal_year",
- "doc_type": "Journal Voucher Detail",
- "name": "__common__",
- "add_cond": "(`tabJournal Voucher Detail`.credit >= 0 or `tabJournal Voucher Detail`.credit is null)\n(`tabJournal Voucher`.cheque_no is not null or `tabJournal Voucher`.cheque_no != '')\n(ifnull(`tabJournal Voucher`.clearance_date, '0000-00-00') >'%(clearance_date1)s' or `tabJournal Voucher`.clearance_date is null or `tabJournal Voucher`.clearance_date = '0000-00-00')\n(`tabJournal Voucher`.posting_date <= '%(clearance_date1)s')",
- "doctype": "Search Criteria",
- "sort_by": "`tabJournal Voucher`.`name`",
- "page_len": 50,
- "criteria_name": "Bank Reconciliation Statement",
- "columns": "Journal Voucher\u0001ID,Journal Voucher\u0001Posting Date,Journal Voucher\u0001Cheque No,Journal Voucher\u0001Cheque Date,Journal Voucher\u0001Clearance Date,Journal Voucher Detail\u0001Account,Journal Voucher Detail\u0001Debit,Journal Voucher Detail\u0001Credit,Journal Voucher Detail\u0001Against Account"
- },
- {
- "name": "bank_reconciliation_statement",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/budget_variance_report/__init__.py b/accounts/search_criteria/budget_variance_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/budget_variance_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/budget_variance_report/budget_variance_report.js b/accounts/search_criteria/budget_variance_report/budget_variance_report.js
deleted file mode 100644
index 5cc644c..0000000
--- a/accounts/search_criteria/budget_variance_report/budget_variance_report.js
+++ /dev/null
@@ -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.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Budget Detail'});
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company', report_default:sys_defaults.company, ignore : 1, parent:'Budget Detail', in_first_page:1});
- this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Fiscal Year'].df.in_first_page = 1;
- this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Period'].df.in_first_page = 1;
-
- this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
-}
-
-report.aftertableprint = function(t) {
- $yt(t,'*',1,{whiteSpace:'pre'});
-}
-
-this.mytabs.items['More Filters'].hide();
-this.mytabs.items['Select Columns'].hide();
diff --git a/accounts/search_criteria/budget_variance_report/budget_variance_report.py b/accounts/search_criteria/budget_variance_report/budget_variance_report.py
deleted file mode 100644
index 301c19a..0000000
--- a/accounts/search_criteria/budget_variance_report/budget_variance_report.py
+++ /dev/null
@@ -1,184 +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/>.
-
-# validate Filters
-from __future__ import unicode_literals
-flt_dict = {'fiscal_year': 'Fiscal Year', 'period': 'Period'}
-for f in flt_dict:
- if not filter_values.get(f):
- msgprint("Please Select " + cstr(flt_dict[f]))
- raise Exception
-
-# Get Values from fliters
-fiscal_year = filter_values.get('fiscal_year')
-period = filter_values.get('period')
-under = "GL Entry"
-based_on = "Cost Center"
-
-#add distributed id field
-col = []
-col.append([based_on,'Date','150px',''])
-col.append(['Budget Allocated','Currency','150px',''])
-col.append(['Distribution Id','Date','150px',''])
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
-
- col_idx[c[0]] = len(colnames)-1
-
-def make_child_lst(based_on,name):
- rg = sql("select lft, rgt from `tab%s` where name = '%s'"%(based_on,name))
- ch_name = sql("select name from `tab%s` where lft between %d and %d"%(based_on,int(rg[0][0]),int(rg[0][1])))
- chl ='('
- flag = 1
- for c in ch_name:
- if flag == 1:
- chl += "'%s'"%c[0]
- flag = 2
- else:
- chl +=",'%s'"%c[0]
-
- chl +=")"
- return chl
-
-
-
-for r in res:
-
- cond1 =" t1.fiscal_year ='%s' and t1.parent=t2.name and t1.parenttype = '%s' and t1.docstatus !=2"
-
- q = "select t1.name from `tabBudget Detail` t1, `tab%s` t2 where "+cond1+" and t2.name = '%s'"
- ch = sql(q%(based_on,fiscal_year,based_on,r[0].strip()))
- q1 = "select sum(t1.budget_allocated) from `tabBudget Detail` t1, `tab%s` t2, `tabAccount` t3 where "
- cond2 = " t3.is_pl_account = 'Yes' and t3.debit_or_credit = 'Debit' and t3.name = t1.account and t1.docstatus != 2 and "
- if ch:
- qur = q1+cond2+cond1+" and t2.name = '%s'"
- ret_amt = sql(qur%(based_on,fiscal_year,based_on,r[0].strip()))
-
-
- #----------------------------------------------------------------
- else:
- node_lst = make_child_lst(based_on,r[0].strip())
- qur = q1+cond1+' and '+cond2+" t2.name in %s"
-
- ret_amt = sql(qur%(based_on,fiscal_year,based_on,node_lst))
-
- #----------------------------------------------------------------
- ret_dis_id = sql("select distribution_id from `tab%s` where name = '%s'"%(based_on,r[0].strip()))
-
- target_amt = ret_amt and flt(ret_amt[0][0]) or 0
- dis_id = ret_dis_id and ret_dis_id[0][0] or ''
-
- r.append(target_amt)
- r.append(dis_id)
-
-
-
-# Set required field names
-based_on_fn = 'cost_center'
-
-date_fn = 'posting_date'
-
-mon_list = []
-
-data = {'start_date':0, 'end_date':1}
-
-def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
- count = 1
- if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
- for m in range(12):
- # get last date
- last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
-
- # make mon_list for Monthly Period
- if period == 'Monthly' :
- mon_list.append([start_date, last_date])
- # add months as Column names
- month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
- append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
-
- # get start date
- start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
-
- # make mon_list for Quaterly Period
- if period == 'Quarterly' and count % 3 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column names
- append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Half Yearly Period
- if period == 'Half Yearly' and count % 6 == 0 :
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Annual Period
- if period == 'Annual' and count % 12 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
- count = count +1
-
-def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
- col = ['Target', 'Actual', 'Variance']
- for c in col:
- n = str(name) and ' (' + str(name) +')' or ''
- colnames.append(str(c) + n)
- coltypes.append('Currency')
- colwidths.append('150px')
- coloptions.append('')
- col_idx[str(c) + n ] = len(colnames) - 1
-
-
-# get start date
-start_date = webnotes.conn.get_value('Fiscal Year', fiscal_year, 'year_start_date')
-if not start_date:
- msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
- raise Exception
-start_date = start_date.strftime('%Y-%m-%d')
-
-# make month list and columns
-make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
-
-
-bc_obj = get_obj('Budget Control')
-for r in res:
- count = 0
-
- for idx in range(3, len(colnames), 3):
- cidx = 2
-
- # ================= Calculate Target ==========================================
- r.append(bc_obj.get_monthly_budget( r[cidx], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[cidx-1]))
-
- #================== Actual Amount =============================================
- actual = 0
-
- ch = make_child_lst(based_on,r[0].strip())
-
- actual = sql("select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 where ifnull(t2.is_pl_account, 'No') = 'Yes' and ifnull(t1.is_cancelled, 'No') = 'No' and t1.cost_center in %s and t2.debit_or_credit = 'Debit' and t1.posting_date between '%s' and '%s' and t1.account = t2.name"%(ch, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
- #----------------------------------------------------------
- actual = flt(actual[0][0])
- r.append(actual)
- # ================ Variance ===================================================
- r.append(r[idx] - r[idx + 1])
- count = count +1
diff --git a/accounts/search_criteria/budget_variance_report/budget_variance_report.sql b/accounts/search_criteria/budget_variance_report/budget_variance_report.sql
deleted file mode 100644
index 575fbfb..0000000
--- a/accounts/search_criteria/budget_variance_report/budget_variance_report.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-SELECT
- CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name
-FROM
- `tabCost Center` AS node,`tabCost Center` AS parent
-WHERE
- node.lft BETWEEN parent.lft AND parent.rgt
- AND node.docstatus !=2
- AND node.company_name like '%(company)s%%'
-GROUP BY node.name
-ORDER BY node.lft
diff --git a/accounts/search_criteria/budget_variance_report/budget_variance_report.txt b/accounts/search_criteria/budget_variance_report/budget_variance_report.txt
deleted file mode 100644
index 2c079a0..0000000
--- a/accounts/search_criteria/budget_variance_report/budget_variance_report.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "harshada@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "parent_doc_type": "Cost Center",
- "module": "Accounts",
- "doctype": "Search Criteria",
- "sort_order": "DESC",
- "filters": "{'Budget Detail\u0001Fiscal Year':''}",
- "standard": "Yes",
- "doc_type": "Budget Detail",
- "name": "__common__",
- "sort_by": "`tabCost Center`.`lft`",
- "page_len": 50,
- "criteria_name": "Budget Variance Report"
- },
- {
- "name": "budget_variance_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/business_associate_commission_report/__init__.py b/accounts/search_criteria/business_associate_commission_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/business_associate_commission_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.js b/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.js
deleted file mode 100644
index 272327b..0000000
--- a/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.js
+++ /dev/null
@@ -1,26 +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.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Sales Partner'].df.filter_hide = 0;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Sales Partner'].df.in_first_page = 1;
-
-}
-
-
-this.mytabs.items['Select Columns'].hide();
-this.mytabs.items['More Filters'].hide();
\ No newline at end of file
diff --git a/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.py b/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.py
deleted file mode 100644
index 6aa7529..0000000
--- a/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.py
+++ /dev/null
@@ -1,27 +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
-colwidths[col_idx['Business Associate']] = '200px'
-
-coltypes[col_idx['Average Commission Rate']] = 'Currency'
-colwidths[col_idx['Average Commission Rate']] = '200px'
-
-coltypes[col_idx['Net Total']] = 'Currency'
-colwidths[col_idx['Net Total']] = '150px'
-
-coltypes[col_idx['Total Commission']] = 'Currency'
-colwidths[col_idx['Total Commission']] = '150px'
\ No newline at end of file
diff --git a/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.txt b/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.txt
deleted file mode 100644
index ffc6422..0000000
--- a/accounts/search_criteria/business_associate_commission_report/business_associate_commission_report.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[
- {
- "owner": "saumil@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "add_col": "SUM(`tabSales Invoice`.`total_commission`) AS 'Total Commission'\nSUM(`tabSales Invoice`.`net_total`) AS 'Net Total'\n((SUM(`tabSales Invoice`.`total_commission`) / SUM(`tabSales Invoice`.`net_total`)) * 100) AS 'Average Commission Rate'",
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Invoice\u0001Submitted':1}",
- "description": "Track total commission given to your Business Associate",
- "doc_type": "Sales Invoice",
- "name": "__common__",
- "add_cond": "`tabSales Invoice`.`net_total` > 0\n`tabSales Invoice`.`total_commission` > 0",
- "doctype": "Search Criteria",
- "group_by": "`tabSales Invoice`.sales_partner",
- "page_len": 50,
- "criteria_name": "Business Associate Commission Report",
- "columns": "Sales Invoice\u0001Business Associate"
- },
- {
- "name": "business_associate_commission_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/collection_report/__init__.py b/accounts/search_criteria/collection_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/collection_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/collection_report/collection_report.js b/accounts/search_criteria/collection_report/collection_report.js
deleted file mode 100644
index dfa58a6..0000000
--- a/accounts/search_criteria/collection_report/collection_report.js
+++ /dev/null
@@ -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/>.
-
-report.customize_filters = function() {
- this.hide_all_filters();
-
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Is Opening'].df.filter_hide = 0;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.filter_hide = 0;
-
- this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
- this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
- this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
- this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
-
- this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Sales Invoice', 'report_default': 'Aging Date'});
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
-
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
-}
-this.mytabs.items['Select Columns'].hide()
\ No newline at end of file
diff --git a/accounts/search_criteria/collection_report/collection_report.py b/accounts/search_criteria/collection_report/collection_report.py
deleted file mode 100644
index bc40a69..0000000
--- a/accounts/search_criteria/collection_report/collection_report.py
+++ /dev/null
@@ -1,107 +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/>.
-
-#check mandatory
-from __future__ import unicode_literals
-if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
- msgprint("Please select From Posting Date and To Posting Date ")
- raise Exception
-else:
- from_date = filter_values.get('posting_date')
- to_date = filter_values.get('posting_date1')
-
-if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']:
- msgprint("Please select aging ranges in no of days in 'Set Filters' section")
- raise Exception
-
-# ageing based on
-aging_based_on = 'Aging Date'
-if filter_values.get('aging_based_on'):
- aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1]
-
-
-# Add columns
-# -----------
-row_list = [['ID','Data','150px',''],
- ['Account','Data','150px',''],
- ['Credit','Data','150px',''],
- ['Debit','Data','150px',''],
- ['Against Receivable','Data','150px',''],
- ['Is Advance','Data','150px',''],
- ['Transaction Date','Date','150px',''],
- ['Aging Date','Date','150px',''],
- ['Company','Data','150px',''],
- ['Cheque No','Data','100px',''],
- ['Cheque Date','Date','150px',''],
- ['Territory','Data','150px',''],
- ['Remark','Data','250px',''],
- ['Advance','Data','250px',''],
- ['RV Transaction Date','Date','150px',''],
- ['RV Aging Date','Date','150px',''],
- ['Age (Days)','Data','50px',''],
- ['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
- [cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
- [cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
- [cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
- [cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
-
-for r in row_list:
- colnames.append(r[0])
- coltypes.append(r[1])
- colwidths.append(r[2])
- coloptions.append(r[3])
- col_idx[r[0]] = len(colnames)-1
-
-for r in res:
- if r[col_idx['Against Receivable']]:
- dt=sql("select date(modified), Aging_date from `tabSales Invoice` where name='%s'"%r[col_idx['Against Receivable']])
- r.append('')
- r.append(dt and cstr(dt[0][0]) or '')
- r.append(dt and cstr(dt[0][1]) or '')
- else:
- r.append(r[col_idx['Credit']])
- r.append('')
- r.append('')
-
-
- # Aging Credit Amount
- val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above = diff = 0
-
- if r[col_idx['Against Receivable']]:
- amt = flt(r[col_idx['Credit']]) or (-1)*flt(r[col_idx['Debit']])
-
- if aging_based_on == 'Transaction Date' and r[col_idx['RV Transaction Date']]:
- diff = (getdate(r[col_idx['Transaction Date']]) - getdate(r[col_idx['RV Transaction Date']])).days
- elif aging_based_on == 'Aging Date' and r[col_idx['RV Aging Date']]:
- diff = (getdate(r[col_idx['Aging Date']]) - getdate(r[col_idx['RV Aging Date']])).days
-
- if diff < cint(filter_values['range_1']):
- val_l1 = amt
- if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
- val_l2 = amt
- if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
- val_l3 = amt
- if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
- val_l4 = amt
- if diff >= cint(filter_values['range_4']):
- val_l5_above = amt
-
- r.append(diff)
- r.append(val_l1)
- r.append(val_l2)
- r.append(val_l3)
- r.append(val_l4)
- r.append(val_l5_above)
diff --git a/accounts/search_criteria/collection_report/collection_report.sql b/accounts/search_criteria/collection_report/collection_report.sql
deleted file mode 100644
index 8743b88..0000000
--- a/accounts/search_criteria/collection_report/collection_report.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-SELECT `tabJournal Voucher`.`name`,`tabJournal Voucher Detail`.`account`,`tabJournal Voucher Detail`.`credit`,`tabJournal Voucher Detail`.`debit`,`tabJournal Voucher Detail`.`against_invoice`,`tabJournal Voucher Detail`.`is_advance`,`tabJournal Voucher`.`voucher_date`,`tabJournal Voucher`.`aging_date`,`tabJournal Voucher`.`company`,`tabJournal Voucher`.`cheque_no`,`tabJournal Voucher`.`cheque_date`,`tabCustomer`.`territory`, `tabJournal Voucher`.`remark`
- FROM `tabJournal Voucher Detail`,`tabJournal Voucher`,`tabAccount`,`tabCustomer`
- WHERE `tabJournal Voucher`.docstatus=1
- AND `tabJournal Voucher`.`posting_date`>='%(posting_date)s'
- AND `tabJournal Voucher`.`posting_date`<='%(posting_date1)s'
- AND `tabJournal Voucher`.`company` LIKE '%(company)s%%'
- AND `tabJournal Voucher`.`is_opening` LIKE '%(is_opening)s%%'
- AND `tabJournal Voucher Detail`.`account` LIKE '%(account)s%%'
- AND `tabAccount`.master_type = 'Customer'
- AND `tabAccount`.`account_name` = `tabCustomer`.`name`
- AND `tabJournal Voucher Detail`.`account` = `tabAccount`.`name`
- AND `tabJournal Voucher Detail`.`parent` = `tabJournal Voucher`.`name`
- ORDER BY `tabJournal Voucher`.`name`
\ No newline at end of file
diff --git a/accounts/search_criteria/collection_report/collection_report.txt b/accounts/search_criteria/collection_report/collection_report.txt
deleted file mode 100644
index 781e74c..0000000
--- a/accounts/search_criteria/collection_report/collection_report.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "parent_doc_type": "Journal Voucher",
- "module": "Accounts",
- "doctype": "Search Criteria",
- "sort_order": "DESC",
- "filters": "{'Journal Voucher\u0001Saved':1,'Journal Voucher\u0001Submitted':1,'Journal Voucher\u0001Voucher Type':'','Journal Voucher\u0001Is Opening':'','Journal Voucher\u0001Company':'','Journal Voucher\u0001TDS Applicable':'','Journal Voucher\u0001TDS Category':'','GL Entry\u0001Range 1':'30','GL Entry\u0001Range 2':'45','GL Entry\u0001Range 3':'60','GL Entry\u0001Range 4':'90'}",
- "standard": "Yes",
- "doc_type": "Journal Voucher Detail",
- "name": "__common__",
- "sort_by": "`tabJournal Voucher`.`name`",
- "criteria_name": "Collection Report",
- "columns": "Journal Voucher\u0001ID,Journal Voucher\u0001Posting Date,Journal Voucher\u0001Company,Journal Voucher\u0001Cheque No,Journal Voucher\u0001Cheque Date,Journal Voucher Detail\u0001Account,Journal Voucher Detail\u0001Credit,Journal Voucher Detail\u0001Against Receivable,Journal Voucher Detail\u0001Is Advance"
- },
- {
- "name": "collection_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/cost_center_wise_expense/__init__.py b/accounts/search_criteria/cost_center_wise_expense/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/cost_center_wise_expense/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.js b/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.js
deleted file mode 100644
index d33a4e8..0000000
--- a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.js
+++ /dev/null
@@ -1,39 +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.filter_fields_dict['GL Entry'+FILTER_SEP +'Cost Center'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Cost Center'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.in_first_page = 1;
-
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-
-}
-this.mytabs.items['Select Columns'].hide();
-this.mytabs.items['More Filters'].hide();
\ No newline at end of file
diff --git a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.py b/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.py
deleted file mode 100644
index 1c73501..0000000
--- a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.py
+++ /dev/null
@@ -1,30 +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/>.
-
-# Add columns
-# -----------
-from __future__ import unicode_literals
-row_list = [['Cost Center','Data','160px'],
- ['Account','Data','160px'],
- ['Debit','Currency','120px'],
- ['Credit','Currency','120px'],
- ['Expense','Currency','120px']]
-
-for r in row_list:
- colnames.append(r[0])
- coltypes.append(r[1])
- colwidths.append(r[2])
- col_idx[r[0]] = len(colnames)-1
\ No newline at end of file
diff --git a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.sql b/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.sql
deleted file mode 100644
index b5fbb7c..0000000
--- a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-SELECT
- `tabGL Entry`.`cost_center`,
- `tabAccount`.`parent_account`,
- sum(ifnull(`tabGL Entry`.`debit`, 0)),
- sum(ifnull(`tabGL Entry`.`credit`, 0)),
- sum(ifnull(`tabGL Entry`.`debit`,0))-sum(ifnull(`tabGL Entry`.`credit`, 0))
- FROM
- `tabGL Entry`,`tabAccount`
- WHERE
- `tabGL Entry`.`account`=`tabAccount`.`name`
- AND ifnull(`tabGL Entry`.`is_cancelled`,'No')='No'
- AND `tabAccount`.is_pl_account='Yes'
- AND `tabAccount`.debit_or_credit='Debit'
- AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
- AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
- AND `tabGL Entry`.`company` LIKE '%(company)s%%'
- AND `tabAccount`.`parent_account` LIKE '%(account)s%%'
- AND `tabGL Entry`.`cost_center` LIKE '%(cost_center)s%%'
- GROUP BY
- `tabGL Entry`.`cost_center` , `tabAccount`.`parent_account`
\ No newline at end of file
diff --git a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.txt b/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.txt
deleted file mode 100644
index 98e3b08..0000000
--- a/accounts/search_criteria/cost_center_wise_expense/cost_center_wise_expense.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "swarnalata@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'GL Entry\u0001Voucher Type':'','GL Entry\u0001Is Cancelled':'','GL Entry\u0001Fiscal Year':'','GL Entry\u0001Company':''}",
- "doctype": "Search Criteria",
- "dis_filters": "fiscal_year",
- "doc_type": "GL Entry",
- "name": "__common__",
- "sort_by": "`tabGL Entry`.`name`",
- "page_len": 50,
- "criteria_name": "Cost Center wise Expense"
- },
- {
- "name": "cost_center_wise_expense",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/creditors_ledger/__init__.py b/accounts/search_criteria/creditors_ledger/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/creditors_ledger/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/creditors_ledger/creditors_ledger.js b/accounts/search_criteria/creditors_ledger/creditors_ledger.js
deleted file mode 100644
index b3f1a09..0000000
--- a/accounts/search_criteria/creditors_ledger/creditors_ledger.js
+++ /dev/null
@@ -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/>.
-
-report.customize_filters = function() {
-
- //to hide all filters
- this.hide_all_filters();
- field_list=['Voucher Type', 'Voucher No', 'From Posting Date','To Posting Date','Account','Company', 'Remarks', 'Is Cancelled', 'Is Opening']
- for(var i=0;i<field_list.length;i++){
- this.filter_fields_dict['GL Entry'+FILTER_SEP +field_list[i]].df.filter_hide = 0;
- }
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-}
-
-this.mytabs.tabs['Select Columns'].hide()
-
-report.aftertableprint = function(t) {
- $yt(t,'*',2,{whiteSpace:'pre'});
- $yt(t,'*',3,{whiteSpace:'pre'});
-}
\ No newline at end of file
diff --git a/accounts/search_criteria/creditors_ledger/creditors_ledger.py b/accounts/search_criteria/creditors_ledger/creditors_ledger.py
deleted file mode 100644
index cba3993..0000000
--- a/accounts/search_criteria/creditors_ledger/creditors_ledger.py
+++ /dev/null
@@ -1,134 +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/>.
-
-#get company
-from __future__ import unicode_literals
-
-import webnotes.defaults
-company = filter_values.get('company') or webnotes.defaults.get_user_default('company')
-
-#get company letter head
-l_head = sql("select letter_head from `tabCompany` where name='%s'" % company)
-l_head = l_head and l_head[0][0] or ''
-
-# Posting date, fiscal year and year start date
-#-----------------------------------------------
-if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
- msgprint("Please enter From Date and To Date")
- raise Exception
-else:
- from_date = filter_values['posting_date']
- to_date = filter_values['posting_date1']
-
-ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",from_date)[0]
-
-
-# define columns
-#---------------
-col = []
-col.append(['Date','Date','80px',''])
-col.append(['Detail','Text','475px',''])
-col.append(['Debit','Currency','75px',''])
-col.append(['Credit','Currency','75px',''])
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)
-
-
-total_debit, total_credit, total_opening, total_diff = 0,0,0,0
-
-#total query
-q = query.split('WHERE')[1].split('LIMIT')
-if len(q) > 2:
- query_where_clause = 'LIMIT'.join(q[:-1])
-else:
- query_where_clause = q[0]
-
-tot = sql('select sum(`tabGL Entry`.debit),sum(`tabGL Entry`.credit) from `tabGL Entry`, tabAccount where %s' % query_where_clause)
-
-for t in tot:
- total_debit += t and flt(t[0]) or 0
- total_credit += t and flt(t[1]) or 0
-
-total_diff = total_debit - total_credit
-
-# opening
-account = filter_values.get('account')
-if account:
- acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
- from accounts.utils import get_balance_on
- opening_bal = get_balance_on(account, add_days(from_date, -1))
-
- if acc_det[0][0] == 'Credit':
- opening_bal = -1*opening_bal
-
-
-out = []
-count = 0
-for r in res:
- count +=1
- det = r[1].split('~~~')
- if from_export == 1:
- a = "Account: " + det[0] + NEWLINE + det[1] + NEWLINE + "Against: " + det[2] + NEWLINE + "Voucher No: " + det[4]
- else:
- a = "Account: <b>" + det[0]+ "</b>" + NEWLINE + "<div class='comment'>" +det[1]+ "</div><div class = 'comment' style='padding-left:12px'>Against: <b>" + det[2] + "</b></div><div class = 'comment' style='padding-left:12px'>Voucher No: <span class='link_type' onclick='loaddoc(" + '"' + det[3] +'", ' + '"' + det[4] +'"' + ")'>" + det[4] + "</span></div>"
- r[1] = a
- out.append(r)
-
-if total_debit != 0 or total_credit != 0:
- # Total debit/credit
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Total'
- t_row[col_idx['Debit']-1] = total_debit
- t_row[col_idx['Credit']-1] = total_credit
- out.append(t_row)
-
- # opening
- if account:
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Opening Balance on '+ from_date
- t_row[col_idx['Debit']-1] = opening_bal
- out.append(t_row)
-
- # diffrence (dr-cr)
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Total(Dr-Cr)'
- t_row[col_idx['Debit']-1] = total_diff
- out.append(t_row)
-
- # closing
- if account:
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Closing Balance on ' + to_date
- t_row[col_idx['Debit']-1] = flt(opening_bal) + flt(total_diff )
- out.append(t_row)
-
-# Print Format
-myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
-</tr>
-<tr> <td>
-<div><h3> %(acc)s </h3></div>
-<div>Ledger Between %(fdt)s and %(tdt)s </div></td></tr></table><br>
-
- """ % {'acc':account,
- 'fdt':from_date,
- 'tdt':to_date}
-
-page_template = myheader+"<div>%(table)s</div>"
\ No newline at end of file
diff --git a/accounts/search_criteria/creditors_ledger/creditors_ledger.sql b/accounts/search_criteria/creditors_ledger/creditors_ledger.sql
deleted file mode 100644
index 03784b9..0000000
--- a/accounts/search_criteria/creditors_ledger/creditors_ledger.sql
+++ /dev/null
@@ -1,15 +0,0 @@
-SELECT `tabGL Entry`.`posting_date`, CONCAT(`tabGL Entry`.`account`, "~~~", ifnull(`tabGL Entry`.`remarks`, ''), "~~~", ifnull(`tabGL Entry`.`against`,''), "~~~", ifnull(`tabGL Entry`.`voucher_type`, ''), "~~~", ifnull(`tabGL Entry`.`voucher_no`, '')), sum(`tabGL Entry`.`debit`), sum(`tabGL Entry`.`credit`)
- FROM `tabGL Entry`, `tabAccount`
- WHERE `tabGL Entry`.`is_cancelled` LIKE '%(is_cancelled)s%%'
- AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
- AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
- AND `tabGL Entry`.`company` LIKE '%(company)s%%'
- AND `tabGL Entry`.`account` LIKE '%(account)s%%'
- AND `tabGL Entry`.`remarks` LIKE '%(remarks)s%%'
- AND `tabGL Entry`.`is_opening` LIKE '%(is_opening)s%%'
- AND `tabGL Entry`.`voucher_no` LIKE '%(voucher_no)s%%'
- AND `tabGL Entry`.`voucher_type` LIKE '%(voucher_type)s%%'
- AND `tabGL Entry`.`account` = `tabAccount`.`name`
- AND `tabAccount`.`master_type` = 'Supplier'
- GROUP BY `tabGL Entry`.`voucher_no`,`tabGL Entry`.`account`
- ORDER BY `tabGL Entry`.`posting_date` DESC
\ No newline at end of file
diff --git a/accounts/search_criteria/creditors_ledger/creditors_ledger.txt b/accounts/search_criteria/creditors_ledger/creditors_ledger.txt
deleted file mode 100644
index 7f44ab4c..0000000
--- a/accounts/search_criteria/creditors_ledger/creditors_ledger.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "nabin@erpnext.com",
- "docstatus": 0,
- "creation": "2012-05-14 18:05:41",
- "modified_by": "nabin@erpnext.com",
- "modified": "2012-12-06 11:36:10"
- },
- {
- "custom_query": null,
- "report_script": null,
- "page_len": 50,
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"GL Entry\\u0001Voucher Type\":[],\"GL Entry\\u0001Is Cancelled\":[\"No\"],\"GL Entry\\u0001Is Opening\":[\"\"],\"GL Entry\\u0001Fiscal Year\":[\"\"]}",
- "doc_type": "GL Entry",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabGL Entry`.`name`",
- "criteria_name": "Creditors Ledger"
- },
- {
- "name": "creditors_ledger",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/debtors_ledger/__init__.py b/accounts/search_criteria/debtors_ledger/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/debtors_ledger/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/debtors_ledger/debtors_ledger.js b/accounts/search_criteria/debtors_ledger/debtors_ledger.js
deleted file mode 100644
index b3f1a09..0000000
--- a/accounts/search_criteria/debtors_ledger/debtors_ledger.js
+++ /dev/null
@@ -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/>.
-
-report.customize_filters = function() {
-
- //to hide all filters
- this.hide_all_filters();
- field_list=['Voucher Type', 'Voucher No', 'From Posting Date','To Posting Date','Account','Company', 'Remarks', 'Is Cancelled', 'Is Opening']
- for(var i=0;i<field_list.length;i++){
- this.filter_fields_dict['GL Entry'+FILTER_SEP +field_list[i]].df.filter_hide = 0;
- }
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-}
-
-this.mytabs.tabs['Select Columns'].hide()
-
-report.aftertableprint = function(t) {
- $yt(t,'*',2,{whiteSpace:'pre'});
- $yt(t,'*',3,{whiteSpace:'pre'});
-}
\ No newline at end of file
diff --git a/accounts/search_criteria/debtors_ledger/debtors_ledger.py b/accounts/search_criteria/debtors_ledger/debtors_ledger.py
deleted file mode 100644
index a2e3c36..0000000
--- a/accounts/search_criteria/debtors_ledger/debtors_ledger.py
+++ /dev/null
@@ -1,133 +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/>.
-
-#get company
-from __future__ import unicode_literals
-
-import webnotes.defaults
-company = filter_values.get('company') or webnotes.defaults.get_user_default('company')
-
-#get company letter head
-l_head = sql("select letter_head from `tabCompany` where name='%s'" % company)
-l_head = l_head and l_head[0][0] or ''
-
-# Posting date, fiscal year and year start date
-#-----------------------------------------------
-if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
- msgprint("Please enter From Date and To Date")
- raise Exception
-else:
- from_date = filter_values['posting_date']
- to_date = filter_values['posting_date1']
-
-ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",from_date)[0]
-
-
-# define columns
-#---------------
-col = []
-col.append(['Date','Date','80px',''])
-col.append(['Detail','Text','475px',''])
-col.append(['Debit','Currency','75px',''])
-col.append(['Credit','Currency','75px',''])
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)
-
-
-total_debit, total_credit, total_opening, total_diff = 0,0,0,0
-
-#total query
-q = query.split('WHERE')[1].split('LIMIT')
-if len(q) > 2:
- query_where_clause = 'LIMIT'.join(q[:-1])
-else:
- query_where_clause = q[0]
-
-tot = sql('select sum(`tabGL Entry`.debit),sum(`tabGL Entry`.credit) from `tabGL Entry`, tabAccount where %s' % query_where_clause)
-
-for t in tot:
- total_debit += t and flt(t[0]) or 0
- total_credit += t and flt(t[1]) or 0
-
-total_diff = total_debit - total_credit
-
-# opening
-account = filter_values.get('account')
-if account:
- acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
- from accounts.utils import get_balance_on
- opening_bal = get_balance_on(account, add_days(from_date, -1))
- if acc_det[0][0] == 'Credit':
- opening_bal = -1*opening_bal
-
-
-out = []
-count = 0
-for r in res:
- count +=1
- det = r[1].split('~~~')
- if from_export == 1:
- a = "Account: " + det[0] + NEWLINE + det[1] + NEWLINE + "Against: " + det[2] + NEWLINE + "Voucher No: " + det[4]
- else:
- a = "Account: <b>" + det[0]+ "</b>" + NEWLINE + "<div class='comment'>" +det[1]+ "</div><div class = 'comment' style='padding-left:12px'>Against: <b>" + det[2] + "</b></div><div class = 'comment' style='padding-left:12px'>Voucher No: <span class='link_type' onclick='loaddoc(" + '"' + det[3] +'", ' + '"' + det[4] +'"' + ")'>" + det[4] + "</span></div>"
- r[1] = a
- out.append(r)
-
-if total_debit != 0 or total_credit != 0:
- # Total debit/credit
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Total'
- t_row[col_idx['Debit']-1] = total_debit
- t_row[col_idx['Credit']-1] = total_credit
- out.append(t_row)
-
- # opening
- if account:
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Opening Balance on '+ from_date
- t_row[col_idx['Debit']-1] = opening_bal
- out.append(t_row)
-
- # diffrence (dr-cr)
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Total(Dr-Cr)'
- t_row[col_idx['Debit']-1] = total_diff
- out.append(t_row)
-
- # closing
- if account:
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Closing Balance on ' + to_date
- t_row[col_idx['Debit']-1] = flt(opening_bal) + flt(total_diff )
- out.append(t_row)
-
-# Print Format
-myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
-</tr>
-<tr> <td>
-<div><h3> %(acc)s </h3></div>
-<div>Ledger Between %(fdt)s and %(tdt)s </div></td></tr></table><br>
-
- """ % {'acc':account,
- 'fdt':from_date,
- 'tdt':to_date}
-
-page_template = myheader+"<div>%(table)s</div>"
\ No newline at end of file
diff --git a/accounts/search_criteria/debtors_ledger/debtors_ledger.sql b/accounts/search_criteria/debtors_ledger/debtors_ledger.sql
deleted file mode 100644
index 59103fd..0000000
--- a/accounts/search_criteria/debtors_ledger/debtors_ledger.sql
+++ /dev/null
@@ -1,15 +0,0 @@
-SELECT `tabGL Entry`.`posting_date`, CONCAT(`tabGL Entry`.`account`, "~~~", ifnull(`tabGL Entry`.`remarks`, ''), "~~~", ifnull(`tabGL Entry`.`against`,''), "~~~", ifnull(`tabGL Entry`.`voucher_type`, ''), "~~~", ifnull(`tabGL Entry`.`voucher_no`, '')), sum(`tabGL Entry`.`debit`), sum(`tabGL Entry`.`credit`)
- FROM `tabGL Entry`, `tabAccount`
- WHERE `tabGL Entry`.`is_cancelled` LIKE '%(is_cancelled)s%%'
- AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
- AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
- AND `tabGL Entry`.`company` LIKE '%(company)s%%'
- AND `tabGL Entry`.`account` LIKE '%(account)s%%'
- AND `tabGL Entry`.`remarks` LIKE '%(remarks)s%%'
- AND `tabGL Entry`.`is_opening` LIKE '%(is_opening)s%%'
- AND `tabGL Entry`.`voucher_no` LIKE '%(voucher_no)s%%'
- AND `tabGL Entry`.`voucher_type` LIKE '%(voucher_type)s%%'
- AND `tabGL Entry`.`account` = `tabAccount`.`name`
- AND `tabAccount`.`master_type` = 'Customer'
- GROUP BY `tabGL Entry`.`voucher_no`,`tabGL Entry`.`account`
- ORDER BY `tabGL Entry`.`posting_date` DESC
\ No newline at end of file
diff --git a/accounts/search_criteria/debtors_ledger/debtors_ledger.txt b/accounts/search_criteria/debtors_ledger/debtors_ledger.txt
deleted file mode 100644
index e04492f..0000000
--- a/accounts/search_criteria/debtors_ledger/debtors_ledger.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "nabin@erpnext.com",
- "docstatus": 0,
- "creation": "2012-05-14 18:05:42",
- "modified_by": "nabin@erpnext.com",
- "modified": "2012-12-06 11:37:16"
- },
- {
- "custom_query": null,
- "report_script": null,
- "page_len": 50,
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"GL Entry\\u0001Voucher Type\":[],\"GL Entry\\u0001Is Cancelled\":[\"No\"],\"GL Entry\\u0001Is Opening\":[],\"GL Entry\\u0001Fiscal Year\":[]}",
- "doc_type": "GL Entry",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabGL Entry`.`name`",
- "criteria_name": "Debtors Ledger"
- },
- {
- "name": "debtors_ledger",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/general_ledger/__init__.py b/accounts/search_criteria/general_ledger/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/general_ledger/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/general_ledger/general_ledger.js b/accounts/search_criteria/general_ledger/general_ledger.js
deleted file mode 100644
index 3d6505f..0000000
--- a/accounts/search_criteria/general_ledger/general_ledger.js
+++ /dev/null
@@ -1,39 +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.mytabs.tabs['Select Columns'].hide();
- //to hide all filters
- this.hide_all_filters();
- field_list=['Voucher Type', 'Voucher No', 'From Posting Date','To Posting Date','Account','Company', 'Remarks', 'Is Cancelled', 'Is Opening']
- for(var i=0;i<field_list.length;i++){
- this.filter_fields_dict['GL Entry'+FILTER_SEP +field_list[i]].df.filter_hide = 0;
- }
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
-
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-}
-
-
-report.aftertableprint = function(t) {
- $yt(t,'*',2,{whiteSpace:'pre'});
- $yt(t,'*',3,{whiteSpace:'pre'});
-}
diff --git a/accounts/search_criteria/general_ledger/general_ledger.py b/accounts/search_criteria/general_ledger/general_ledger.py
deleted file mode 100644
index 11ab7c3..0000000
--- a/accounts/search_criteria/general_ledger/general_ledger.py
+++ /dev/null
@@ -1,141 +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/>.
-
-#get company letter head
-#---------------------------------------------------------------------
-from __future__ import unicode_literals
-l_head = sql("select content from `tabLetter Head` where ifnull(is_default, 0) = 1 and ifnull(disabled, 0) = 0")
-l_head = l_head and l_head[0][0] or ''
-
-
-# Posting date, fiscal year and year start date
-#---------------------------------------------------------------------
-if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
- msgprint("Please enter From Date and To Date")
- raise Exception
-else:
- from_date = filter_values['posting_date']
- to_date = filter_values['posting_date1']
-
-# define columns
-#---------------------------------------------------------------------
-col = []
-col.append(['Date','Date','80px',''])
-col.append(['Detail','Text','475px',''])
-col.append(['Debit','Currency','75px',''])
-col.append(['Credit','Currency','75px',''])
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)
-
-
-#total query
-#---------------------------------------------------------------------
-total_debit, total_credit, total_opening, total_diff = 0,0,0,0
-q = query.split('WHERE')[1].split('LIMIT')
-if len(q) > 2:
- query_where_clause = 'LIMIT'.join(q[:-1])
-else:
- query_where_clause = q[0]
-
-tot = sql('select sum(debit),sum(credit) from `tabGL Entry` where %s' % query_where_clause)
-
-for t in tot:
- total_debit += t and flt(t[0]) or 0
- total_credit += t and flt(t[1]) or 0
-
-total_diff = total_debit - total_credit
-
-out = []
-
-
-# If account mentioned, show opening and closing
-#---------------------------------------------------------------------
-account = filter_values.get('account')
-
-if account and (total_debit != 0 or total_credit != 0):
- acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
-
- from accounts.utils import get_balance_on
- opening_bal = get_balance_on(account, add_days(from_date, -1))
- closing_bal = get_balance_on(account, to_date)
-
- if acc_det[0][0] == 'Credit':
- closing_bal = -1*closing_bal
- opening_bal = -1*opening_bal
-
- # add opening row
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Opening as on '+formatdate(from_date)
- t_row[col_idx['Debit']-1] = opening_bal
- out.append(t_row)
-
-
-# table output
-#---------------------------------------------------------------------
-count = 0
-for r in res:
- count +=1
- det = r[1].split('~~~')
- if from_export == 1:
- a = "Account: " + det[0] + NEWLINE + det[1] + NEWLINE + "Against: " + det[2] + NEWLINE + "Voucher No: " + det[4]
- else:
- a = "Account: <b>" + det[0]+ "</b>" + NEWLINE + "<div class='comment'>" +det[1]+ "</div><div class = 'comment' style='padding-left:12px'>Against: <b>" + det[2] + "</b></div><div class = 'comment' style='padding-left:12px'>Voucher No: <span class='link_type' onclick='loaddoc(" + '"' + det[3] +'", ' + '"' + det[4] +'"' + ")'>" + det[4] + "</span></div>"
- r[1] = a
- out.append(r)
-
-
-# Total, Difference and closing balance
-#---------------------------------------------------------------------
-if total_debit != 0 or total_credit != 0:
- # Total debit/credit
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Total'
- t_row[col_idx['Debit']-1] = total_debit
- t_row[col_idx['Credit']-1] = total_credit
- out.append(t_row)
-
- # diffrence (dr-cr)
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Total(Dr-Cr)'
- t_row[col_idx['Debit']-1] = total_diff
- out.append(t_row)
-
- # closing
- if account:
- t_row = ['' for i in range(len(colnames))]
- t_row[1] = 'Closing Balance on ' + formatdate(to_date)
- t_row[col_idx['Debit']-1] = flt(closing_bal)
- out.append(t_row)
-
-
-# Print Format
-#---------------------------------------------------------------------
-myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
-</tr>
-<tr> <td>
-<div><h3> %(acc)s </h3></div>
-<div>Ledger Between %(fdt)s and %(tdt)s </div></td></tr></table><br>
-
- """ % {'acc':account,
- 'fdt':from_date,
- 'tdt':to_date}
-
-page_template = myheader+"<div>%(table)s</div>"
diff --git a/accounts/search_criteria/general_ledger/general_ledger.sql b/accounts/search_criteria/general_ledger/general_ledger.sql
deleted file mode 100644
index 51123cd..0000000
--- a/accounts/search_criteria/general_ledger/general_ledger.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-SELECT `tabGL Entry`.`posting_date`, CONCAT(`tabGL Entry`.`account`, "~~~", ifnull(`tabGL Entry`.`remarks`, ''), "~~~", ifnull(`tabGL Entry`.`against`,''), "~~~", ifnull(`tabGL Entry`.`voucher_type`, ''), "~~~", ifnull(`tabGL Entry`.`voucher_no`, '')), sum(`tabGL Entry`.`debit`), sum(`tabGL Entry`.`credit`)
- FROM `tabGL Entry`
- WHERE `tabGL Entry`.`is_cancelled` LIKE '%(is_cancelled)s%%'
- AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
- AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
- AND `tabGL Entry`.`company` LIKE '%(company)s%%'
- AND `tabGL Entry`.`account` LIKE '%(account)s%%'
- AND `tabGL Entry`.`remarks` LIKE '%(remarks)s%%'
- AND `tabGL Entry`.`is_opening` LIKE '%(is_opening)s%%'
- AND `tabGL Entry`.`voucher_no` LIKE '%(voucher_no)s%%'
- AND `tabGL Entry`.`voucher_type` LIKE '%(voucher_type)s%%'
- GROUP BY `tabGL Entry`.`voucher_no`,`tabGL Entry`.`account`
- ORDER BY `tabGL Entry`.`posting_date` DESC
\ No newline at end of file
diff --git a/accounts/search_criteria/general_ledger/general_ledger.txt b/accounts/search_criteria/general_ledger/general_ledger.txt
deleted file mode 100644
index 939b8a3..0000000
--- a/accounts/search_criteria/general_ledger/general_ledger.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "Accounts",
- "sort_order": "DESC",
- "filters": "{'GL Entry\u0001From Posting Date\u0001lower':'','GL Entry\u0001To Posting Date\u0001upper':'','GL Entry\u0001Voucher Type':'','GL Entry\u0001Is Cancelled':'No','GL Entry\u0001Is Opening':'','GL Entry\u0001Fiscal Year':'','GL Entry\u0001Company':''}",
- "standard": "Yes",
- "doc_type": "GL Entry",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabGL Entry`.`name`",
- "page_len": 50,
- "criteria_name": "General Ledger"
- },
- {
- "name": "general_ledger",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/invoices_overdue/__init__.py b/accounts/search_criteria/invoices_overdue/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/invoices_overdue/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/invoices_overdue/invoices_overdue.txt b/accounts/search_criteria/invoices_overdue/invoices_overdue.txt
deleted file mode 100644
index 514afac..0000000
--- a/accounts/search_criteria/invoices_overdue/invoices_overdue.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Invoice\u0001Saved':1,'Sales Invoice\u0001Submitted':1,'Sales Invoice\u0001Is Opening':'','Sales Invoice\u0001Fiscal Year':''}",
- "doc_type": "Sales Invoice",
- "name": "__common__",
- "add_cond": "`tabSales Invoice`.due_date<now()\n`tabSales Invoice`.outstanding_amount!=0\n`tabSales Invoice`.docstatus=1",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Invoice`.`name`",
- "page_len": 50,
- "criteria_name": "Invoices-Overdue",
- "columns": "Sales Invoice\u0001ID,Sales Invoice\u0001Debit To,Sales Invoice\u0001Voucher Date,Sales Invoice\u0001Due Date,Sales Invoice\u0001Outstanding Amount"
- },
- {
- "name": "invoices-overdue",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/itemwise_purchase_register/__init__.py b/accounts/search_criteria/itemwise_purchase_register/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/itemwise_purchase_register/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/itemwise_purchase_register/itemwise_purchase_register.js b/accounts/search_criteria/itemwise_purchase_register/itemwise_purchase_register.js
deleted file mode 100644
index 7f47fc3..0000000
--- a/accounts/search_criteria/itemwise_purchase_register/itemwise_purchase_register.js
+++ /dev/null
@@ -1,43 +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() {
- var me = this;
- var set_filter_property = function(dt, field, property, value) {
- if (me.filter_fields_dict[dt + FILTER_SEP + field])
- me.filter_fields_dict[dt + FILTER_SEP + field].df[property] = value;
- }
-
- this.hide_all_filters();
- filter_list = ['Credit To', 'Is Opening',
- 'From Posting Date', 'To Posting Date', "Company"]
-
- for(var i=0;i<filter_list.length;i++) {
- set_filter_property("Purchase Invoice", filter_list[i], "filter_hide", 0);
- }
- set_filter_property("Purchase Invoice Item", "Item", "filter_hide", 0);
-
- set_filter_property("Purchase Invoice", "From Posting Date", "in_first_page", 1);
- set_filter_property("Purchase Invoice", "To Posting Date", "in_first_page", 1);
- set_filter_property("Purchase Invoice Item", "Item", "in_first_page", 1);
-
- set_filter_property("Purchase Invoice", "From Posting Date",
- "report_default", sys_defaults.year_start_date);
- set_filter_property("Purchase Invoice", "To Posting Date",
- "report_default", dateutil.obj_to_str(new Date()));
- set_filter_property("Purchase Invoice", "Company",
- "report_default", sys_defaults.company);
-}
diff --git a/accounts/search_criteria/itemwise_purchase_register/itemwise_purchase_register.txt b/accounts/search_criteria/itemwise_purchase_register/itemwise_purchase_register.txt
deleted file mode 100644
index 93977f9..0000000
--- a/accounts/search_criteria/itemwise_purchase_register/itemwise_purchase_register.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "description": "Itemwise Purchase Register",
- "parent_doc_type": "Purchase Invoice",
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Purchase Invoice\u0001Submitted':1,'Purchase Invoice\u0001Is Opening':'No','Purchase Invoice\u0001Company':'','Purchase Invoice\u0001Fiscal Year':''}",
- "dis_filters": "fiscal_year",
- "doc_type": "Purchase Invoice Item",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabPurchase Invoice`.`name`",
- "page_len": 50,
- "criteria_name": "Itemwise Purchase Register",
- "columns": "Purchase Invoice\u0001ID,Purchase Invoice\u0001Credit To,Purchase Invoice\u0001Company,Purchase Invoice Item\u0001Item,Purchase Invoice Item\u0001Item Name,Purchase Invoice Item\u0001Expense Head,Purchase Invoice Item\u0001Cost Center,Purchase Invoice Item\u0001Qty,Purchase Invoice Item\u0001Rate (Default Curr.),Purchase Invoice Item\u0001Amount (Default Curr.)"
- },
- {
- "name": "itemwise_purchase_register",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/itemwise_sales_register/__init__.py b/accounts/search_criteria/itemwise_sales_register/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/itemwise_sales_register/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.js b/accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.js
deleted file mode 100755
index b52b472..0000000
--- a/accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.js
+++ /dev/null
@@ -1,43 +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() {
- var me = this;
- var set_filter_property = function(dt, field, property, value) {
- if (me.filter_fields_dict[dt + FILTER_SEP + field])
- me.filter_fields_dict[dt + FILTER_SEP + field].df[property] = value;
- }
-
- this.hide_all_filters();
- filter_list_main = ['Debit To', 'From Posting Date', 'To Posting Date', "Company"]
- for(var i=0;i<filter_list_main.length;i++) {
- set_filter_property("Sales Invoice", filter_list_main[i], "filter_hide", 0);
- }
- filter_list_item = ["Item", "Item Group", "Brand Name", "Cost Center"]
- for(var i=0;i<filter_list_item.length;i++) {
- set_filter_property("Sales Invoice Item", filter_list_item[i], "filter_hide", 0);
- }
- set_filter_property("Sales Invoice", "From Posting Date", "in_first_page", 1);
- set_filter_property("Sales Invoice", "To Posting Date", "in_first_page", 1);
- set_filter_property("Sales Invoice Item", "Item", "in_first_page", 1);
-
- set_filter_property("Sales Invoice", "From Posting Date",
- "report_default", sys_defaults.year_start_date);
- set_filter_property("Sales Invoice", "To Posting Date",
- "report_default", dateutil.obj_to_str(new Date()));
- set_filter_property("Sales Invoice", "Company",
- "report_default", sys_defaults.company);
-}
diff --git a/accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.txt b/accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.txt
deleted file mode 100644
index 9819845..0000000
--- a/accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "parent_doc_type": "Sales Invoice",
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Invoice\u0001Submitted':1,'Sales Invoice\u0001From Posting Date\u0001lower':'','Sales Invoice\u0001To Posting Date\u0001upper':'','Sales Invoice\u0001Is Opening':'','Sales Invoice\u0001Company':'','Sales Invoice\u0001Fiscal Year':''}",
- "doc_type": "Sales Invoice Item",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Invoice Item`.`income_account`",
- "page_len": 50,
- "criteria_name": "Itemwise Sales Register",
- "columns": "Sales Invoice Item\u0001Item,Sales Invoice Item\u0001Item Name,Sales Invoice Item\u0001Item Group,Sales Invoice\u0001ID,Sales Invoice\u0001Voucher Date,Sales Invoice\u0001Posting Date,Sales Invoice\u0001Debit To,Sales Invoice Item\u0001Cost Center,Sales Invoice\u0001Territory,Sales Invoice Item\u0001Income Account,Sales Invoice Item\u0001Qty,Sales Invoice Item\u0001Basic Rate*,Sales Invoice Item\u0001Amount*"
- },
- {
- "name": "itemwise_sales_register",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/monthly_transaction_summary/__init__.py b/accounts/search_criteria/monthly_transaction_summary/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/monthly_transaction_summary/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.js b/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.js
deleted file mode 100644
index bc33d33..0000000
--- a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.js
+++ /dev/null
@@ -1,29 +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.mytabs.items['Select Columns'].hide()
- this.hide_all_filters();
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'DocType'});
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company', report_default:sys_defaults.company, ignore : 1, parent:'DocType'});
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',ignore : 1, parent:'DocType'});
-}
-
-report.aftertableprint = function(t) {
- $yt(t,'*',1,{NEWLINE:'<br>'});
-}
\ No newline at end of file
diff --git a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.py b/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.py
deleted file mode 100644
index 7660fe9..0000000
--- a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.py
+++ /dev/null
@@ -1,168 +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
-if filter_values.get('period'):
- period_values = filter_values.get('period').split(NEWLINE)
-
-if not filter_values.get('fiscal_year'):
- msgprint("Please Select Fiscal Year")
- raise Exception
-elif not filter_values.get('period'):
- msgprint("Please Select Period")
- raise Exception
-elif len(period_values) > 2:
- msgprint("You can view report only for one period. Please select only one value in period.")
- raise Exception
-else:
- fiscal_year = filter_values.get('fiscal_year')
- period = filter_values.get('period')
- company = filter_values.get('company')
-
-# get fiscal year start date and start month
-# ---------------------------------------------------------
-year_start_date = sql("select year_start_date,MONTH(year_start_date) from `tabFiscal Year` where name = %s",fiscal_year)
-start_date = year_start_date and year_start_date[0][0] or ''
-start_month = year_start_date and year_start_date[0][1] or ''
-month_name = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
-
-# Add columns based on period
-# --------------------------------
-columns = []
-columns.append(['ID','Data','150px',''])
-columns.append(['Description','Data','150px',''])
-# ================ Annual ======================
-if period == 'Annual':
- columns.append([fiscal_year,'Currency','150px',''])
-
-# =========== Half Yearly ======================
-elif period == 'Half Yearly':
- columns.append([month_name[start_month-1]+' to '+month_name[start_month+4],'Currency','150px','']) # first half
- if start_month == 1: # this is case when fiscal year starts with JAN
- columns.append([month_name[start_month+5]+' to '+month_name[start_month+11],'Currency','150px',''])
- else: #this is case when fiscal year starts with other than JAN
- columns.append([month_name[start_month+5]+' to '+month_name[start_month-2],'Currency','150px',''])
- columns.append(['Total','Currency','150px',''])
-
-# ================ Quarterly ===================
-elif period == 'Quarterly':
- length_1 = (len(month_name) - start_month + 1) / 3 #this gives the total no. of times we need to iterate for quarter
- val = length_1 % 4
- q_no = 1
- for i in range(length_1):
- value = 3*i + val
- columns.append(['Q'+cstr(q_no)+' ('+month_name[value]+' to '+month_name[value+2]+')','Currency','150px',''])
- q_no += 1
- length_2 = (start_month - 1) / 3 #this gives the total no. of times we need to iterate for quarter (this is required only if fiscal year starts from april)
- for i in range(length_2):
- columns.append(['Q'+cstr(q_no)+' ('+month_name[3*i]+' to '+month_name[3*i+2]+')','Currency','150px',''])
- q_no += 1;
- columns.append(['Total','Currency','150px',''])
-
-# =============== Monthly ======================
-elif period == 'Monthly':
- for i in range(start_month-1,len(month_name)):
- columns.append([month_name[i],'Currency','150px',''])
- for i in range(start_month-1):
- columns.append([month_name[i],'Currency','150px',''])
- columns.append(['Total','Currency','150px',''])
-
-for c in columns:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)-1
-
-out = []
-if company:
- condition = 'docstatus = 1 and fiscal_year = "'+fiscal_year+'" and company = "'+company+'"'
-else:
- condition = 'docstatus = 1 and fiscal_year = "'+fiscal_year+'"'
-
-for r in res:
- det = ''
- list_range = 0
- query = ''
- # ================= Annual Report ===============
- if period == 'Annual':
- # Main Query
- det = sql("SELECT count(*), SUM(net_total), MIN(net_total), MAX(net_total), AVG(net_total) from `tab%s` where %s" %(r[col_idx['ID']],condition))
- list_range = 1
-
- # ============ Half Yearly Report ===============
- elif period == 'Half Yearly':
- # first half
- query += 'COUNT(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN name ELSE NULL END),SUM(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),MIN(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),MAX(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),AVG(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),'
- # second half
- query += 'COUNT(CASE WHEN MONTH(transaction_date) NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN name ELSE NULL END),SUM(CASE WHEN MONTH(transaction_date) NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),MIN(CASE WHEN MONTH(transaction_date) NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),MAX(CASE WHEN MONTH(transaction_date) NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),AVG(CASE WHEN MONTH(transaction_date) NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),'
-
- # Main Query
- det = sql("SELECT %s count(*), SUM(net_total), MIN(net_total), MAX(net_total), AVG(net_total) from `tab%s` where %s and transaction_date > CAST('%s' AS DATE)" %(query,r[col_idx['ID']],condition,start_date))
- list_range = 3
-
- # =============== Quarterly Report ==============
- elif period == 'Quarterly':
- length_1 = (len(month_name) - start_month + 1) / 3; #this gives the total no. of times we need to iterate for quarter
- val = length_1 % 4;
- for i in range(length_1):
- value = 3*i + val;
- query += 'COUNT(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN name ELSE NULL END),SUM(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN net_total ELSE NULL END),MIN(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN net_total ELSE NULL END),MAX(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN net_total ELSE NULL END),AVG(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN net_total ELSE NULL END),'
- length_2 = (start_month - 1) / 3; #this gives the total no. of times we need to iterate for quarter (this is required only if fiscal year starts from april)
- for i in range(length_2):
- query += 'COUNT(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN name ELSE NULL END),SUM(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN net_total ELSE NULL END),MIN(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN net_total ELSE NULL END),MAX(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN net_total ELSE NULL END),AVG(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN net_total ELSE NULL END),';
- # Main Query
- det = sql("SELECT %s count(*), SUM(net_total), MIN(net_total), MAX(net_total), AVG(net_total) from `tab%s` where %s and transaction_date > CAST('%s' AS DATE)" %(query,r[col_idx['ID']],condition,start_date))
- list_range = 5
-
- # ================ Monthly Report ===============
- elif period == 'Monthly':
- # for loop is required twice coz fiscal year starts from April (this will also work if fiscal year starts in January)
- for i in range(start_month-1,len(month_name)):
- query += 'COUNT(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN name ELSE NULL END), SUM(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END),MIN(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END), MAX(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END), AVG(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END),'
- # the above query calculates total_no, total_amt, min_amt, max_amt, avg_amt of doctypes in monthwise
- for i in range(start_month-1):
- query += 'COUNT(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN name ELSE NULL END), SUM(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END),MIN(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END), MAX(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END), AVG(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END),'
-
- # Main Query
- det = sql("SELECT %s count(*), SUM(net_total), MIN(net_total), MAX(net_total), AVG(net_total) from `tab%s` where %s and transaction_date > CAST('%s' AS DATE)" %(query,r[col_idx['ID']],condition,start_date))
- list_range = 13
-
- # bifurcate all values and append them in list
- total_no,total_amt,min_amt,max_amt,avg_amt = [],[],[],[],[]
-
- count = 0
- # append values to list
- for i in range(list_range):
- total_no.append(cstr(det and det[0][count] or 0))
- total_amt.append(cstr(det and det[0][count+1] or 0))
- min_amt.append(cstr(det and det[0][count+2] or 0))
- max_amt.append(cstr(det and det[0][count+3] or 0))
- avg_amt.append(cstr(det and det[0][count+4] or 0))
- count += 5
-
- for col in range(len(colnames)-1): # this would make all first row blank. just for look
- r.append('')
- out.append(r)
-
- d = [['Total No',total_no],['Total Amount',total_amt],['Min Amount',min_amt],['Max Amount',max_amt],['Avg Amount',avg_amt]]
-
- for des in range(5):
- t_row = ['' for i in range(len(colnames))]
- t_row[col_idx['Description']] = d[des][0]
- for v in range(list_range):
- t_row[col_idx[colnames[v+2]]] = flt(d[des][1][v])
- out.append(t_row)
\ No newline at end of file
diff --git a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.sql b/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.sql
deleted file mode 100644
index b05de58..0000000
--- a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.sql
+++ /dev/null
@@ -1 +0,0 @@
-SELECT DISTINCT name FROM tabDocType WHERE document_type="Transaction" AND ifnull(istable,0) = 0
\ No newline at end of file
diff --git a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.txt b/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.txt
deleted file mode 100644
index 1c6c60b..0000000
--- a/accounts/search_criteria/monthly_transaction_summary/monthly_transaction_summary.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'DocType\u0001Period':'Monthly'}",
- "doctype": "Search Criteria",
- "doc_type": "Profile",
- "name": "__common__",
- "sort_by": "`tabProfile`.`name`",
- "criteria_name": "Monthly Transaction Summary",
- "columns": "Profile\u0001ID"
- },
- {
- "name": "monthly_transaction_summary",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/payment_receipt_report/__init__.py b/accounts/search_criteria/payment_receipt_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/payment_receipt_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/payment_receipt_report/payment_receipt_report.py b/accounts/search_criteria/payment_receipt_report/payment_receipt_report.py
deleted file mode 100644
index 84cbbec..0000000
--- a/accounts/search_criteria/payment_receipt_report/payment_receipt_report.py
+++ /dev/null
@@ -1,41 +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
-if not filter_values.get('posting_date'):
- msgprint("Enter From Posting Date.")
- raise Exception
-
-if not filter_values.get('posting_date1'):
- msgprint("Enter To Posting Date.")
- raise Exception
-
-if not filter_values.get('company'):
- msgprint("Select Company to proceed.")
- raise Exception
-
-
-
-col_list = [['Account', 'Link', '150px', 'Account']
- ,['Total', 'Currency', '150px', '']
- ]
-
-for c in col_list:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames) - 1
diff --git a/accounts/search_criteria/payment_receipt_report/payment_receipt_report.sql b/accounts/search_criteria/payment_receipt_report/payment_receipt_report.sql
deleted file mode 100644
index a4132b7..0000000
--- a/accounts/search_criteria/payment_receipt_report/payment_receipt_report.sql
+++ /dev/null
@@ -1 +0,0 @@
-select t1.account, sum(if(t2.debit_or_credit = 'Debit', ifnull(t1.debit,0) - ifnull(t1.credit,0), ifnull(t1.credit,0) - ifnull(t1.debit,0))) from `tabGL Entry` t1, `tabAccount` t2 where t1.account = t2.name and t2.account_type != 'Bank or Cash' and t1.name in (select t1.name from `tabGL Entry` t1, `tabAccount` t2 where t1.against = t2.name and t2.account_type = 'Bank or Cash' and posting_date >= '%(posting_date)s' and posting_date <= '%(posting_date1)s') group by t1.account
\ No newline at end of file
diff --git a/accounts/search_criteria/payment_receipt_report/payment_receipt_report.txt b/accounts/search_criteria/payment_receipt_report/payment_receipt_report.txt
deleted file mode 100644
index 2e039e2..0000000
--- a/accounts/search_criteria/payment_receipt_report/payment_receipt_report.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "jai@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'GL Entry\u0001Voucher Type':'','GL Entry\u0001Is Cancelled':'','GL Entry\u0001Is Opening':'','GL Entry\u0001Fiscal Year':''}",
- "doctype": "Search Criteria",
- "doc_type": "GL Entry",
- "name": "__common__",
- "sort_by": "`tabGL Entry`.`name`",
- "page_len": 50,
- "criteria_name": "Payment Receipt Report",
- "columns": "GL Entry\u0001ID,GL Entry\u0001Owner,GL Entry\u0001Posting Date,GL Entry\u0001Account,GL Entry\u0001Cost Center,GL Entry\u0001Against Voucher,GL Entry\u0001Voucher Type,GL Entry\u0001Voucher No,GL Entry\u0001Remarks,GL Entry\u0001Is Cancelled,GL Entry\u0001Is Opening,GL Entry\u0001Fiscal Year,GL Entry\u0001Company"
- },
- {
- "name": "payment_receipt_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/purchase_register/__init__.py b/accounts/search_criteria/purchase_register/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/purchase_register/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/purchase_register/purchase_register.py b/accounts/search_criteria/purchase_register/purchase_register.py
deleted file mode 100644
index 82ab047..0000000
--- a/accounts/search_criteria/purchase_register/purchase_register.py
+++ /dev/null
@@ -1,97 +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/>.
-
-# add expense head columns
-from __future__ import unicode_literals
-from webnotes.utils import flt
-
-expense_acc = [c[0] for c in sql("""select distinct expense_head
- from `tabPurchase Invoice Item`
- where parenttype='Purchase Invoice'
- and docstatus=1
- order by expense_head asc""")]
-
-expense_acc.append('Net Total')
-
-for i in expense_acc:
- colnames.append(i)
- coltypes.append('Currency')
- colwidths.append('100px')
- coloptions.append('')
-
-# Add tax head columns
-tax_acc = [c[0] for c in sql("""select distinct account_head
- from `tabPurchase Taxes and Charges`
- where parenttype = 'Purchase Invoice'
- and add_deduct_tax = 'Add'
- and category in ('Total', 'Valuation and Total')
- and docstatus=1
- order by account_head asc""")]
-
-tax_acc.append('Total Tax')
-tax_acc.append('Grand Total')
-
-for c in tax_acc:
- if c:
- colnames.append(c)
- coltypes.append('Currency')
- colwidths.append('100px')
- coloptions.append('')
-
-# remove total columns from the list
-expense_acc = expense_acc[:-1]
-tax_acc = tax_acc[:-2]
-
-# add the values
-for r in res:
- #Get amounts for expense heads
- exp_head_amount = sql("""select expense_head, sum(amount)
- from `tabPurchase Invoice Item`
- where parent = %s and parenttype='Purchase Invoice'
- group by expense_head""", (r[col_idx['ID']]))
-
- #convert the result to dictionary for easy retrieval
- exp_head_amount_dict = {}
- for e in exp_head_amount:
- exp_head_amount_dict[e[0]] = e[1]
-
- net_total = 0
- # get expense amount
- for i in expense_acc:
- val = exp_head_amount_dict.get(i, 0)
- net_total += val
- r.append(val)
- r.append(net_total)
-
- #Get tax for account heads
- acc_head_tax = sql("""select account_head,
- sum(if(add_deduct_tax='Add', tax_amount, -tax_amount))
- from `tabPurchase Taxes and Charges` where parent = %s and parenttype = 'Purchase Invoice'
- and category in ('Total', 'Valuation and Total') group by account_head""", r[col_idx['ID']])
-
- #Convert the result to dictionary for easy retrieval
- acc_head_tax_dict = {}
- for a in acc_head_tax:
- acc_head_tax_dict[a[0]] = flt(a[1])
-
- # get tax amount
- total_tax = 0
- for c in tax_acc:
- val = acc_head_tax_dict.get(c, 0)
- total_tax += val
- r.append(val)
- r.append(total_tax)
- r.append(flt(total_tax)+ flt(net_total)) # grand total
\ No newline at end of file
diff --git a/accounts/search_criteria/purchase_register/purchase_register.txt b/accounts/search_criteria/purchase_register/purchase_register.txt
deleted file mode 100644
index f4fdb36..0000000
--- a/accounts/search_criteria/purchase_register/purchase_register.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "doc_type": "Purchase Invoice",
- "name": "__common__",
- "add_cond": "`tabPurchase Invoice`.is_opening != 'Yes'\n`tabPurchase Invoice`.name not like 'OP/%'",
- "module": "Accounts",
- "standard": "Yes",
- "filters": "{'Purchase Invoice\u0001Submitted':1}",
- "doctype": "Search Criteria",
- "criteria_name": "Purchase Register",
- "columns": "Purchase Invoice\u0001ID,Purchase Invoice\u0001Voucher Date,Purchase Invoice\u0001Posting Date,Purchase Invoice\u0001Credit To,Purchase Invoice\u0001Expense Head"
- },
- {
- "name": "purchase_register",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/sales_register/__init__.py b/accounts/search_criteria/sales_register/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/sales_register/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/sales_register/sales_register.js b/accounts/search_criteria/sales_register/sales_register.js
deleted file mode 100644
index 872e198..0000000
--- a/accounts/search_criteria/sales_register/sales_register.js
+++ /dev/null
@@ -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.filter_fields_dict['Sales Invoice'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'ID'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Owner'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Saved'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Submitted'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Cancelled'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Grand Total >='].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Grand Total <='].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Sales Partner'].df.filter_hide = 1;
- this.filter_fields_dict['Sales Invoice'+FILTER_SEP +'Is Opening Entry'].df.filter_hide = 1;
-}
diff --git a/accounts/search_criteria/sales_register/sales_register.py b/accounts/search_criteria/sales_register/sales_register.py
deleted file mode 100644
index f9cbc5d..0000000
--- a/accounts/search_criteria/sales_register/sales_register.py
+++ /dev/null
@@ -1,93 +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/>.
-
-# add additional columns
-from __future__ import unicode_literals
-from webnotes.utils import flt
-
-cl = [c[0] for c in sql("""select distinct account_head
- from `tabSales Taxes and Charges`
- where parenttype='Sales Invoice'
- and docstatus=1
- order by account_head asc""")]
-
-income_acc = [c[0] for c in sql("""select distinct income_account
- from `tabSales Invoice Item`
- where parenttype='Sales Invoice'
- and docstatus=1
- order by income_account asc""")]
-
-income_acc.append('Net Total')
-
-for i in income_acc:
- colnames.append(i)
- coltypes.append('Currency')
- colwidths.append('100px')
- coloptions.append('')
-
-cl.append('Total Tax')
-cl.append('Grand Total')
-for c in cl:
- colnames.append(c)
- coltypes.append('Currency')
- colwidths.append('100px')
- coloptions.append('')
-
-income_acc = income_acc[:-1]
-cl = cl[:-2]
-
-
-# add the values
-for r in res:
-
- #Get amounts for income account
- income_acc_list = sql("""select income_account, sum(amount)
- from `tabSales Invoice Item`
- where parent = %s
- and parenttype='Sales Invoice'
- group by income_account""", (r[col_idx['ID']],))
-
- #convert the result to dictionary for easy retrieval
- income_acc_dict = {}
- for ia in income_acc_list:
- income_acc_dict[ia[0]] = flt(ia[1])
-
- net_total = 0
- for i in income_acc:
- val = income_acc_dict.get(i, 0)
- net_total += val
- r.append(val)
- r.append(net_total)
-
- #Get tax for account heads
- acc_head_tax = sql("""select account_head, sum(tax_amount)
- from `tabSales Taxes and Charges`
- where parent = '%s'
- and parenttype = 'Sales Invoice'
- group by account_head""" %(r[col_idx['ID']],))
-
- #Convert the result to dictionary for easy retrieval
- acc_head_tax_dict = {}
- for a in acc_head_tax:
- acc_head_tax_dict[a[0]] = flt(a[1])
-
- total_tax = 0
- for c in cl:
- val = acc_head_tax_dict.get(c, 0)
- total_tax += val
- r.append(val)
- r.append(total_tax)
- r.append(net_total+total_tax)
\ No newline at end of file
diff --git a/accounts/search_criteria/sales_register/sales_register.txt b/accounts/search_criteria/sales_register/sales_register.txt
deleted file mode 100644
index b7b63f0..0000000
--- a/accounts/search_criteria/sales_register/sales_register.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-11 17:36:48",
- "modified_by": "Administrator",
- "modified": "2012-04-18 17:41:46"
- },
- {
- "add_col": "`tabAccount`.`parent_account` AS 'Parent Account'\n`tabCustomer`.`territory` AS 'Territory'\n`tabCustomer`.`customer_details` AS 'Customer Details'",
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "add_tab": "`tabAccount`\n`tabCustomer`",
- "dis_filters": "fiscal_year",
- "doc_type": "Sales Invoice",
- "name": "__common__",
- "filters": "{'Sales Invoice\u0001Submitted':1,'Sales Invoice\u0001Is Opening':''}",
- "add_cond": "ifnull(`tabSales Invoice`.`is_opening`, 'No') = 'No'\n`tabAccount`.name =`tabSales Invoice`.debit_to\n`tabCustomer`.`name` = `tabAccount`.`master_name`",
- "doctype": "Search Criteria",
- "sort_by": "`Parent Account`",
- "page_len": 50,
- "criteria_name": "Sales Register",
- "columns": "Sales Invoice\u0001ID,Sales Invoice\u0001Posting Date,Sales Invoice\u0001Debit To"
- },
- {
- "name": "sales_register",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/trend_analyzer/__init__.py b/accounts/search_criteria/trend_analyzer/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/trend_analyzer/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/trend_analyzer/trend_analyzer.js b/accounts/search_criteria/trend_analyzer/trend_analyzer.js
deleted file mode 100644
index 59d9483..0000000
--- a/accounts/search_criteria/trend_analyzer/trend_analyzer.js
+++ /dev/null
@@ -1,153 +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.dt.set_no_limit(1);
-
- // hide transaction based on permissions
- var all_transactions = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice",
- "Purchase Order", "Purchase Receipt", "Purchase Invoice"];
- var transaction_list = [];
- $.each(all_transactions, function(i, dt) {
- if(wn.boot.profile.can_read.indexOf(dt)!=-1) {
- transaction_list.push(dt);
- }
- });
-
- this.add_filter({fieldname:'transaction', label:'Transaction', fieldtype:'Select', options:transaction_list.join(NEWLINE),report_default:'Delivery Note',ignore : 1,parent:'Profile',in_first_page : 1,single_select : 1});
-
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Profile',in_first_page:1,single_select:1});
-
- this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Item'+NEWLINE+'Item Group'+NEWLINE+'Customer'+NEWLINE+'Customer Group'+NEWLINE+'Territory'+NEWLINE+'Supplier'+NEWLINE+'Supplier Type'+NEWLINE+'Project', ignore : 1, parent:'Profile', report_default:'Item', in_first_page : 1,single_select:1});
-
- this.add_filter({fieldname:'group_by', label:'Group By', fieldtype:'Select', options:NEWLINE+'Item'+NEWLINE+'Customer'+NEWLINE+'Supplier', ignore : 1, parent:'Profile',single_select:1});
-
- this.add_filter({fieldname:'order_type', label:'Order Type', fieldtype:'Select', options:NEWLINE+'Sales'+NEWLINE+'Maintenance',ignore : 1, parent:'Profile',single_select:1});
-
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company', report_default:sys_defaults.company, ignore : 1, parent:'Profile'});
-
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Profile', in_first_page:1});
-
-
- // Add Filters
- this.add_filter({fieldname:'item', label:'Item', fieldtype:'Link', options:'Item', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'item_group', label:'Item Group', fieldtype:'Link', options:'Item Group', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'customer', label:'Customer', fieldtype:'Link', options:'Customer', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'customer_group', label:'Customer Group', fieldtype:'Link', options:'Customer Group', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'territory', label:'Territory', fieldtype:'Link', options:'Territory', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'supplier', label:'Supplier', fieldtype:'Link', options:'Supplier', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'supplier_type', label:'Supplier Type', fieldtype:'Link', options:'Supplier Type', ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'project', label:'Project', fieldtype:'Link', options:'Project', ignore : 1, parent:'Profile'});
-}
-
-
-this.mytabs.tabs['Select Columns'].hide();
-
-report.aftertableprint = function(t) {
- $yt(t,'*',1,{whiteSpace:'pre'});
-}
-
-var validate_values = function(trans,based_on,order_type) {
- if(!fiscal_year){
- msgprint("Please select Fiscal Year");
- return 0;
- }
- if((in_list(['Quotation','Sales Order','Delivery Note','Sales Invoice'],trans) && in_list(['Supplier','Supplier Type'],based_on)) || (in_list(['Purchase Order','Purchase Receipt','Purchase Invoice'],trans) && in_list(['Customer','Customer Group','Territory'],based_on))){
- msgprint("Sorry! You cannot fetch "+trans+" trend based on "+based_on);
- return 0;
- }
- if(in_list(['Purchase Order','Purchase Receipt','Purchase Invoice'],trans) && order_type){
- msgprint("Please deselect Order Type for "+trans);
- return 0;
- }
- return 1;
-}
-
-
-report.get_query = function() {
- trans = this.get_filter('Profile', 'Transaction').get_value();
- order_type = this.get_filter('Profile', 'Order Type').get_value();
- based_on = this.get_filter('Profile', 'Based On').get_value();
- company = this.get_filter('Profile', 'Company').get_value();
- fiscal_year = this.get_filter('Profile', 'Fiscal Year').get_value();
-
- if(validate_values(trans,based_on,order_type)){
- col = '';
- add_cond = '';
- add_col = '';
- add_tables = '';
- sp_cond = '';
-
- trans_det = trans+' Item'
-
- if(order_type != '') add_code += ' AND t1.order_type = '+order_type;
-
- switch(based_on){
- case 'Item' : item = this.get_filter('Profile', 'Item').get_value();
- col = 'DISTINCT t2.item_code, t3.item_name';
- add_tables = ',tabItem t3';
- add_cond += ' AND t2.item_code = t3.name';
- if(item) add_cond += ' AND t2.item_code = "'+item+'"';
- break;
- case 'Customer' : cust = this.get_filter('Profile', 'Customer').get_value();
- col = 'DISTINCT t1.customer, t3.territory';
- add_tables = ',tabCustomer t3';
- add_cond += ' AND t1.customer = t3.name';
- if(cust) add_cond += ' AND t1.customer = "'+cust+'"';
- break;
- case 'Supplier' : supp = this.get_filter('Profile', 'Supplier').get_value();
- col = 'DISTINCT t1.supplier, t3.supplier_type';
- add_tables = ',tabSupplier t3';
- add_cond += ' AND t1.supplier = t3.name';
- if(supp) add_cond += ' AND t1.supplier = "'+supp+'"';
- break;
- case 'Supplier Type' : supp_type = this.get_filter('Profile', 'Supplier Type').get_value();
- col = 'DISTINCT t3.supplier_type';
- add_tables = ',tabSupplier t3';
- add_cond += ' AND t1.supplier = t3.name';
- if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"';
- break;
- case 'Project' : pro = this.get_filter('Profile', 'Project').get_value();
- if (inList(['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'], trans)) {
- col = 'DISTINCT t2.project_name';
- if(pro) add_cond += ' AND t2.project_name = "'+pro+'"';
- } else {
- col = 'DISTINCT t1.project_name';
- if(pro) add_cond += ' AND t1.project_name = "'+pro+'"';
- }
- break;
- case 'Item Group' : ig = this.get_filter('Profile', 'Item Group').get_value();
- if(ig) sp_cond += ' AND parent.name = "'+ig+'"';
- break;
- case 'Customer Group' : cg = this.get_filter('Profile', 'Customer Group').get_value();
- if(cg) sp_cond += ' AND parent.name = "'+cg+'"';
- break;
- case 'Territory' : ter = this.get_filter('Profile', 'Territory').get_value();
- if(ter) sp_cond += ' AND parent.name = "'+ter+'"';
- break;
-
- }
-
-
- if(based_on == 'Item' || based_on == 'Customer' || based_on == 'Supplier' || based_on == 'Supplier Type' || based_on == 'Project')
- var q ='SELECT '+col+' FROM `tab'+trans+'` t1, `tab'+trans_det+'` t2 '+add_tables+' WHERE t1.fiscal_year = "'+fiscal_year+'" and t1.company = "'+company+'" and t2.parent = t1.name '+add_cond;
- else
- var q = 'SELECT CONCAT(REPEAT(" ", COUNT(parent.name) - 1), node.name) AS "Name" FROM `tab'+based_on+'` node,`tab'+based_on+'` parent WHERE node.lft BETWEEN parent.lft and parent.rgt and node.docstatus !=2 '+sp_cond+' GROUP BY node.name ORDER BY node.lft';
-
- return q;
- }
-}
diff --git a/accounts/search_criteria/trend_analyzer/trend_analyzer.py b/accounts/search_criteria/trend_analyzer/trend_analyzer.py
deleted file mode 100644
index 6bc4cf6..0000000
--- a/accounts/search_criteria/trend_analyzer/trend_analyzer.py
+++ /dev/null
@@ -1,177 +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/>.
-
-# ********************************************* INITIALIZATION *******************************************
-from __future__ import unicode_literals
-out = []
-
-# Filter Values
-# =============================================
-based_on = filter_values.get('based_on')
-group_by = filter_values.get('group_by')
-trans = filter_values.get('transaction')
-period = filter_values.get('period')
-order_type = filter_values.get('order_type')
-company = filter_values.get('company')
-fiscal_year = filter_values.get('fiscal_year')
-item = filter_values.get('item')
-item_group = filter_values.get('item_group')
-customer = filter_values.get('customer')
-customer_group = filter_values.get('customer_group')
-territory = filter_values.get('territory')
-supplier = filter_values.get('supplier')
-supplier_type = filter_values.get('supplier_type')
-project = filter_values.get('project')
-
-
-# ********************************************* SET DEFAULTS **************************************************
-# Details Table
-# --------------
-
-trans_det = trans+' Item'
-
-col_names, query_val = get_obj('Trend Analyzer Control').get_single_year_query_value(fiscal_year, period, trans, trans_det)
-query_val += 'SUM(t2.qty), SUM(t2.amount)'
-
-col_names.append('Total (Qty)')
-col_names.append('Total (Amt)')
-
-
-# ********************************************* VALIDATIONS ***************************************************
-if (based_on in ['Customer','Customer Group','Territory'] and group_by == 'Supplier') or (based_on in ['Supplier','Supplier Type'] and group_by == 'Customer'):
- msgprint("Sorry! You cannot group Trend Analyzer based on %s by %s" % (based_on,group_by))
- raise Exception
-
-if based_on == group_by:
- msgprint("Based On and Group By value cannot be same for Trend Analyzer")
- raise Exception
-
-
-# ********************************************** ADD COLUMNS **********************************************
-cols = [[based_on, 'Data', '300px', '']]
-cr = 1
-if based_on == 'Item':
- cols.append(['Item Name','Data','200px',''])
- cr = 2
-elif based_on == 'Customer':
- cols.append(['Territory','Link','150px','Territory'])
- cr = 2
-elif based_on == 'Supplier':
- cols.append(['Supplier Type','Link','150px','Supplier Type'])
- cr = 2
-if group_by:
- cr += 1
-
-if group_by:
- cols.append([group_by,'Data','150px',''])
-
-for c in col_names:
- cols.append([c, ("Amt" in c) and 'Currency' or 'Float','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
-
-
-# ******************************************* ADDITIONAL CONDITION ************************************************
-add_cond = ' t2.parent = t1.name AND t1.company = "%s" AND t1.fiscal_year = "%s" and t1.docstatus = 1' % (company, fiscal_year)
-add_tab = ' `tab'+trans+'` t1, `tab'+trans_det+'` t2'
-if order_type: add_cond += ' AND t1.order_type = "%s"' % order_type
-
-
-# Item
-if item or based_on == 'Item':
- add_cond += ' AND t2.item_code = "%s"' % (based_on != 'Item' and item or '%(value)s')
-
-# Item Group
-if item_group or based_on == 'Item Group':
- add_tab += ' ,`tabItem` t3, `tabItem Group` t4 '
- add_cond += ' AND t3.name = t2.item_code AND t3.item_group = t4.name and (t4.name = "%s" or t4.name IN (SELECT t5.name FROM `tabItem Group` t5,`tabItem Group` t6 WHERE t5.lft BETWEEN t6.lft and t6.rgt and t5.docstatus !=2 and t6.name = "%s"))' % (based_on != 'Item Group' and item_group or '%(value)s', based_on != 'Item Group' and item_group or '%(value)s')
-
-# Customer
-if customer or based_on == 'Customer':
- add_cond += ' AND t1.customer = "%s"' % (based_on != 'Customer' and customer or '%(value)s')
-
-# Customer Group
-if customer_group or based_on == 'Customer Group':
- add_tab += ' ,`tabCustomer` t7, `tabCustomer Group` t8 '
- add_cond += ' AND t7.name = t1.customer AND t7.customer_group = t8.name and (t8.name = "%s" or t8.name IN (SELECT t9.name FROM `tabCustomer Group` t9,`tabCustomer Group` t10 WHERE t9.lft BETWEEN t10.lft and t10.rgt and t9.docstatus !=2 and ifnull(t9.is_group,"No") = "No" and t10.name = "%s"))' % (based_on != 'Customer Group' and customer_group or '%(value)s', based_on != 'Customer Group' and customer_group or '%(value)s')
-
-# Territory
-if territory or based_on == 'Territory':
- add_tab += ' ,`tabTerritory` t11 '
- add_cond += ' AND t1.territory = t11.name and (t11.name = "%s" or t11.name IN (SELECT t12.name FROM `tabTerritory` t12,`tabTerritory` t13 WHERE t12.lft BETWEEN t13.lft and t13.rgt and t12.docstatus !=2 and ifnull(t12.is_group,"No") = "No" and t13.name = "%s"))' % (based_on != 'Territory' and territory or '%(value)s', based_on != 'Territory' and territory or '%(value)s')
-
-# Supplier
-if supplier or based_on == 'Supplier':
- add_cond += ' AND t1.supplier = "%s"' % (based_on != 'Supplier' and supplier or '%(value)s')
-
-# Supplier Type
-if supplier_type or based_on == 'Supplier Type':
- add_tab += ' ,`tabSupplier` t14, `tabSupplier Type` t15 '
- add_cond += ' AND t14.name = t1.supplier AND t14.supplier_type = t15.name and t15.name = "%s"' % (based_on != 'Supplier Type' and supplier_type or '%(value)s')
-
-# Project
-if project or based_on == 'Project':
- if trans in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']:
- add_cond += ' AND t2.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
- else:
- add_cond += ' AND t1.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
-
-# Column to be seleted for group by condition
-# ==============================================
-sel_col = ''
-if group_by == 'Item':
- sel_col = 't2.item_code'
-elif group_by == 'Customer':
- sel_col = 't1.customer'
-elif group_by == 'Supplier':
- sel_col = 't1.supplier'
-
-
-# ********************************************** Result Set ************************************************
-for r in res:
- main_det = sql("SELECT %s FROM %s WHERE %s" % (query_val, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))
- if group_by:
- for col in range(cr,cr+1): # this would make all first row blank. just for look
- r.append('')
- if main_det[0][len(colnames) - cr - 1]:
- for d in range(len(colnames) - cr):
- r.append(flt(main_det[0][d]))
- out.append(r)
-
- if group_by:
- flag = 1
- # check for root nodes
- if based_on in ['Item Group','Customer Group','Territory']:
- is_grp = sql("select is_group from `tab%s` where name = '%s'" % (based_on, cstr(r[col_idx[based_on]]).strip()))
- is_grp = is_grp and cstr(is_grp[0][0]) or ''
- if is_grp != 'No':
- flag = 0
-
- if flag == 1:
- det = [x[0] for x in sql("SELECT DISTINCT %s FROM %s where %s" % (sel_col, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))]
-
- for des in range(len(det)):
- t_row = ['' for i in range(len(colnames))]
- t_row[col_idx[group_by]] = cstr(det[des])
- gr_det = sql("SELECT %s FROM %s WHERE %s = '%s' and %s" % (query_val, add_tab, sel_col, cstr(det[des]), add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))
- for d in range(len(col_names)):
- t_row[col_idx[col_names[d]]] = flt(gr_det[0][d])
- out.append(t_row)
\ No newline at end of file
diff --git a/accounts/search_criteria/trend_analyzer/trend_analyzer.txt b/accounts/search_criteria/trend_analyzer/trend_analyzer.txt
deleted file mode 100644
index ab15003..0000000
--- a/accounts/search_criteria/trend_analyzer/trend_analyzer.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "saumil@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-23 12:46:00",
- "modified_by": "Administrator",
- "modified": "2012-05-04 12:49:43"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{}",
- "doctype": "Search Criteria",
- "doc_type": "Profile",
- "name": "__common__",
- "sort_by": "`tabProfile`.`name`",
- "page_len": 50,
- "criteria_name": "Trend Analyzer",
- "columns": "Profile\u0001ID,Profile\u0001Owner"
- },
- {
- "name": "trend_analyzer",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/voucher_wise_tax_details/__init__.py b/accounts/search_criteria/voucher_wise_tax_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/voucher_wise_tax_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js
deleted file mode 100644
index 09a4498..0000000
--- a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.js
+++ /dev/null
@@ -1,63 +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();
-
- //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 Invoice', ignore : 1,parent:'Sales Taxes and Charges', single_select :1, in_first_page:1});
-
- this.add_filter({fieldname:'posting_date', label:'Date', fieldtype:'Date', options:'', ignore : 1,parent:'Sales Taxes and Charges', in_first_page:1});
-
- this.add_filter({fieldname:'voucher_id', label:'Voucher Id', fieldtype:'Data', options:'', ignore : 1,parent:'Sales Taxes and Charges', in_first_page:1});
-
- this.add_filter({fieldname:'tax_account', label:'Tax Account', fieldtype:'Link', options:'Account', ignore : 1,parent:'Sales Taxes and Charges', 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 Taxes and Charges', 'Based On').get_value();
- from_date = this.get_filter('Sales Taxes and Charges', 'From Date').get_value();
- to_date = this.get_filter('Sales Taxes and Charges', 'To Date').get_value();
- vid = this.get_filter('Sales Taxes and Charges', 'Voucher Id').get_value();
- acc = this.get_filter('Sales Taxes and Charges', 'Tax Account').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 += repl(' AND t1.%(dt)s >= "%(from_date)s"', {dt:date_fld, from_date:from_date});
- if (to_date) sp_cond += repl(' AND t1.%(dt)s <= "%(to_date)s"', {dt:date_fld, to_date:to_date});
- if (vid) sp_cond += repl(' AND t1.name LIKE "%%(voucher)s%"', {voucher:vid});
- if (acc) sp_cond += repl(' AND t2.account_head = "%(acc)s"', {acc:acc});
-
- return repl('SELECT t1.`name`, t1.`%(dt)s`, t1.`customer_name`, t1.net_total, t2.account_head, t2.description, t2.rate, t2.tax_amount \
- FROM `tab%(parent)s` t1, `tabSales Taxes and Charges` t2 \
- WHERE t1.docstatus=1 AND t2.`parenttype` = "%(parent)s" \
- AND t2.`parent` = t1.`name` \
- %(cond)s ORDER BY t1.`name` DESC, t1.%(dt)s DESC', {parent:based_on, cond:sp_cond, dt:date_fld});
-}
-
diff --git a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py
deleted file mode 100644
index 0f99d0b..0000000
--- a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.py
+++ /dev/null
@@ -1,39 +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
-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],
- ['Transaction Date', 'Date', '120px', ''],
- ['Customer', 'Link','150px','Customer'],
- ['Net Total', 'Currency', '80px', ''],
- ['Tax Account', 'Link','150px','Account'],
- ['Description', 'Text','120px',''],
- ['Tax Rate', 'Currency', '80px', ''],
- ['Tax Amount', 'Currency', '80px', '']
-]
-
-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
diff --git a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt b/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt
deleted file mode 100644
index 7e8adf3..0000000
--- a/accounts/search_criteria/voucher_wise_tax_details/voucher_wise_tax_details.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "parent_doc_type": "Delivery Note",
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Delivery Note\u0001Submitted':1,'Delivery Note\u0001Status':'','Delivery Note\u0001Fiscal Year':''}",
- "doc_type": "Sales Taxes and Charges",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Taxes and Charges`.`parent`",
- "page_len": 50,
- "criteria_name": "Voucher wise tax details",
- "columns": "Sales Taxes and Charges\u0001Type,Sales Taxes and Charges\u0001Account Head,Sales Taxes and Charges\u0001Cost Center,Sales Taxes and Charges\u0001Description,Sales Taxes and Charges\u0001Rate,Sales Taxes and Charges\u0001Amount*,Sales Taxes and Charges\u0001Total*"
- },
- {
- "name": "voucher_wise_tax_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/accounts/search_criteria/yearly_transaction_summary/__init__.py b/accounts/search_criteria/yearly_transaction_summary/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/accounts/search_criteria/yearly_transaction_summary/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.js b/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.js
deleted file mode 100644
index febd6a3..0000000
--- a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.js
+++ /dev/null
@@ -1,28 +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.mytabs.items['Select Columns'].hide()
- this.hide_all_filters();
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company', report_default:sys_defaults.company, ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'from_fiscal_year', label:'From Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'to_fiscal_year', label:'To Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Profile'});
- this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'Profile'});
-}
-
-report.aftertableprint = function(t) {
- $yt(t,'*',1,{NEWLINE:'<br>'});
-}
\ No newline at end of file
diff --git a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.py b/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.py
deleted file mode 100644
index 166d313..0000000
--- a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.py
+++ /dev/null
@@ -1,131 +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
-if not filter_values.get('from_fiscal_year'):
- msgprint("Please Select From Fiscal Year")
- raise Exception
-elif not filter_values.get('to_fiscal_year'):
- msgprint("Please Select To Fiscal Year")
- raise Exception
-else:
- from_fiscal_year = filter_values.get('from_fiscal_year')
- to_fiscal_year = filter_values.get('to_fiscal_year')
- company = filter_values.get('company')
- from_date = filter_values.get('date')
- to_date = filter_values.get('date1')
- if from_date != "" and to_date != "":
- get_obj('MIS Control').dates(from_fiscal_year,from_date,to_date) # validate dates (i.e. dates should be between particular fiscal year)
-
-# Add columns based on from and to fiscal year---------
-columns = []
-columns.append(['ID','Data','150px',''])
-columns.append(['Description','Data','150px',''])
-columns.append([from_fiscal_year,'Data','150px','']) # append from fiscal year column
-
-# === get no. of fiscal years between from and to fiscal year and append columns accordingly ========
-start_year = from_fiscal_year.split('-')[1] # eg. from fiscal year 2008-2009 . this gives value 2009
-end_year = to_fiscal_year.split('-')[0] # eg. to fiscal year 2009-2010 . this gives value 2009
-diff = cint(end_year)-cint(start_year)
-if diff > 0:
- year = cint(start_year);
- next_year = 0
- f_year = ''
- for i in range(1,diff+1):
- next_year = cint(year)+1
- f_year = cstr(year)+'-'+cstr(next_year)
- columns.append([f_year,'Data','150px',''])
-# ====================================================================================================
-
-columns.append([to_fiscal_year,'Data','150px','']) # append to fiscal year column
-
-for c in columns:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)-1
-
-out = []
-# =========================== condition for result ===================================================
-if company:
- condition = 'docstatus = 1 and company = "'+company+'"'
-else:
- condition = 'docstatus = 1'
-
-# ====================================================================================================
-
-for r in res:
- det = ''
- query = ''
- list_range = 0
- if from_date != "" and to_date != "":
- date_1 = cstr(get_obj('MIS Control').dates(from_fiscal_year,from_date,to_date))
- query += 'COUNT(CASE WHEN (fiscal_year = "'+from_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_1.split('~~~')[0]+'" AS DATE) AND CAST("'+date_1.split('~~~')[1]+'" AS DATE))) THEN name ELSE NULL END),SUM(CASE WHEN (fiscal_year = "'+from_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_1.split('~~~')[0]+'" AS DATE) AND CAST("'+date_1.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),MIN(CASE WHEN (fiscal_year = "'+from_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_1.split('~~~')[0]+'" AS DATE) AND CAST("'+date_1.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),MAX(CASE WHEN (fiscal_year = "'+from_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_1.split('~~~')[0]+'" AS DATE) AND CAST("'+date_1.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),AVG(CASE WHEN (fiscal_year = "'+from_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_1.split('~~~')[0]+'" AS DATE) AND CAST("'+date_1.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),'
- else:
- query += 'COUNT(CASE WHEN fiscal_year = "'+from_fiscal_year+'" THEN name ELSE NULL END),SUM(CASE WHEN fiscal_year = "'+from_fiscal_year+'" THEN net_total ELSE NULL END),MIN(CASE WHEN fiscal_year = "'+from_fiscal_year+'" THEN net_total ELSE NULL END),MAX(CASE WHEN fiscal_year = "'+from_fiscal_year+'" THEN net_total ELSE NULL END),AVG(CASE WHEN fiscal_year = "'+from_fiscal_year+'" THEN net_total ELSE NULL END),'
- list_range += 1
-
- if diff > 0:
- year = cint(start_year);
- next_year = 0
- f_year = ''
- for i in range(1,diff+1):
- next_year = cint(year)+1;
- f_year = cstr(year)+'-'+cstr(next_year);
- if from_date != "" and to_date != "":
- date_2 = cstr(get_obj('MIS Control').dates(f_year,from_date,to_date))
- query += 'COUNT(CASE WHEN (fiscal_year = "'+f_year+'" and (transaction_date BETWEEN CAST("'+date_2.split('~~~')[0]+'" AS DATE) AND CAST("'+date_2.split('~~~')[1]+'" AS DATE))) THEN name ELSE NULL END),SUM(CASE WHEN (fiscal_year = "'+f_year+'" and (transaction_date BETWEEN CAST("'+date_2.split('~~~')[0]+'" AS DATE) AND CAST("'+date_2.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),MIN(CASE WHEN (fiscal_year = "'+f_year+'" and (transaction_date BETWEEN CAST("'+date_2.split('~~~')[0]+'" AS DATE) AND CAST("'+date_2.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),MAX(CASE WHEN (fiscal_year = "'+f_year+'" and (transaction_date BETWEEN CAST("'+date_2.split('~~~')[0]+'" AS DATE) AND CAST("'+date_2.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),AVG(CASE WHEN (fiscal_year = "'+f_year+'" and (transaction_date BETWEEN CAST("'+date_2.split('~~~')[0]+'" AS DATE) AND CAST("'+date_2.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),'
- else:
- query += 'COUNT(CASE WHEN fiscal_year = "'+f_year+'" THEN name ELSE NULL END),SUM(CASE WHEN fiscal_year = "'+f_year+'" THEN net_total ELSE NULL END),MIN(CASE WHEN fiscal_year = "'+f_year+'" THEN net_total ELSE NULL END),MAX(CASE WHEN fiscal_year = "'+f_year+'" THEN net_total ELSE NULL END),AVG(CASE WHEN fiscal_year = "'+f_year+'" THEN net_total ELSE NULL END),'
- year += 1
- list_range += 1
-
- if from_date != "" and to_date != "":
- date_3 = cstr(get_obj('MIS Control').dates(to_fiscal_year,from_date,to_date))
- query += 'COUNT(CASE WHEN (fiscal_year = "'+to_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_3.split('~~~')[0]+'" AS DATE) AND CAST("'+date_3.split('~~~')[1]+'" AS DATE))) THEN name ELSE NULL END),SUM(CASE WHEN (fiscal_year = "'+to_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_3.split('~~~')[0]+'" AS DATE) AND CAST("'+date_3.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),MIN(CASE WHEN (fiscal_year = "'+to_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_3.split('~~~')[0]+'" AS DATE) AND CAST("'+date_3.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),MAX(CASE WHEN (fiscal_year = "'+to_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_3.split('~~~')[0]+'" AS DATE) AND CAST("'+date_3.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END),AVG(CASE WHEN (fiscal_year = "'+to_fiscal_year+'" and (transaction_date BETWEEN CAST("'+date_3.split('~~~')[0]+'" AS DATE) AND CAST("'+date_3.split('~~~')[1]+'" AS DATE))) THEN net_total ELSE NULL END)'
- else:
- query += 'COUNT(CASE WHEN fiscal_year = "'+to_fiscal_year+'" THEN name ELSE NULL END),SUM(CASE WHEN fiscal_year = "'+to_fiscal_year+'" THEN net_total ELSE NULL END),MIN(CASE WHEN fiscal_year = "'+to_fiscal_year+'" THEN net_total ELSE NULL END),MAX(CASE WHEN fiscal_year = "'+to_fiscal_year+'" THEN net_total ELSE NULL END),AVG(CASE WHEN fiscal_year = "'+to_fiscal_year+'" THEN net_total ELSE NULL END)'
- list_range += 1
-
- # Main Query
- det = sql("SELECT %s from `tab%s` where %s" %(query,r[col_idx['ID']],condition))
-
- # bifurcate all values and append them in list
- total_no,total_amt,min_amt,max_amt,avg_amt = [],[],[],[],[]
-
- count = 0
- # append values to list
- for i in range(list_range):
- total_no.append(cstr(det and det[0][count] or 0))
- total_amt.append(cstr(det and det[0][count+1] or 0))
- min_amt.append(cstr(det and det[0][count+2] or 0))
- max_amt.append(cstr(det and det[0][count+3] or 0))
- avg_amt.append(cstr(det and det[0][count+4] or 0))
- count += 5
-
- for col in range(len(colnames)-1): # this would make all first row blank. just for look
- r.append('')
- out.append(r)
-
- d = [['Total No',total_no],['Total Amount',total_amt],['Min Amount',min_amt],['Max Amount',max_amt],['Avg Amount',avg_amt]]
-
- for des in range(5):
- t_row = ['' for i in range(len(colnames))]
- t_row[col_idx['Description']] = d[des][0]
- for v in range(list_range):
- t_row[col_idx[colnames[v+2]]] = flt(d[des][1][v])
- out.append(t_row)
\ No newline at end of file
diff --git a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.sql b/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.sql
deleted file mode 100644
index b05de58..0000000
--- a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.sql
+++ /dev/null
@@ -1 +0,0 @@
-SELECT DISTINCT name FROM tabDocType WHERE document_type="Transaction" AND ifnull(istable,0) = 0
\ No newline at end of file
diff --git a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.txt b/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.txt
deleted file mode 100644
index 9c6ad4b..0000000
--- a/accounts/search_criteria/yearly_transaction_summary/yearly_transaction_summary.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "module": "Accounts",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'DocType\u0001Fiscal Year':'2009-2010','DocType\u0001Company':'Alpha Company','DocType\u0001Period':'Monthly'}",
- "doctype": "Search Criteria",
- "doc_type": "Profile",
- "name": "__common__",
- "sort_by": "`tabProfile`.`name`",
- "criteria_name": "Yearly Transaction Summary",
- "columns": "Profile\u0001ID"
- },
- {
- "name": "yearly_transaction_summary",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/buying/page/buying_home/buying_home.js b/buying/page/buying_home/buying_home.js
index 0e078fe..182b075 100644
--- a/buying/page/buying_home/buying_home.js
+++ b/buying/page/buying_home/buying_home.js
@@ -91,11 +91,6 @@
"label":wn._("Purchase Analytics"),
page: "purchase-analytics"
},
- {
- "label":wn._("Trend Analyzer"),
- route: "Report/Profile/Trend Analyzer",
- doctype: "Purchase Order"
- },
]
},
{
diff --git a/buying/search_criteria/__init__.py b/buying/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/buying/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/buying/search_criteria/itemwise_purchase_details/__init__.py b/buying/search_criteria/itemwise_purchase_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/buying/search_criteria/itemwise_purchase_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/buying/search_criteria/itemwise_purchase_details/itemwise_purchase_details.js b/buying/search_criteria/itemwise_purchase_details/itemwise_purchase_details.js
deleted file mode 100644
index 139d69e..0000000
--- a/buying/search_criteria/itemwise_purchase_details/itemwise_purchase_details.js
+++ /dev/null
@@ -1,21 +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['Purchase Order'+FILTER_SEP +'From Purchase Order Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Purchase Order'+FILTER_SEP +'To Purchase Order Date'].df['report_default'] = dateutil.obj_to_str(new Date());
-
-}
\ No newline at end of file
diff --git a/buying/search_criteria/itemwise_purchase_details/itemwise_purchase_details.txt b/buying/search_criteria/itemwise_purchase_details/itemwise_purchase_details.txt
deleted file mode 100644
index ac92b71..0000000
--- a/buying/search_criteria/itemwise_purchase_details/itemwise_purchase_details.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-11 13:16:55",
- "modified_by": "Administrator",
- "modified": "2012-04-13 11:15:06"
- },
- {
- "parent_doc_type": "Purchase Order",
- "module": "Buying",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"Purchase Order\\u0001Submitted\":1,\"Purchase Order\\u0001Status\":[],\"Purchase Order\\u0001Fiscal Year\":[]}",
- "doc_type": "Purchase Order Item",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabPurchase Order`.`transaction_date`",
- "page_len": 50,
- "criteria_name": "Itemwise Purchase Details",
- "columns": "Purchase Order\u0001ID,Purchase Order\u0001Purchase Order Date,Purchase Order Item\u0001Item Code,Purchase Order Item\u0001Item Name,Purchase Order Item\u0001Quantity,Purchase Order Item\u0001Stock UOM,Purchase Order Item\u0001Rate ,Purchase Order Item\u0001Amount,Purchase Order\u0001Net Total*,Purchase Order\u0001Grand Total"
- },
- {
- "name": "itemwise_purchase_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/buying/search_criteria/pending_po_items_to_bill/__init__.py b/buying/search_criteria/pending_po_items_to_bill/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/buying/search_criteria/pending_po_items_to_bill/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/buying/search_criteria/pending_po_items_to_bill/pending_po_items_to_bill.js b/buying/search_criteria/pending_po_items_to_bill/pending_po_items_to_bill.js
deleted file mode 100644
index de2c037..0000000
--- a/buying/search_criteria/pending_po_items_to_bill/pending_po_items_to_bill.js
+++ /dev/null
@@ -1,20 +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['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;
-}
\ No newline at end of file
diff --git a/buying/search_criteria/pending_po_items_to_bill/pending_po_items_to_bill.txt b/buying/search_criteria/pending_po_items_to_bill/pending_po_items_to_bill.txt
deleted file mode 100644
index 9cb44a5..0000000
--- a/buying/search_criteria/pending_po_items_to_bill/pending_po_items_to_bill.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "owner": "dhanalekshmi@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "add_col": "(CASE WHEN (`tabPurchase Order Item`.qty- ifnull(`tabPurchase Order Item`.billed_qty, 0) > 0 ) THEN (`tabPurchase Order Item`.qty-ifnull(`tabPurchase Order Item`.billed_qty, 0) ) ELSE 0 END) AS \"Pending To Bill\"",
- "parent_doc_type": "Purchase Order",
- "module": "Buying",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Purchase Order\u0001Saved':1,'Purchase Order\u0001Submitted':1,'Purchase Order\u0001Status':'','Purchase Order\u0001Fiscal Year':''}",
- "description": "Pending PO Items To Bill",
- "doc_type": "Purchase Order Item",
- "name": "__common__",
- "add_cond": "(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0) > 0 or `tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.billed_qty, 0) > 0)\n`tabPurchase Order`.status != \"Stopped\"",
- "doctype": "Search Criteria",
- "sort_by": "`tabPurchase Order`.`name`",
- "page_len": 50,
- "criteria_name": "Pending PO Items To Bill",
- "columns": "Purchase Order\u0001ID,Purchase Order\u0001Supplier,Purchase Order\u0001Supplier Name,Purchase Order\u0001Status,Purchase Order\u0001PO Date,Purchase Order\u0001Fiscal Year,Purchase Order Item\u0001Material Request No,Purchase Order Item\u0001Item Code,Purchase Order Item\u0001Item Name,Purchase Order Item\u0001Description,Purchase Order Item\u0001Quantity,Purchase Order Item\u0001UOM,Purchase Order Item\u0001Received Qty"
- },
- {
- "name": "pending_po_items_to_bill",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/buying/search_criteria/pending_po_items_to_receive/__init__.py b/buying/search_criteria/pending_po_items_to_receive/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/buying/search_criteria/pending_po_items_to_receive/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.js b/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.js
deleted file mode 100644
index de2c037..0000000
--- a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.js
+++ /dev/null
@@ -1,20 +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['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;
-}
\ No newline at end of file
diff --git a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt b/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt
deleted file mode 100644
index 51cf165..0000000
--- a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "owner": "dhanalekshmi@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "add_col": "`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0) AS \"Pending Quantity To Receive\"\n(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) * `tabPurchase Order Item`.purchase_rate AS \"Pending Amount To Receive\"",
- "parent_doc_type": "Purchase Order",
- "module": "Buying",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Purchase Order\u0001Saved':1,'Purchase Order\u0001Submitted':1,'Purchase Order\u0001Status':'','Purchase Order\u0001Fiscal Year':''}",
- "description": "Pending PO Items To Receive",
- "doc_type": "Purchase Order Item",
- "name": "__common__",
- "add_cond": "`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0) > 0 \n`tabPurchase Order`.status != \"Stopped\"",
- "doctype": "Search Criteria",
- "sort_by": "`tabPurchase Order`.`name`",
- "page_len": 50,
- "criteria_name": "Pending PO Items To Receive",
- "columns": "Purchase Order\u0001ID,Purchase Order\u0001Supplier,Purchase Order\u0001Supplier Name,Purchase Order\u0001Status,Purchase Order\u0001PO Date,Purchase Order\u0001Fiscal Year,Purchase Order Item\u0001Material Request No,Purchase Order Item\u0001Item Code,Purchase Order Item\u0001Item Name,Purchase Order Item\u0001Description,Purchase Order Item\u0001Quantity,Purchase Order Item\u0001UOM,Purchase Order Item\u0001Received Qty"
- },
- {
- "name": "pending_po_items_to_receive",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/buying/search_criteria/purchase_in_transit/__init__.py b/buying/search_criteria/purchase_in_transit/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/buying/search_criteria/purchase_in_transit/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/buying/search_criteria/purchase_in_transit/purchase_in_transit.js b/buying/search_criteria/purchase_in_transit/purchase_in_transit.js
deleted file mode 100644
index a08b921..0000000
--- a/buying/search_criteria/purchase_in_transit/purchase_in_transit.js
+++ /dev/null
@@ -1,48 +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.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'Company'].df.filter_hide = 0;
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'Credit To'].df.filter_hide = 0;
-
-
- this.add_filter({fieldname:'pr_posting_date', label:'PR Posting Date', fieldtype:'Date', ignore : 1, parent:'Purchase Receipt'});
-
-
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'Credit To'].df.in_first_page = 0;
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
-
-
- this.filter_fields_dict['Purchase Receipt'+FILTER_SEP +'From PR Posting Date'].df.ignore = 1;
- this.filter_fields_dict['Purchase Receipt'+FILTER_SEP +'To PR Posting Date'].df.ignore = 1;
-
-
- this.filter_fields_dict['Purchase Receipt'+FILTER_SEP +'From PR Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Purchase Receipt'+FILTER_SEP +'To PR Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Purchase Invoice'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-
-}
-
-this.mytabs.items['Select Columns'].hide();
\ No newline at end of file
diff --git a/buying/search_criteria/purchase_in_transit/purchase_in_transit.py b/buying/search_criteria/purchase_in_transit/purchase_in_transit.py
deleted file mode 100644
index c8739bb..0000000
--- a/buying/search_criteria/purchase_in_transit/purchase_in_transit.py
+++ /dev/null
@@ -1,24 +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/>.
-
-#check mendatory
-from __future__ import unicode_literals
-if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
- msgprint("Please select From Posting Date and To Posting Date in 'Set Filters' section")
- raise Exception
-else:
- from_date = filter_values.get('posting_date')
- to_date = filter_values.get('posting_date1')
\ No newline at end of file
diff --git a/buying/search_criteria/purchase_in_transit/purchase_in_transit.txt b/buying/search_criteria/purchase_in_transit/purchase_in_transit.txt
deleted file mode 100644
index 9fa5ccf..0000000
--- a/buying/search_criteria/purchase_in_transit/purchase_in_transit.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-11 13:16:55",
- "modified_by": "Administrator",
- "modified": "2012-04-13 12:06:15"
- },
- {
- "add_col": "`tabPurchase Receipt`.`posting_date` AS 'PR Posting Date'",
- "parent_doc_type": "Purchase Invoice",
- "module": "Buying",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"Purchase Invoice\\u0001Submitted\":1,\"Purchase Invoice\\u0001Is Opening\":[\"\"],\"Purchase Invoice\\u0001Fiscal Year\":[\"\"]}",
- "dis_filters": "`tabPurchase Receipt`.`pr_posting_date`",
- "description": "List of PR whose posting date is after PV posting date",
- "doc_type": "Purchase Invoice Item",
- "name": "__common__",
- "add_tab": "`tabPurchase Receipt`",
- "add_cond": "`tabPurchase Invoice Item`.`purchase_receipt` = `tabPurchase Receipt`.`name`\n`tabPurchase Receipt`.`posting_date` >= '%(pr_posting_date)s'\n`tabPurchase Receipt`.`posting_date` <= '%(pr_posting_date1)s'\n`tabPurchase Receipt`.`posting_date` > `tabPurchase Invoice`.`posting_date`",
- "doctype": "Search Criteria",
- "sort_by": "`tabPurchase Invoice`.`name`",
- "page_len": 50,
- "criteria_name": "Purchase in Transit",
- "columns": "Purchase Invoice\u0001ID,Purchase Invoice\u0001Posting Date,Purchase Invoice\u0001Credit To,Purchase Invoice Item\u0001Qty,Purchase Invoice Item\u0001Amount,Purchase Invoice Item\u0001Pur Order,Purchase Invoice Item\u0001Pur Receipt"
- },
- {
- "name": "purchase_in_transit",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/__init__.py b/hr/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/employee_appraisals/__init__.py b/hr/search_criteria/employee_appraisals/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/employee_appraisals/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/employee_appraisals/employee_appraisals.txt b/hr/search_criteria/employee_appraisals/employee_appraisals.txt
deleted file mode 100644
index ce12a0e..0000000
--- a/hr/search_criteria/employee_appraisals/employee_appraisals.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "ashwini@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Appraisal\u0001Saved':1,'Appraisal\u0001Submitted':1,'Appraisal\u0001Status':'','Appraisal\u0001Fiscal Year':''}",
- "doctype": "Search Criteria",
- "doc_type": "Appraisal",
- "name": "__common__",
- "sort_by": "`tabAppraisal`.`name`",
- "page_len": 50,
- "criteria_name": "Employee Appraisals",
- "columns": "Appraisal\u0001ID,Appraisal\u0001Status,Appraisal\u0001Employee,Appraisal\u0001Employee Name,Appraisal\u0001Start Date,Appraisal\u0001End Date,Appraisal\u0001Approver,Appraisal\u0001Total Score"
- },
- {
- "name": "employee_appraisals",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/employee_information/__init__.py b/hr/search_criteria/employee_information/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/employee_information/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/employee_information/employee_information.py b/hr/search_criteria/employee_information/employee_information.py
deleted file mode 100644
index 6e08872..0000000
--- a/hr/search_criteria/employee_information/employee_information.py
+++ /dev/null
@@ -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/>.
-
-from __future__ import unicode_literals
-for c in range(0,len(colnames)):
- l = (len(colnames[c])*9)
- if l < 150 : col_width = '150px'
- else: col_width = '%spx'%(l)
-
- colwidths[c] = col_width
\ No newline at end of file
diff --git a/hr/search_criteria/employee_information/employee_information.txt b/hr/search_criteria/employee_information/employee_information.txt
deleted file mode 100644
index d054613..0000000
--- a/hr/search_criteria/employee_information/employee_information.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "harshada@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Employee\u0001Saved':1,'Employee\u0001Submitted':1,'Employee\u0001Gender':'','Employee\u0001Month of Birth':'','Employee\u0001Status':''}",
- "doctype": "Search Criteria",
- "doc_type": "Employee",
- "name": "__common__",
- "sort_by": "`tabEmployee`.`name`",
- "page_len": 50,
- "criteria_name": "Employee Information",
- "columns": "Employee\u0001ID,Employee\u0001Employee Name,Employee\u0001Employee Number,Employee\u0001Date of Joining,Employee\u0001Gender,Employee\u0001Date of Birth,Employee\u0001Employment Type,Employee\u0001Scheduled Confirmation Date,Employee\u0001Contract End Date,Employee\u0001Status,Employee\u0001Branch,Employee\u0001Department,Employee\u0001Designation,Employee\u0001Grade,Employee\u0001Reports to,Employee\u0001Email (By company),Employee\u0001Bank Name,Employee\u0001Relieving Date"
- },
- {
- "name": "employee_information",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/employees_birthday/__init__.py b/hr/search_criteria/employees_birthday/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/employees_birthday/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/employees_birthday/employees_birthday.txt b/hr/search_criteria/employees_birthday/employees_birthday.txt
deleted file mode 100644
index a96b869..0000000
--- a/hr/search_criteria/employees_birthday/employees_birthday.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Employee\u0001Saved':1,'Employee\u0001Gender':'','Employee\u0001Month of Birth':'May','Employee\u0001Status':''}",
- "doctype": "Search Criteria",
- "doc_type": "Employee",
- "name": "__common__",
- "sort_by": "`tabEmployee`.`name`",
- "page_len": 50,
- "criteria_name": "Employee's Birthday",
- "columns": "Employee\u0001ID,Employee\u0001Employee Name,Employee\u0001Department,Employee\u0001Gender,Employee\u0001Date of Birth,Employee\u0001Month of Birth"
- },
- {
- "name": "employees_birthday",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/expense_claims/__init__.py b/hr/search_criteria/expense_claims/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/expense_claims/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/expense_claims/expense_claims.txt b/hr/search_criteria/expense_claims/expense_claims.txt
deleted file mode 100644
index f1324d2..0000000
--- a/hr/search_criteria/expense_claims/expense_claims.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "ashwini@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-03-30 13:33:32",
- "modified_by": "Administrator",
- "modified": "2012-03-30 13:33:32"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Expense Claim\u0001Saved':1,'Expense Claim\u0001Submitted':1,'Expense Claim\u0001Approval Status':'','Expense Claim\u0001Fiscal Year':''}",
- "doctype": "Search Criteria",
- "doc_type": "Expense Claim",
- "name": "__common__",
- "sort_by": "`tabExpense Claim`.`name`",
- "page_len": 50,
- "criteria_name": "Expense Claims",
- "columns": "Expense Claim\u0001ID,Expense Claim\u0001Approval Status,Expense Claim\u0001From Employee,Expense Claim\u0001Employee Name,Expense Claim\u0001Approver,Expense Claim\u0001Posting Date,Expense Claim\u0001Total Claimed Amount,Expense Claim\u0001Total Sanctioned Amount"
- },
- {
- "name": "expense_claims",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/monthly_attendance_details/__init__.py b/hr/search_criteria/monthly_attendance_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/monthly_attendance_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.js b/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.js
deleted file mode 100644
index e922a2f..0000000
--- a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.js
+++ /dev/null
@@ -1,45 +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/>.
-
-var get_month = function(){
-
- var dict = {0:'Jan', 1:'Feb',2:'Mar',3:'Apr',4:'May',5:'June',6:'July',7:'Aug',8:'Sept',9:'Oct',10:'Nov',11:'Dec'}
- var d = new Date();
- return dict[d.getMonth()]
-
-}
-
-report.customize_filters = function() {
- this.hide_all_filters();
- this.add_filter({fieldname:'month', label:'Month', fieldtype:'Select', options:'Jan'+NEWLINE+'Feb'+NEWLINE+'Mar'+NEWLINE+'Apr'+NEWLINE+'May'+NEWLINE+'June'+NEWLINE+'July'+NEWLINE+'Aug'+NEWLINE+'Sept'+NEWLINE+'Oct'+NEWLINE+'Nov'+NEWLINE+'Dec',ignore : 1,parent:'Attendance', single_select:1});
-
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Employee'].df.filter_hide = 0;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Month'].df.filter_hide = 0;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Company'].df.filter_hide = 0;
-
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Employee'].df.in_first_page = 1;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Month'].df.in_first_page = 1;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Fiscal Year'].df.in_first_page = 1;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Company'].df.in_first_page = 1;
-
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Month'].df['report_default'] = get_month();
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
- this.filter_fields_dict['Attendance'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
- this.get_filter('Attendance', 'Fiscal Year').set_as_single();
-}
-this.mytabs.items['More Filters'].hide();
-this.mytabs.items['Select Columns'].hide();
\ No newline at end of file
diff --git a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.py b/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.py
deleted file mode 100644
index dff95df..0000000
--- a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.py
+++ /dev/null
@@ -1,93 +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/>.
-
-#add column employee, employee name
-#--------------------------------------------------------------------------------------
-from __future__ import unicode_literals
-col =[['Employee','Link','155px','Employee'],['Employee Name','Data','150px','']]
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
-
- col_idx[c[0]] = len(colnames)-1
-
-
-#get feb months last day
-#--------------------------------------------------------------------------------------
-fy = filter_values.get('fiscal_year')
-month = filter_values.get('month')
-mdict = {'Jan':'01', 'Feb':'02','Mar':'03','Apr':'04','May':'05','June':'06','July':'07','Aug':'08','Sept':'09','Oct':'10','Nov':'11','Dec':'12'}
-
-import webnotes.utils
-from dateutil.relativedelta import relativedelta
-
-ysd = sql("select year_start_date from `tabFiscal Year` where name = '%s' and docstatus !=2"%fy)[0][0]
-
-last_date = webnotes.utils.get_last_day(ysd + relativedelta(months = (cint(ysd.strftime('%m'))>cint(mdict[month]) and (12-cint(ysd.strftime('%m'))+cint(mdict[month])) or (cint(mdict[month]) - cint(ysd.strftime('%m'))))))
-feb = last_date.strftime('%d')
-
-
-
-#get last day and add columns
-#--------------------------------------------------------------------------------------
-dict = {'Jan': 31,'Feb':cint(feb), 'Mar':31,'Apr':30,'May':31,'June':30,'July':31,'Aug':31,'Sept':30,'Oct':31,'Nov':30,'Dec':31}
-
-for i in range(0,dict[month]):
- colnames.append(i+1)
- coltypes.append('Data')
- colwidths.append('25px')
-
- col_idx[c[0]] = len(colnames)-1
-
-#add total present, absent days
-#--------------------------------------------------------------------------------------
-tot_col =[['Total Present Days','Data','120px'],['Total Absent Days','Data','120px']]
-
-for c in tot_col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
-
- col_idx[c[0]] = len(colnames)-1
-
-#get data
-#--------------------------------------------------------------------------------------
-
-
-year = last_date.strftime('%Y')
-out = []
-for r in res:
- p_cnt = a_cnt = 0
-
- for i in range(0,dict[month]):
- new_date = str(year)+'-'+mdict[month]+'-'+((i>=9) and str(i+1) or ('0'+str(i+1)))
-
- chk = sql("select status from `tabAttendance` where employee='%s' and att_date = '%s' and docstatus=1"%(r[0],new_date))
- chk = chk and chk[0][0][0] or '-'
- if chk=='P':
- p_cnt +=1
- elif chk=='A':
- a_cnt +=1
- r.append(chk)
-
- r.append(p_cnt)
- r.append(a_cnt)
-
- if p_cnt or a_cnt:
- out.append(r)
diff --git a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.sql b/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.sql
deleted file mode 100644
index 762a94f..0000000
--- a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.sql
+++ /dev/null
@@ -1 +0,0 @@
-SELECT DISTINCT `tabAttendance`.employee, `tabEmployee`.employee_name FROM `tabAttendance`, `tabEmployee` WHERE `tabEmployee`.name = `tabAttendance`.employee and `tabAttendance`.fiscal_year like '%(fiscal_year)s%%' AND `tabAttendance`.company like '%(company)s%%' AND `tabAttendance`.employee like '%(employee)s%%'
\ No newline at end of file
diff --git a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.txt b/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.txt
deleted file mode 100644
index abbacae..0000000
--- a/hr/search_criteria/monthly_attendance_details/monthly_attendance_details.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "harshada@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Attendance\u0001Status':'','Attendance\u0001Fiscal Year':''}",
- "doctype": "Search Criteria",
- "doc_type": "Attendance",
- "name": "__common__",
- "sort_by": "`tabAttendance`.`employee`",
- "page_len": 50,
- "criteria_name": "Monthly Attendance Details",
- "columns": "Attendance\u0001Employee"
- },
- {
- "name": "monthly_attendance_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/monthly_salary_register/__init__.py b/hr/search_criteria/monthly_salary_register/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/monthly_salary_register/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/monthly_salary_register/monthly_salary_register.py b/hr/search_criteria/monthly_salary_register/monthly_salary_register.py
deleted file mode 100644
index 2291b66..0000000
--- a/hr/search_criteria/monthly_salary_register/monthly_salary_register.py
+++ /dev/null
@@ -1,99 +0,0 @@
-from __future__ import unicode_literals
-colwidths[col_idx['Employee Name']]="120px"
-colwidths[col_idx['Leave Without Pay']] = '120px'
-
-sum_net = total_earning = total_deduction = total_lwp = total_arr = 0
-total = ['Total Net Pay','','']
-
-
-earn_type_lst = sql("select name from `tabEarning Type`")
-
-ded_type_lst = sql("select name from `tabDeduction Type`")
-li=[]
-for lst in earn_type_lst:
-
- li.append(lst[0])
-
-
-
-li.append('Total Earning')
-for lst in ded_type_lst:
-
- li.append(lst[0])
-
-
-li.append('Total Deduction')
-li.append('Net Pay')
-
-
-
-for d in li:
- colnames.append(d)
- colwidths.append("150px")
- coltypes.append("Currency")
- coloptions.append("")
- col_idx[d] = len(colnames)-1
- for r in res:
- r.append("0")
-
-for r in res:
-
- total_lwp += flt(r[col_idx['Leave Without Pay']])
- total_arr += flt(r[col_idx['Arrear Amount']])
-
- for d1 in li:
- d2 = '%s'%d1
-
- earn_ret=webnotes.conn.convert_to_lists(sql("select e_type,e_amount from `tabSalary Slip Earning` where parent = '%s'"%r[col_idx['ID']]))
- ded_ret=webnotes.conn.convert_to_lists(sql("select d_type,d_amount from `tabSalary Slip Deduction` where parent = '%s'"%r[col_idx['ID']]))
-
-
- for e in earn_ret:
- e0 = '%s'%e[0]
- r[col_idx[e0]]=flt(e[1]) or 0.00
-
-
- for d in ded_ret:
- d0 = '%s'%d[0]
- r[col_idx[d0]]=flt(d[1]) or 0.00
-
-
- tot_earn_ded_net_ret = sql("select gross_pay, total_deduction,net_pay from `tabSalary Slip` where name = '%s'"%r[col_idx['ID']])
- if d2 == 'Total Earning':
- r[col_idx[d2]] = flt(tot_earn_ded_net_ret[0][0]) or 0
- total_earning += flt(tot_earn_ded_net_ret[0][0]) or 0
- elif d2 == 'Total Deduction':
- r[col_idx[d2]] = flt(tot_earn_ded_net_ret[0][1]) or 0
- total_deduction += flt(tot_earn_ded_net_ret[0][1]) or 0
- elif d2 == 'Net Pay':
- r[col_idx[d2]] = flt(tot_earn_ded_net_ret[0][2]) or 0
- sum_net += flt(tot_earn_ded_net_ret[0][2]) or 0
-
-
-total.append(total_lwp)
-total.append(total_arr)
-
-for lst in earn_type_lst:
-
- total_ear = 0
- for r in res:
-
- lst0 = '%s'%lst[0]
- total_ear += flt(r[col_idx[lst0]])
-
- total.append(total_ear)
-
-total.append(total_earning)
-for lst in ded_type_lst:
- total_ded = 0
- for r in res:
- lst0 = '%s'%lst[0]
- total_ded += flt(r[col_idx[lst0]])
-
- total.append(total_ded)
-
-
-total.append(total_deduction)
-total.append(sum_net)
-
-res.append(total)
diff --git a/hr/search_criteria/monthly_salary_register/monthly_salary_register.txt b/hr/search_criteria/monthly_salary_register/monthly_salary_register.txt
deleted file mode 100644
index 2e1db8c..0000000
--- a/hr/search_criteria/monthly_salary_register/monthly_salary_register.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-03-30 14:50:44",
- "modified_by": "Administrator",
- "modified": "2012-04-05 17:23:13"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"Salary Slip\\u0001Submitted\":1,\"Salary Slip\\u0001Company\":[\"\"],\"Salary Slip\\u0001Month\":[\"\"]}",
- "doctype": "Search Criteria",
- "doc_type": "Salary Slip",
- "name": "__common__",
- "sort_by": "`tabSalary Slip`.`name`",
- "page_len": 50,
- "criteria_name": "Monthly Salary Register",
- "columns": "Salary Slip\u0001ID,Salary Slip\u0001Employee,Salary Slip\u0001Employee Name,Salary Slip\u0001Leave Without Pay,Salary Slip\u0001Arrear Amount"
- },
- {
- "name": "monthly_salary_register",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/new_or_left_employees_for_a_month/__init__.py b/hr/search_criteria/new_or_left_employees_for_a_month/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/new_or_left_employees_for_a_month/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.js b/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.js
deleted file mode 100644
index e6dc267..0000000
--- a/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.js
+++ /dev/null
@@ -1,66 +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() {
- var d = new Date();
-
- var month=["January","February","March","April","May","June","July","August","September","October","November","December"]
-
- this.add_filter({fieldname:'month', label:'Month',fieldtype:'Select', options:"January"+NEWLINE+"February"+NEWLINE+"March"+NEWLINE+"April"+NEWLINE+"May"+NEWLINE+"June"+NEWLINE+"July"+NEWLINE+"August"+NEWLINE+"September"+NEWLINE+"October"+NEWLINE+"November"+NEWLINE+"December",report_default : month[d.getMonth()],ignore : 1, parent:'Employee'});
-
- this.filter_fields_dict['Employee'+FILTER_SEP +'Month'].df.in_first_page = 1;
- this.filter_fields_dict['Employee'+FILTER_SEP +'Status'].df.in_first_page = 1;
- this.filter_fields_dict['Employee'+FILTER_SEP +'Status'].df.report_default = 'Active';
-
- this.add_filter({fieldname:'year', label:'Year',fieldtype:'Select', options:"2000"+NEWLINE+"2001"+NEWLINE+"2002"+NEWLINE+"2003"+NEWLINE+"2004"+NEWLINE+"2005"+NEWLINE+"2006"+NEWLINE+"2007"+NEWLINE+"2008"+NEWLINE+"2009"+NEWLINE+"2010"+NEWLINE+"2011",report_default : d.getFullYear(),ignore : 1, parent:'Employee'});
-
- this.filter_fields_dict['Employee'+FILTER_SEP +'Year'].df.in_first_page = 1;
-}
-
-report.get_query = function() {
-
- emp_month = this.filter_fields_dict['Employee'+FILTER_SEP+'Month'].get_value();
- emp_year = this.filter_fields_dict['Employee'+FILTER_SEP+'Year'].get_value();
- emp_status = this.filter_fields_dict['Employee'+FILTER_SEP+'Status'].get_value();
-
- // month and year mandatory
- if ((emp_month == '') || (emp_year == '')) {
- alert("Please enter Month and Year");
- return;
- }
-
- month={"January":"1", "February":"2", "March":"3", "April":"4","May":"5", "June":"6", "July":"7","August":"8", "September":"9", "October":"10", "November":"11", "December":"12"}
-
- mnt = ''
- for(m=0; m<emp_month.length;m++){
- if(mnt== '') mnt = "("+month[emp_month[m]];
- else mnt +=", "+month[emp_month[m]];
- }
- mnt +=")"
- c1 = '(MONTH(t1.date_of_joining) in '+mnt+' AND YEAR(t1.date_of_joining) = "'+emp_year+'")';
- c2 = '(MONTH(t1.relieving_date) in '+mnt+' AND YEAR(t1.relieving_date) = "'+emp_year+'")';
-
- if(emp_status == 'Active')
- cond = c1;
- else if (emp_status == 'Left')
- cond = c2;
- else
- cond = c1 + ' OR '+c2;
-
- var q = 'SELECT t1.name AS "ID", t1.employee_name AS "Employee Name", t1.employee_number AS "Employee Number" FROM `tabEmployee` t1 WHERE '+cond;
-
- return q;
-}
diff --git a/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.py b/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.py
deleted file mode 100644
index 7d5feca..0000000
--- a/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.py
+++ /dev/null
@@ -1,60 +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
-status = filter_values.get('status')
-month = filter_values.get('month')
-
-
-if status == 'Active' and not status == 'Left':
- col = [['Employee', 'Link', 'Employee'], ['Employee Name', 'Data', ''], ['Employee Number', 'Data', ''], ['Employment Type','Link','Employment Type'],['Scheduled Confirmation Date','Data',''],['Final Confirmation Date','Data',''],['Contract End Date','Data',''],['Branch','Link','Branch'],['Department','Link','Department'],['Designation','Link','Designation'],['Reports to','Link','Employee'],['Grade','Link','Grade']]
-
-elif status == 'Left' and not status == 'Active':
- col = [['Employee', 'Link', 'Employee'], ['Employee Name', 'Data', ''], ['Employee Number', 'Data', ''], ['Resignation Letter Date','Data',''],['Relieving Date','Data',''],['Notice - Number of Days','Data',''],['Reason for Leaving','Data',''],['Leave Encashed?','Data',''],['Encashment Date','Data',''],['Reason for Resignation','Data','']]
-
-else:
- col = [['Employee', 'Link', 'Employee'], ['Employee Name', 'Data', ''], ['Employee Number', 'Data', ''], ['Employment Type','Link','Employment Type'],['Scheduled Confirmation Date','Data',''],['Final Confirmation Date','Data',''],['Contract End Date','Data',''],['Branch','Link','Branch'],['Department','Link','Department'],['Designation','Link','Designation'],['Reports to','Link','Employee'],['Grade','Link','Grade'],['Resignation Letter Date','Data',''],['Relieving Date','Data',''],['Notice - Number of Days','Data',''],['Reason for Leaving','Data',''],['Leave Encashed?','Data',''],['Encashment Date','Data',''],['Reason for Resignation','Data','']]
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append('150px')
- coloptions.append(c[2])
-
- col_idx[c[0]] = len(colnames)-1
-
-
-for c in range(0,len(colnames)):
- l = (len(colnames[c])*9)
- if l < 150 : col_width = '150px'
- else: col_width = '%spx'%(l)
-
- colwidths[c] = col_width
-
-for r in res:
-
- if status == 'Active':
- ret = sql("select employment_type,scheduled_confirmation_date,final_confirmation_date,contract_end_date,branch,department,designation,reports_to,grade from `tabEmployee` where name = %s",r[0])
-
- elif status == 'Left':
- ret = sql("select resignation_letter_date,relieving_date,notice_number_of_days,reason_for_leaving,leave_encashed,encashment_date,reason_for_resignation from `tabEmployee` where name =%s",r[0])
-
- else:
- ret = sql("select employment_type,scheduled_confirmation_date,final_confirmation_date,contract_end_date,branch,department,designation,reports_to,grade,resignation_letter_date,relieving_date,notice_number_of_days,reason_for_leaving,leave_encashed,encashment_date,reason_for_resignation from `tabEmployee` where name = %s",r[0])
-
- ret = ret and ret[0] or []
- for t in ret:
- r.append(cstr(t))
diff --git a/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.txt b/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.txt
deleted file mode 100644
index 86d09b5..0000000
--- a/hr/search_criteria/new_or_left_employees_for_a_month/new_or_left_employees_for_a_month.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "harshada@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Employee\u0001Saved':1,'Employee\u0001Submitted':1,'Employee\u0001Gender':'','Employee\u0001Month of Birth':'','Employee\u0001Status':''}",
- "doctype": "Search Criteria",
- "doc_type": "Employee",
- "name": "__common__",
- "sort_by": "`tabEmployee`.`name`",
- "page_len": 50,
- "criteria_name": "New or left employees for a month",
- "columns": "Employee\u0001ID"
- },
- {
- "name": "new_or_left_employees_for_a_month",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/salary_register/__init__.py b/hr/search_criteria/salary_register/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/salary_register/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/salary_register/salary_register.js b/hr/search_criteria/salary_register/salary_register.js
deleted file mode 100644
index c451b27..0000000
--- a/hr/search_criteria/salary_register/salary_register.js
+++ /dev/null
@@ -1,25 +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() {
- fld_lst = ['ID','Employee']
-
- for(var i = 0; i<fld_lst.length; i++){
- this.filter_fields_dict['Salary Slip'+FILTER_SEP +fld_lst[i]].df.in_first_page = 1;
- }
-
-}
-this.mytabs.items['Select Columns'].hide();
\ No newline at end of file
diff --git a/hr/search_criteria/salary_register/salary_register.py b/hr/search_criteria/salary_register/salary_register.py
deleted file mode 100644
index d1d3e99..0000000
--- a/hr/search_criteria/salary_register/salary_register.py
+++ /dev/null
@@ -1,77 +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
-sal_slips_ids = ''
-for r in res:
- if not sal_slips_ids == '': sal_slips_ids +=","
- sal_slips_ids+="'%s'"%r[col_idx['ID']]
-
-earn_heads, ded_heads = [], []
-if res:
- earn_heads =[i[0] for i in sql("select distinct e_type from `tabSalary Slip Earning` where parent in (%s)"%sal_slips_ids)]
- ded_heads =[i[0] for i in sql("select distinct d_type from `tabSalary Slip Deduction` where parent in (%s)"%sal_slips_ids)]
-
-col=[]
-for e in earn_heads:
- l = (len(cstr(e))*9)
- if l < 150 :
- col_width = '150px'
- else:
- col_width = '%spx'%(l)
- col.append([e,'Currency',col_width,''])
-
-col.append(['Arrear Amount','Currency','150px',''])
-col.append(['Encashment Amount','Currency','170px',''])
-col.append(['Gross Pay','Currency','150px',''])
-for d in ded_heads:
- l = (len(cstr(d))*9)
- if l < 150 : col_width = '150px'
- else: col_width = '%spx'%(l)
- col.append([d,'Currency',col_width,''])
-
-col.append(['Total Deduction','Currency','150px',''])
-col.append(['Net Pay','Currency','150px',''])
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)
-
-grand_tot = 0
-for r in res:
- for i in range(6,len(colnames)):
- if colnames[i] not in ('Arrear Amount','Encashment Amount','Net Pay','Gross Pay','Total Deduction'):
- amt = sql("select e_modified_amount from `tabSalary Slip Earning` where e_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
- if not amt:
- amt = sql("select d_modified_amount from `tabSalary Slip Deduction` where d_type = '%s' and parent = '%s'"%(colnames[i],r[0]))
- amt = amt and amt[0][0] or 0
- r.append(flt(amt))
-
- else:
- fld_nm = cstr(colnames[i]).lower().replace(' ','_')
- tot = sql("select %s from `tabSalary Slip` where name ='%s'"%(fld_nm,r[0]))
- tot = tot and flt(tot[0][0]) or 0
- if colnames[i] == 'Net Pay':
- grand_tot += tot
- r.append(tot)
-
-gt_row = ['' for i in range(len(colnames))]
-gt_row[col_idx['Employee Name']] = '<b>Grand Totals</b>'
-gt_row[col_idx['Net Pay']-1] = grand_tot
-res.append(gt_row)
\ No newline at end of file
diff --git a/hr/search_criteria/salary_register/salary_register.txt b/hr/search_criteria/salary_register/salary_register.txt
deleted file mode 100644
index aab7f25..0000000
--- a/hr/search_criteria/salary_register/salary_register.txt
+++ /dev/null
@@ -1,26 +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": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Salary Slip\u0001Submitted':1,'Salary Slip\u0001Month':''}",
- "doctype": "Search Criteria",
- "doc_type": "Salary Slip",
- "name": "__common__",
- "sort_by": "`tabSalary Slip`.`name`",
- "page_len": 50,
- "criteria_name": "Salary Register",
- "columns": "Salary Slip\u0001ID,Salary Slip\u0001Employee,Salary Slip\u0001Employee Name,Salary Slip\u0001Year,Salary Slip\u0001Month,Salary Slip\u0001Total days in month,Salary Slip\u0001Payment days"
- },
- {
- "name": "salary_register",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/salary_slips/__init__.py b/hr/search_criteria/salary_slips/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/salary_slips/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/salary_slips/salary_slips.txt b/hr/search_criteria/salary_slips/salary_slips.txt
deleted file mode 100644
index e1bcccf..0000000
--- a/hr/search_criteria/salary_slips/salary_slips.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Salary Slip\u0001Saved':1,'Salary Slip\u0001Submitted':1}",
- "doctype": "Search Criteria",
- "doc_type": "Salary Slip",
- "name": "__common__",
- "sort_by": "`tabSalary Slip`.`name`",
- "page_len": 50,
- "criteria_name": "Salary Slips",
- "columns": "Salary Slip\u0001ID,Salary Slip\u0001Fiscal Year,Salary Slip\u0001Month,Salary Slip\u0001Employee,Salary Slip\u0001Employee Name,Salary Slip\u0001Department,Salary Slip\u0001Designation,Salary Slip\u0001Branch,Salary Slip\u0001Grade,Salary Slip\u0001PF No.,Salary Slip\u0001ESIC No.,Salary Slip\u0001Leave Without Pay,Salary Slip\u0001Bank Name,Salary Slip\u0001Bank Account No.,Salary Slip\u0001Payment days,Salary Slip\u0001Arrear Amount,Salary Slip\u0001Encashment Amount,Salary Slip\u0001Gross Pay,Salary Slip\u0001Total Deduction,Salary Slip\u0001Net Pay"
- },
- {
- "name": "salary_slips",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/hr/search_criteria/salary_structure_details/__init__.py b/hr/search_criteria/salary_structure_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/hr/search_criteria/salary_structure_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/hr/search_criteria/salary_structure_details/salary_structure_details.txt b/hr/search_criteria/salary_structure_details/salary_structure_details.txt
deleted file mode 100644
index c1ed01b..0000000
--- a/hr/search_criteria/salary_structure_details/salary_structure_details.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "module": "HR",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Salary Structure\u0001Branch':'','Salary Structure\u0001Designation':'','Salary Structure\u0001Department':'','Salary Structure\u0001Grade':'','Salary Structure\u0001Is Active':''}",
- "doctype": "Search Criteria",
- "doc_type": "Salary Structure",
- "name": "__common__",
- "sort_by": "`tabSalary Structure`.`name`",
- "page_len": 50,
- "criteria_name": "Salary Structure Details",
- "columns": "Salary Structure\u0001ID,Salary Structure\u0001Employee,Salary Structure\u0001From Date,Salary Structure\u0001To Date,Salary Structure\u0001Fiscal Year,Salary Structure\u0001Branch,Salary Structure\u0001Designation,Salary Structure\u0001Department,Salary Structure\u0001Grade,Salary Structure\u0001Is Active,Salary Structure\u0001Total Earning,Salary Structure\u0001Total Deduction,Salary Structure\u0001CTC,Salary Structure\u0001Total"
- },
- {
- "name": "salary_structure_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/manufacturing/search_criteria/__init__.py b/manufacturing/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/manufacturing/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/manufacturing/search_criteria/consumption_against_production/__init__.py b/manufacturing/search_criteria/consumption_against_production/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/manufacturing/search_criteria/consumption_against_production/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/manufacturing/search_criteria/consumption_against_production/consumption_against_production.txt b/manufacturing/search_criteria/consumption_against_production/consumption_against_production.txt
deleted file mode 100644
index 70620ff..0000000
--- a/manufacturing/search_criteria/consumption_against_production/consumption_against_production.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "owner": "jai@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-12-10 18:30:00"
- },
- {
- "add_col": "`tabProduction Order`.consider_sa_items",
- "parent_doc_type": "Stock Entry",
- "module": "Manufacturing",
- "standard": "Yes",
- "sort_order": "DESC",
- "add_tab": "`tabProduction Order`",
- "doc_type": "Stock Entry Detail",
- "name": "__common__",
- "filters": "{'Stock Entry\u0001Submitted':1,'Stock Entry\u0001Purpose':'Production Order','Stock Entry\u0001Process':''}",
- "add_cond": "`tabProduction Order`.name = `tabStock Entry`.production_order",
- "doctype": "Search Criteria",
- "sort_by": "`tabStock Entry`.`name`",
- "page_len": 50,
- "criteria_name": "Consumption Against Production",
- "columns": "Stock Entry\u0001ID,Stock Entry\u0001Production Order,Stock Entry\u0001Process,Stock Entry\u0001Posting Date,Stock Entry\u0001Company,Stock Entry Detail\u0001Source Warehouse,Stock Entry Detail\u0001Target Warehouse,Stock Entry Detail\u0001FG Item,Stock Entry Detail\u0001Item Code,Stock Entry Detail\u0001Description,Stock Entry Detail\u0001Reqd Qty,Stock Entry Detail\u0001Transfer Quantity"
- },
- {
- "name": "consumption_against_production",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/manufacturing/search_criteria/itemwise_production_report/__init__.py b/manufacturing/search_criteria/itemwise_production_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/manufacturing/search_criteria/itemwise_production_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/manufacturing/search_criteria/itemwise_production_report/itemwise_production_report.js b/manufacturing/search_criteria/itemwise_production_report/itemwise_production_report.js
deleted file mode 100644
index 4998fad..0000000
--- a/manufacturing/search_criteria/itemwise_production_report/itemwise_production_report.js
+++ /dev/null
@@ -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() {
-
- //to hide all filters
- this.hide_all_filters();
-
- // to unhide required filters
- this.filter_fields_dict['Stock Entry'+FILTER_SEP +'ID'].df.filter_hide = 0;
- this.filter_fields_dict['Stock Entry'+FILTER_SEP +'Production Order'].df.filter_hide = 0;
-
- this.filter_fields_dict['Stock Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
- this.filter_fields_dict['Stock Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
-
- this.filter_fields_dict['Stock Entry Detail'+FILTER_SEP +'Target Warehouse'].df.filter_hide = 0;
-
- this.filter_fields_dict['Stock Entry Detail'+FILTER_SEP +'Item Code'].df.filter_hide = 0;
-}
\ No newline at end of file
diff --git a/manufacturing/search_criteria/itemwise_production_report/itemwise_production_report.txt b/manufacturing/search_criteria/itemwise_production_report/itemwise_production_report.txt
deleted file mode 100644
index 7814fec..0000000
--- a/manufacturing/search_criteria/itemwise_production_report/itemwise_production_report.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "jai@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-12-10 18:30:00"
- },
- {
- "parent_doc_type": "Stock Entry",
- "module": "Manufacturing",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Stock Entry\u0001Saved':1,'Stock Entry\u0001Submitted':1,'Stock Entry\u0001Purpose':'Production Order','Stock Entry\u0001Process':'Backflush','Stock Entry Detail\u0001FG Item':1}",
- "doc_type": "Stock Entry Detail",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabStock Entry`.`name`",
- "page_len": 50,
- "criteria_name": "Itemwise Production Report",
- "columns": "Stock Entry\u0001ID,Stock Entry\u0001Posting Date,Stock Entry\u0001Production Order,Stock Entry\u0001Process,Stock Entry\u0001Company,Stock Entry Detail\u0001Target Warehouse,Stock Entry Detail\u0001Item Code,Stock Entry Detail\u0001Description,Stock Entry Detail\u0001Stock UOM,Stock Entry Detail\u0001Transfer Quantity"
- },
- {
- "name": "itemwise_production_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/manufacturing/search_criteria/production_orders_in_process/__init__.py b/manufacturing/search_criteria/production_orders_in_process/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/manufacturing/search_criteria/production_orders_in_process/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/manufacturing/search_criteria/production_orders_in_process/production_orders_in_process.txt b/manufacturing/search_criteria/production_orders_in_process/production_orders_in_process.txt
deleted file mode 100644
index 3a8c8c9..0000000
--- a/manufacturing/search_criteria/production_orders_in_process/production_orders_in_process.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "jai@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-12-10 18:30:00"
- },
- {
- "module": "Manufacturing",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Production Order\u0001Submitted':1,'Production Order\u0001Origin':'','Production Order\u0001Status':'','Production Order\u0001Consider SA Items':'','Production Order\u0001Fiscal Year':''}",
- "doc_type": "Production Order",
- "name": "__common__",
- "add_cond": "`tabProduction Order`.qty > `tabProduction Order`.produced_qty",
- "doctype": "Search Criteria",
- "sort_by": "`tabProduction Order`.`name`",
- "page_len": 50,
- "criteria_name": "Production Orders In Process",
- "columns": "Production Order\u0001ID,Production Order\u0001Origin,Production Order\u0001Status,Production Order\u0001Posting Date,Production Order\u0001Production Item,Production Order\u0001BOM No,Production Order\u0001Description,Production Order\u0001Stock UOM,Production Order\u0001Qty,Production Order\u0001Produced Qty,Production Order\u0001FG Warehouse,Production Order\u0001WIP Warehouse,Production Order\u0001Consider SA Items,Production Order\u0001Fiscal Year,Production Order\u0001Company"
- },
- {
- "name": "production_orders_in_process",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py b/patches/june_2013/p05_remove_search_criteria_reports.py
similarity index 85%
rename from buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py
rename to patches/june_2013/p05_remove_search_criteria_reports.py
index e7ada4f..78963db 100644
--- a/buying/search_criteria/pending_po_items_to_receive/pending_po_items_to_receive.py
+++ b/patches/june_2013/p05_remove_search_criteria_reports.py
@@ -15,5 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
-colwidths[col_idx['Pending Quantity To Receive']] = '200px'
-colwidths[col_idx['Pending Amount To Receive']] = '200px'
+import webnotes
+
+def execute():
+ webnotes.conn.sql("""delete from `tabSearch Criteria` where ifnull(standard, 'No') = 'Yes'""")
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 6b88955..0353c74 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -255,4 +255,5 @@
"patches.june_2013.p01_update_bom_exploded_items",
"execute:webnotes.delete_doc('DocType', 'System Console')",
"patches.june_2013.p04_fix_event_for_lead_oppty_project",
+ "patches.june_2013.p05_remove_search_criteria_reports",
]
\ No newline at end of file
diff --git a/projects/search_criteria/__init__.py b/projects/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/projectwise_delivered_qty_and_costs/__init__.py b/projects/search_criteria/projectwise_delivered_qty_and_costs/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/projectwise_delivered_qty_and_costs/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/projectwise_delivered_qty_and_costs/projectwise_delivered_qty_and_costs.js b/projects/search_criteria/projectwise_delivered_qty_and_costs/projectwise_delivered_qty_and_costs.js
deleted file mode 100644
index c8b42dc..0000000
--- a/projects/search_criteria/projectwise_delivered_qty_and_costs/projectwise_delivered_qty_and_costs.js
+++ /dev/null
@@ -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;
-}
diff --git a/projects/search_criteria/projectwise_delivered_qty_and_costs/projectwise_delivered_qty_and_costs.txt b/projects/search_criteria/projectwise_delivered_qty_and_costs/projectwise_delivered_qty_and_costs.txt
deleted file mode 100644
index b2ecb6c..0000000
--- a/projects/search_criteria/projectwise_delivered_qty_and_costs/projectwise_delivered_qty_and_costs.txt
+++ /dev/null
@@ -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"
- }
-]
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_pending_qty_and_costs/__init__.py b/projects/search_criteria/projectwise_pending_qty_and_costs/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/projectwise_pending_qty_and_costs/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/projectwise_pending_qty_and_costs/projectwise_pending_qty_and_costs.js b/projects/search_criteria/projectwise_pending_qty_and_costs/projectwise_pending_qty_and_costs.js
deleted file mode 100644
index ce56077..0000000
--- a/projects/search_criteria/projectwise_pending_qty_and_costs/projectwise_pending_qty_and_costs.js
+++ /dev/null
@@ -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;
-}
diff --git a/projects/search_criteria/projectwise_pending_qty_and_costs/projectwise_pending_qty_and_costs.txt b/projects/search_criteria/projectwise_pending_qty_and_costs/projectwise_pending_qty_and_costs.txt
deleted file mode 100644
index 37b6294..0000000
--- a/projects/search_criteria/projectwise_pending_qty_and_costs/projectwise_pending_qty_and_costs.txt
+++ /dev/null
@@ -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"
- }
-]
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_purchase_details/__init__.py b/projects/search_criteria/projectwise_purchase_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/projectwise_purchase_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.js b/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.js
deleted file mode 100644
index bd4be54..0000000
--- a/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.js
+++ /dev/null
@@ -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;
- }
-}
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.py b/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.py
deleted file mode 100644
index ed82ceb..0000000
--- a/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.py
+++ /dev/null
@@ -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
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.txt b/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.txt
deleted file mode 100644
index cb88f58..0000000
--- a/projects/search_criteria/projectwise_purchase_details/projectwise_purchase_details.txt
+++ /dev/null
@@ -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"
- }
-]
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_sales_details/__init__.py b/projects/search_criteria/projectwise_sales_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/projectwise_sales_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.js b/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.js
deleted file mode 100644
index 4e92c3c..0000000
--- a/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.js
+++ /dev/null
@@ -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;
- }
-
-}
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.py b/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.py
deleted file mode 100644
index 50ade66..0000000
--- a/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.py
+++ /dev/null
@@ -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
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.txt b/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.txt
deleted file mode 100644
index 11a50a6..0000000
--- a/projects/search_criteria/projectwise_sales_details/projectwise_sales_details.txt
+++ /dev/null
@@ -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"
- }
-]
\ No newline at end of file
diff --git a/projects/search_criteria/projectwise_sales_orders/__init__.py b/projects/search_criteria/projectwise_sales_orders/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/projectwise_sales_orders/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/projectwise_sales_orders/projectwise_sales_orders.txt b/projects/search_criteria/projectwise_sales_orders/projectwise_sales_orders.txt
deleted file mode 100644
index 29919e6..0000000
--- a/projects/search_criteria/projectwise_sales_orders/projectwise_sales_orders.txt
+++ /dev/null
@@ -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"
- }
-]
\ No newline at end of file
diff --git a/projects/search_criteria/timesheet_report/__init__.py b/projects/search_criteria/timesheet_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/projects/search_criteria/timesheet_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/projects/search_criteria/timesheet_report/timesheet_report.js b/projects/search_criteria/timesheet_report/timesheet_report.js
deleted file mode 100644
index 12d9680..0000000
--- a/projects/search_criteria/timesheet_report/timesheet_report.js
+++ /dev/null
@@ -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()
\ No newline at end of file
diff --git a/projects/search_criteria/timesheet_report/timesheet_report.txt b/projects/search_criteria/timesheet_report/timesheet_report.txt
deleted file mode 100644
index 14bbe08..0000000
--- a/projects/search_criteria/timesheet_report/timesheet_report.txt
+++ /dev/null
@@ -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"
- }
-]
\ No newline at end of file
diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js
index 91649e3..73cc718 100644
--- a/selling/page/selling_home/selling_home.js
+++ b/selling/page/selling_home/selling_home.js
@@ -137,11 +137,6 @@
"label":wn._("Sales Analytics"),
page: "sales-analytics"
},
- {
- "label":wn._("Trend Analyzer"),
- route: "Report/Profile/Trend Analyzer",
- doctype: "Sales Order"
- },
]
},
{
diff --git a/selling/search_criteria/__init__.py b/selling/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/delivered_items_to_be_install/__init__.py b/selling/search_criteria/delivered_items_to_be_install/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/delivered_items_to_be_install/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/delivered_items_to_be_install/delivered_items_to_be_install.js b/selling/search_criteria/delivered_items_to_be_install/delivered_items_to_be_install.js
deleted file mode 100644
index df8fc21..0000000
--- a/selling/search_criteria/delivered_items_to_be_install/delivered_items_to_be_install.js
+++ /dev/null
@@ -1,20 +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['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;
-}
\ No newline at end of file
diff --git a/selling/search_criteria/delivered_items_to_be_install/delivered_items_to_be_install.txt b/selling/search_criteria/delivered_items_to_be_install/delivered_items_to_be_install.txt
deleted file mode 100644
index ab23a29..0000000
--- a/selling/search_criteria/delivered_items_to_be_install/delivered_items_to_be_install.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "add_col": "(`tabDelivery Note Item`.`qty`- ifnull(`tabDelivery Note Item`.`installed_qty`, 0)) AS 'Pending to Install'",
- "parent_doc_type": "Delivery Note",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Delivery Note\u0001Saved':1,'Delivery Note\u0001Submitted':1,'Delivery Note\u0001Status':'','Delivery Note\u0001Fiscal Year':''}",
- "description": "Delivered Items to be Install",
- "doc_type": "Delivery Note Item",
- "name": "__common__",
- "add_cond": "`tabDelivery Note Item`.`qty` > ifnull(`tabDelivery Note Item`.`installed_qty`, 0)",
- "doctype": "Search Criteria",
- "sort_by": "`tabDelivery Note`.`name`",
- "page_len": 50,
- "criteria_name": "Delivered Items to be Install",
- "columns": "Delivery Note\u0001ID,Delivery Note\u0001Status,Delivery Note\u0001Customer,Delivery Note\u0001Customer Name,Delivery Note\u0001Contact Person,Delivery Note\u0001Voucher Date,Delivery Note Item\u0001Item Code,Delivery Note Item\u0001Item Name,Delivery Note Item\u0001Quantity,Delivery Note Item\u0001Installed Qty,Delivery Note\u0001% Installed"
- },
- {
- "name": "delivered_items_to_be_install",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/draft_sales_orders/__init__.py b/selling/search_criteria/draft_sales_orders/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/draft_sales_orders/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/draft_sales_orders/draft_sales_orders.js b/selling/search_criteria/draft_sales_orders/draft_sales_orders.js
deleted file mode 100644
index 7f8aed8..0000000
--- a/selling/search_criteria/draft_sales_orders/draft_sales_orders.js
+++ /dev/null
@@ -1,22 +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['Sales Order'+FILTER_SEP +'From Sales Order Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'To Sales Order Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-
-}
\ No newline at end of file
diff --git a/selling/search_criteria/draft_sales_orders/draft_sales_orders.txt b/selling/search_criteria/draft_sales_orders/draft_sales_orders.txt
deleted file mode 100644
index af60e71..0000000
--- a/selling/search_criteria/draft_sales_orders/draft_sales_orders.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[
- {
- "creation": "2012-05-14 18:20:52",
- "docstatus": 0,
- "modified": "2013-01-30 15:19:07",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "columns": "Sales Order\u0001ID,Sales Order\u0001Status,Sales Order\u0001Sales Order Date,Sales Order\u0001Customer,Sales Order\u0001P.O. No,Sales Order\u0001Currency,Sales Order\u0001Grand Total (Export)",
- "criteria_name": "Draft Sales Orders",
- "custom_query": "",
- "description": "List of Open Sales orders filtered by period, customer and other details",
- "doc_type": "Sales Order",
- "doctype": "Search Criteria",
- "filters": "{\"Sales Order\\u0001Saved\":1,\"Sales Order\\u0001Submitted\":1,\"Sales Order\\u0001To Sales Order Date\\u0001upper\":\"2013-01-30\",\"Sales Order\\u0001Company\":\"Alpha\",\"Sales Order\\u0001Fiscal Year\":[\"\"],\"Sales Order\\u0001Status\":[\"Draft\"]}",
- "module": "Selling",
- "name": "__common__",
- "page_len": 50,
- "report_script": null,
- "sort_by": "`tabSales Order`.`name`",
- "sort_order": "DESC",
- "standard": "Yes"
- },
- {
- "doctype": "Search Criteria",
- "name": "draft_sales_orders"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/follow_up_report/__init__.py b/selling/search_criteria/follow_up_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/follow_up_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/follow_up_report/follow_up_report.js b/selling/search_criteria/follow_up_report/follow_up_report.js
deleted file mode 100644
index 2126d0b..0000000
--- a/selling/search_criteria/follow_up_report/follow_up_report.js
+++ /dev/null
@@ -1,63 +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.mytabs.items['Select Columns'].hide()
- this.mytabs.items['More Filters'].hide()
-
- this.hide_all_filters();
- this.add_filter({fieldname:'follow_up_on', label:'Communication on', fieldtype:'Select', options:''+NEWLINE+'Lead'+NEWLINE+'Opportunity'+NEWLINE+'Quotation',ignore : 1,parent:'Communication Log', in_first_page : 1, single_select :1});
- this.add_filter({fieldname:'lead_name', label:'Lead', fieldtype:'Link', options:'Lead', report_default:'', ignore : 1, parent:'Communication Log', in_first_page : 1});
- this.add_filter({fieldname:'enq_name', label:'Opportunity', fieldtype:'Link', options:'Opportunity', report_default:'', ignore : 1, parent:'Communication Log', in_first_page : 1});
- this.add_filter({fieldname:'qtn_name', label:'Quotation', fieldtype:'Link', options:'Quotation', report_default:'', ignore : 1, parent:'Communication Log', in_first_page : 1});
-
- this.get_filter('Communication Log', 'Communication type').set_as_single();
- this.set_filter_properties('Communication Log', 'Communication by', {filter_hide:0, in_first_page : 1});
- this.set_filter_properties('Communication Log', 'Communication type', {filter_hide:0, in_first_page : 1});
- this.set_filter_properties('Communication Log', 'From Date', {filter_hide:0, in_first_page : 1});
- this.set_filter_properties('Communication Log', 'To Date', {filter_hide:0, in_first_page : 1});
-
- this.orig_sort_list = [['Date','`tabCommunication Log`.`date`'],['Document Type','`tabCommunication Log`.`parenttype`'],['Document','`tabCommunication Log`.`parent`'],['Follow Up By','`tabCommunication Log`.`follow_up_by`'],['Follow Up Type','`tabCommunication Log`.`follow_up_type`']];
-}
-
-
-report.get_query = function() {
- var lead_id = this.filter_fields_dict['Communication Log'+FILTER_SEP+'Lead'].get_value();
- var enq_id = this.filter_fields_dict['Communication Log'+FILTER_SEP+'Opportunity'].get_value();
- var quo_id = this.filter_fields_dict['Communication Log'+FILTER_SEP+'Quotation'].get_value();
-
- var follow_up_on = this.filter_fields_dict['Communication Log'+FILTER_SEP+'Communication on'].get_value();
- var follow_up_by = this.filter_fields_dict['Communication Log'+FILTER_SEP+'Communication by'].get_value();
-
- var on_type = this.filter_fields_dict['Communication Log'+FILTER_SEP+'Communication type'].get_value();
- var from_date = this.filter_fields_dict['Communication Log'+FILTER_SEP+'From Date'].get_value();
- var to_date = this.filter_fields_dict['Communication Log'+FILTER_SEP+'To Date'].get_value();
-
- var cond = 'parenttype IN ("Lead","Opportunity","Quotation")';
- if(follow_up_on) cond = 'parenttype = "'+follow_up_on+'"';
-
- if((follow_up_on == 'Lead' && lead_id) || (lead_id && !follow_up_on)) cond +=' AND parent = "'+lead_id+'"';
- if((follow_up_on == 'Opportunity' && enq_id) || (enq_id && !follow_up_on)) cond +=' AND parent = "'+enq_id+'"';
- if((follow_up_on == 'Quotation' && quo_id) || (quo_id && !follow_up_on)) cond +=' AND parent = "'+quo_id+'"';
-
- if(on_type) cond += ' AND follow_up_type ="'+on_type+'"';
- if(from_date) cond += ' AND date >="'+from_date+'"';
- if(to_date) cond += ' AND date <="'+to_date+'"';
- if(follow_up_by) cond += ' AND follow_up_by = "'+follow_up_by+'"';
-
- var q ='SELECT distinct `tabCommunication Log`.`parenttype`, `tabCommunication Log`.`parent`, `tabCommunication Log`.`date`, `tabCommunication Log`.`notes`, `tabCommunication Log`.`follow_up_type`, `tabCommunication Log`.`follow_up_by` FROM `tabCommunication Log` WHERE '+cond+' ORDER BY '+sel_val(this.dt.sort_sel)+' '+this.dt.sort_order;
- return q;
-}
diff --git a/selling/search_criteria/follow_up_report/follow_up_report.py b/selling/search_criteria/follow_up_report/follow_up_report.py
deleted file mode 100644
index 4006627..0000000
--- a/selling/search_criteria/follow_up_report/follow_up_report.py
+++ /dev/null
@@ -1,33 +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
-follow_up_on = filter_values.get('follow_up_on')
-
-cols = [['Document Type', 'Data', '150px', '']
- ,['Document', 'Link', '150px', follow_up_on]
- ,['Follow Up Date', 'Date', '150px', '']
- ,['Description','Data','300px','']
- ,['Follow Up Type','Data','150px','']
- ,['Follow Up By','Link','150px','Sales Person']
- ]
-
-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
diff --git a/selling/search_criteria/follow_up_report/follow_up_report.txt b/selling/search_criteria/follow_up_report/follow_up_report.txt
deleted file mode 100644
index b789bd9..0000000
--- a/selling/search_criteria/follow_up_report/follow_up_report.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "ashwini@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "parent_doc_type": "Lead",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Lead\u0001Status':'','Lead\u0001Source':'','Lead\u0001Lead Type':'','Lead\u0001Rating':'','Lead\u0001Market Segment':'','Lead\u0001Fiscal Year':''}",
- "doc_type": "Communication Log",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabLead`.`name`",
- "page_len": 50,
- "criteria_name": "Follow-up Report",
- "columns": "Lead\u0001ID,Communication Log\u0001Date,Communication Log\u0001Notes,Communication Log\u0001Communication Log type"
- },
- {
- "name": "follow-up_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/itemwise_delivery_details/__init__.py b/selling/search_criteria/itemwise_delivery_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/itemwise_delivery_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.js b/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.js
deleted file mode 100644
index b056676..0000000
--- a/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.js
+++ /dev/null
@@ -1,21 +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['Delivery Note'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Delivery Note'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
-
-}
diff --git a/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.py b/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.py
deleted file mode 100644
index 0529d1b..0000000
--- a/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.py
+++ /dev/null
@@ -1,34 +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
-out=[]
-qty,amt,bill_amt=0,0,0
-
-for r in res:
- qty += flt(r[col_idx['Quantity']])
- amt += flt(r[col_idx['Amount*']])
- bill_amt += flt(r[col_idx['Billed Amt']])
- out.append(r)
-
-
-#Add the totals row
-l_row = ['' for i in range(len(colnames))]
-l_row[col_idx['Item Name']] = '<b>TOTALS</b>'
-l_row[col_idx['Quantity']] = qty
-l_row[col_idx['Amount*']] = amt
-l_row[col_idx['Billed Amt']] = bill_amt
-out.append(l_row)
diff --git a/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.txt b/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.txt
deleted file mode 100644
index 9ba342e..0000000
--- a/selling/search_criteria/itemwise_delivery_details/itemwise_delivery_details.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-23 12:46:00",
- "modified_by": "Administrator",
- "modified": "2012-05-03 18:13:49"
- },
- {
- "parent_doc_type": "Delivery Note",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"Delivery Note\\u0001Submitted\":1,\"Delivery Note\\u0001Status\":[\"\"],\"Delivery Note\\u0001Fiscal Year\":[\"\"]}",
- "doc_type": "Delivery Note Item",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabDelivery Note`.`name`",
- "page_len": 50,
- "criteria_name": "Itemwise Delivery Details",
- "columns": "Delivery Note\u0001ID,Delivery Note Item\u0001Item Code,Delivery Note Item\u0001Item Name,Delivery Note Item\u0001Quantity,Delivery Note Item\u0001Rate*,Delivery Note Item\u0001Amount*,Delivery Note Item\u0001Billed Amt"
- },
- {
- "name": "itemwise_delivery_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/itemwise_sales_details/__init__.py b/selling/search_criteria/itemwise_sales_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/itemwise_sales_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.js b/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.js
deleted file mode 100644
index 7ff214a..0000000
--- a/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.js
+++ /dev/null
@@ -1,27 +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['Sales Order'+FILTER_SEP +'ID'].df.in_first_page = 1;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'From Sales Order Date'].df['report_default'] = sys_defaults.year_start_date;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'To Sales Order Date'].df['report_default'] = dateutil.obj_to_str(new Date());
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
- this.filter_fields_dict['Sales Order Item'+FILTER_SEP +'Item Code'].df.in_first_page = 1;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'Status'].df.filter_hide = 1;
-}
-
-//this.mytabs.items['Select Columns'].hide();
-this.mytabs.items['More Filters'].hide();
\ No newline at end of file
diff --git a/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.py b/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.py
deleted file mode 100644
index 1b7a195..0000000
--- a/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.py
+++ /dev/null
@@ -1,36 +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
-out=[]
-qty,amt,del_qty,bill_amt=0,0,0,0
-
-for r in res:
- qty += flt(r[col_idx['Quantity']])
- amt += flt(r[col_idx['Amount*']])
- del_qty += flt(r[col_idx['Delivered Qty']])
- bill_amt += flt(r[col_idx['Billed Amt']])
- out.append(r)
-
-
-#Add the totals row
-l_row = ['' for i in range(len(colnames))]
-l_row[col_idx['Item Name']] = '<b>TOTALS</b>'
-l_row[col_idx['Quantity']] = qty
-l_row[col_idx['Amount*']] = amt
-l_row[col_idx['Delivered Qty']] = del_qty
-l_row[col_idx['Billed Amt']] = bill_amt
-out.append(l_row)
diff --git a/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.txt b/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.txt
deleted file mode 100644
index 7737040..0000000
--- a/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-23 12:46:00",
- "modified_by": "Administrator",
- "modified": "2012-05-03 18:18:31"
- },
- {
- "parent_doc_type": "Sales Order",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{\"Sales Order\\u0001Submitted\":1,\"Sales Order\\u0001Fiscal Year\":[\"\"],\"Sales Order\\u0001Status\":[\"\"]}",
- "doc_type": "Sales Order Item",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Order`.`name`",
- "page_len": 50,
- "criteria_name": "Itemwise Sales Details",
- "columns": "Sales Order\u0001ID,Sales Order\u0001Customer,Sales Order Item\u0001Item Code,Sales Order Item\u0001Item Name,Sales Order Item\u0001Quantity,Sales Order Item\u0001Basic Rate*,Sales Order Item\u0001Amount*,Sales Order Item\u0001Delivered Qty,Sales Order Item\u0001Billed Amt"
- },
- {
- "name": "itemwise_sales_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/lead_to_follow_up/__init__.py b/selling/search_criteria/lead_to_follow_up/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/lead_to_follow_up/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/lead_to_follow_up/lead_to_follow_up.js b/selling/search_criteria/lead_to_follow_up/lead_to_follow_up.js
deleted file mode 100644
index 94f2ef5..0000000
--- a/selling/search_criteria/lead_to_follow_up/lead_to_follow_up.js
+++ /dev/null
@@ -1,21 +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['Lead'+FILTER_SEP +'Status'].df.filter_hide = 1;
- this.filter_fields_dict['Lead'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
-}
-
\ No newline at end of file
diff --git a/selling/search_criteria/lead_to_follow_up/lead_to_follow_up.txt b/selling/search_criteria/lead_to_follow_up/lead_to_follow_up.txt
deleted file mode 100644
index 2ddd5e9..0000000
--- a/selling/search_criteria/lead_to_follow_up/lead_to_follow_up.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Lead\u0001Status':'','Lead\u0001Source':'','Lead\u0001Expected Month':'','Lead\u0001Industry':'','Lead\u0001Market Segment':'','Lead\u0001Rating':''}",
- "doc_type": "Lead",
- "name": "__common__",
- "add_cond": "`tabLead`.status!='Converted' \n`tabLead`.status!='Lead Lost' \n`tabLead`.status!='Not Interested'",
- "doctype": "Search Criteria",
- "sort_by": "`tabLead`.`name`",
- "page_len": 50,
- "criteria_name": "Lead-To follow up",
- "columns": "Lead\u0001ID,Lead\u0001Status,Lead\u0001Lead Name,Lead\u0001Lead Date,Lead\u0001Lead Owner,Lead\u0001Next Contact Date"
- },
- {
- "name": "lead-to_follow_up",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/lead_to_follow_up/sales_order_overdue.js b/selling/search_criteria/lead_to_follow_up/sales_order_overdue.js
deleted file mode 100644
index 799cd22..0000000
--- a/selling/search_criteria/lead_to_follow_up/sales_order_overdue.js
+++ /dev/null
@@ -1,27 +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.filter_fields_dict['Sales Order'+FILTER_SEP +'Customer'].df.filter_hide = 0;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'ID'].df.filter_hide = 0;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'Quotation No'].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 +'Sales Partner'].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 +'From Sales Order Date'].df.filter_hide = 0;
- this.filter_fields_dict['Sales Order'+FILTER_SEP +'To Sales Order Date'].df.filter_hide = 0;
-}
\ No newline at end of file
diff --git a/selling/search_criteria/opportunity_to_follow_up/__init__.py b/selling/search_criteria/opportunity_to_follow_up/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/opportunity_to_follow_up/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/opportunity_to_follow_up/opportunity_to_follow_up.txt b/selling/search_criteria/opportunity_to_follow_up/opportunity_to_follow_up.txt
deleted file mode 100644
index b524e6a..0000000
--- a/selling/search_criteria/opportunity_to_follow_up/opportunity_to_follow_up.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-03-30 14:50:44",
- "modified_by": "Administrator",
- "modified": "2012-03-30 14:50:44"
- },
- {
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Opportunity\u0001Fiscal Year':''}",
- "doc_type": "Opportunity",
- "name": "__common__",
- "add_cond": "`tabOpportunity`.name=`tabQuotation`.enq_no\n`tabOpportunity`.docstatus=1\n`tabQuotation`.status='Submitted'",
- "doctype": "Search Criteria",
- "sort_by": "`tabOpportunity`.`name`",
- "page_len": 50,
- "criteria_name": "Opportunity-To follow up",
- "columns": "Opportunity\u0001ID,Opportunity\u0001Owner,Opportunity\u0001Company,Opportunity\u0001Fiscal Year"
- },
- {
- "name": "opportunity-to_follow_up",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/sales_orderwise_booking_&_delivery_summary/__init__.py b/selling/search_criteria/sales_orderwise_booking_&_delivery_summary/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/sales_orderwise_booking_&_delivery_summary/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/sales_orderwise_booking_&_delivery_summary/sales_orderwise_booking_&_delivery_summary.txt b/selling/search_criteria/sales_orderwise_booking_&_delivery_summary/sales_orderwise_booking_&_delivery_summary.txt
deleted file mode 100644
index 9050204..0000000
--- a/selling/search_criteria/sales_orderwise_booking_&_delivery_summary/sales_orderwise_booking_&_delivery_summary.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "add_col": "SUM(CASE WHEN `tabSales Order`.`status` = 'Stopped' THEN (`tabSales Order Item`.`delivered_qty` * `tabSales Order Item`.`basic_rate`) ELSE (`tabSales Order Item`.`qty` * `tabSales Order Item`.`basic_rate`) END) AS 'Booking Total'\nSUM(`tabSales Order Item`.`delivered_qty` * `tabSales Order Item`.`basic_rate`) AS 'Delivered Amount'",
- "parent_doc_type": "Sales Order",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Order\u0001Submitted':1,'Sales Order\u0001Status':'','Sales Order\u0001Fiscal Year':''}",
- "description": "Sales Orderwise Booking & Delivery Summary",
- "doc_type": "Sales Order Item",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Order`.`name`",
- "group_by": "`tabSales Order`.`name`",
- "page_len": 50,
- "criteria_name": "Sales Orderwise Booking & Delivery Summary",
- "columns": "Sales Order\u0001ID,Sales Order\u0001Status,Sales Order\u0001% Billed,Sales Order\u0001Sales Order Date,Sales Order\u0001Customer,Sales Order\u0001Customer Name,Sales Order\u0001Territory"
- },
- {
- "name": "sales_orderwise_booking_&_delivery_summary",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/sales_orderwise_pending_amount_to_bill/__init__.py b/selling/search_criteria/sales_orderwise_pending_amount_to_bill/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/sales_orderwise_pending_amount_to_bill/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/sales_orderwise_pending_amount_to_bill/sales_orderwise_pending_amount_to_bill.js b/selling/search_criteria/sales_orderwise_pending_amount_to_bill/sales_orderwise_pending_amount_to_bill.js
deleted file mode 100644
index 1b3837a..0000000
--- a/selling/search_criteria/sales_orderwise_pending_amount_to_bill/sales_orderwise_pending_amount_to_bill.js
+++ /dev/null
@@ -1,20 +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['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;
-}
\ No newline at end of file
diff --git a/selling/search_criteria/sales_orderwise_pending_amount_to_bill/sales_orderwise_pending_amount_to_bill.txt b/selling/search_criteria/sales_orderwise_pending_amount_to_bill/sales_orderwise_pending_amount_to_bill.txt
deleted file mode 100644
index 1a8d19b..0000000
--- a/selling/search_criteria/sales_orderwise_pending_amount_to_bill/sales_orderwise_pending_amount_to_bill.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-[
- {
- "owner": "dhanalekshmi@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` - ifnull(`tabSales Order Item`.`billed_qty`, 0)) * `tabSales Order Item`.`basic_rate`) AS \"Pending Amount\"",
- "parent_doc_type": "Sales Order",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Order\u0001Saved':1,'Sales Order\u0001Submitted':1,'Sales Order\u0001Company Name':'','Sales Order\u0001Fiscal Year':''}",
- "description": "Sales Orderwise Pending Amount To Bill",
- "doc_type": "Sales Order Item",
- "name": "__common__",
- "add_cond": "`tabSales Order`.status != \"Stopped\"\n`tabSales Order`.order_type!=\"Maintenance\"",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Order`.`name`",
- "group_by": "`tabSales Order`.`name`",
- "page_len": 50,
- "criteria_name": "Sales Orderwise Pending Amount To Bill",
- "columns": "Sales Order\u0001ID,Sales Order\u0001Customer,Sales Order\u0001Customer Address,Sales Order\u0001Status,Sales Order\u0001% Delivered,Sales Order\u0001% Billed,Sales Order\u0001Company Name,Sales Order\u0001Sales Order Date,Sales Order\u0001Net Total,Sales Order\u0001Zone,Sales Order\u0001Territory,Sales Order\u0001Email Id"
- },
- {
- "name": "sales_orderwise_pending_amount_to_bill",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/sales_orderwise_pending_qty_to_deliver/__init__.py b/selling/search_criteria/sales_orderwise_pending_qty_to_deliver/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/sales_orderwise_pending_qty_to_deliver/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/sales_orderwise_pending_qty_to_deliver/sales_orderwise_pending_qty_to_deliver.txt b/selling/search_criteria/sales_orderwise_pending_qty_to_deliver/sales_orderwise_pending_qty_to_deliver.txt
deleted file mode 100644
index d9b1581..0000000
--- a/selling/search_criteria/sales_orderwise_pending_qty_to_deliver/sales_orderwise_pending_qty_to_deliver.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-[
- {
- "owner": "dhanalekshmi@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` - ifnull(`tabSales Order Item`.`delivered_qty`, 0)) AS \"Pending Qty\"",
- "parent_doc_type": "Sales Order",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Order\u0001Saved':1,'Sales Order\u0001Submitted':1,'Sales Order\u0001Status':'','Sales Order\u0001Fiscal Year':''}",
- "description": "Sales Orderwise Pending Qty To Deliver",
- "doc_type": "Sales Order Item",
- "name": "__common__",
- "add_cond": "`tabSales Order`.status != \"Stopped\"\n`tabSales Order Item`.`qty` > ifnull(`tabSales Order Item`.`delivered_qty`, 0)",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Order`.`name`",
- "group_by": "`tabSales Order`.`name`",
- "page_len": 50,
- "criteria_name": "Sales Orderwise Pending Qty To Deliver",
- "columns": "Sales Order\u0001ID,Sales Order\u0001Customer,Sales Order\u0001Customer Name,Sales Order\u0001Customer Address,Sales Order\u0001Status,Sales Order\u0001% Delivered,Sales Order\u0001% Billed,Sales Order\u0001Sales Order Date,Sales Order\u0001Territory,Sales Order\u0001Email Id"
- },
- {
- "name": "sales_orderwise_pending_qty_to_deliver",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/sales_persons_target_variance_item_group_wise/__init__.py b/selling/search_criteria/sales_persons_target_variance_item_group_wise/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/sales_persons_target_variance_item_group_wise/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.js b/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.js
deleted file mode 100644
index 8e46f42..0000000
--- a/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.js
+++ /dev/null
@@ -1,57 +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:'sales_person', label:'Sales Person', fieldtype:'Link', options:'Sales Person',ignore : 1,parent:'Target Detail'});
-
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Target Detail'});
-
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Target Detail'});
-
- this.add_filter({fieldname:'under', label:'Under',fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice',report_default:'Sales Order',ignore : 1, parent:'Target Detail'});
-
- this.add_filter({fieldname : 'target_on', label:'Target On', fieldtype:'Select', options:'Quantity'+NEWLINE+'Amount',report_default:'Quantity',ignore : 1,parent:'Target Detail'});
- this.filter_fields_dict['Target Detail'+FILTER_SEP +'Sales Person'].df.in_first_page = 1;
-}
-this.mytabs.items['Select Columns'].hide();
-report.get_query = function() {
-
- sales_person = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Sales Person'].get_value();
- target_on = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Target On'].get_value();
- under = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Under'].get_value();
- if(under == 'Sales Invoice') under = 'Sales Invoice';
-
- if(target_on == 'Quantity'){
- q1 = 't1.target_qty AS "Target Quantity"';
- q2 = '0 AS "Target Quantity"';
- cond1 = 'ifnull(t1.target_qty,"")!=""';
- cond2 = 'ifnull(t6.target_qty,"")!=""';
- }
- else{
- q1 = 't1.target_amount AS "Target Amount"';
- q2 = '0 AS "Target Amount"';
- cond1 = 'ifnull(t1.target_amount,"")!=""';
- cond2 = 'ifnull(t6.target_amount,"")!=""';
- }
-
- var q ='SELECT t1.item_group AS "Item Group", '+q1+', t2.distribution_id AS "Distribution Id" FROM `tabTarget Detail` t1, `tabSales Person` t2 WHERE t1.parenttype = "Sales Person" AND t1.parent = "'+sales_person+'" AND t1.parent=t2.name AND ifnull(t1.item_group,"") != "" AND '+cond1+' UNION SELECT t3.item_group AS "Item Group", '+q2+',"" AS "Distribution Id" FROM `tab'+under+' Item` t3,`tabSales Team` t4,`tab'+under+'` t5 where t3.item_group NOT IN (SELECT t6.item_group AS "Item Group" FROM `tabTarget Detail` t6, `tabSales Person` t7 WHERE t6.parenttype = "Sales Person" AND t6.parent = "'+sales_person+'" AND t6.parent=t7.name AND '+cond2+') AND t4.sales_person = "'+sales_person+'" AND t3.parent = t5.name AND t4.parent = t5.name AND t5.docstatus = 1';
-
- return q;
-
-}
diff --git a/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.py b/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.py
deleted file mode 100644
index 3c822a6..0000000
--- a/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.py
+++ /dev/null
@@ -1,145 +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/>.
-# validate Filters
-from __future__ import unicode_literals
-flt_dict = {'fiscal_year': 'Fiscal Year', 'period': 'Period', 'under' : 'Under', 'sales_person':'Sales Person', 'target_on':'Target On'}
-for f in flt_dict:
- if not filter_values.get(f):
- msgprint("Please Select " + cstr(flt_dict[f]))
- raise Exception
-
-# Get Values from fliters
-fiscal_year = filter_values.get('fiscal_year')[0]
-period = filter_values.get('period')
-under = filter_values.get('under')
-sales_person = filter_values.get('sales_person')
-target_on = filter_values.get('target_on')
-
-
-# set colnames
-for d in ['Item Group', 'Total Target Allocated', 'Distribution Id']:
- colnames.append(d)
- coltypes.append('Data')
- colwidths.append('150px')
- coloptions.append('')
- col_idx[d] = len(colnames) - 1
-
-
-
-# Set required field names
-based_on_fn = 'sales_person'
-
-date_fn = (under == 'Sales Order' ) and 'transaction_date' or 'posting_date'
-
-mon_list = []
-
-data = {'start_date':0, 'end_date':1}
-
-def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
- count = 1
- if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
- for m in range(12):
- # get last date
- last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
-
- # make mon_list for Monthly Period
- if period == 'Monthly' :
- mon_list.append([start_date, last_date])
- # add months as Column names
- month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
- append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
-
- # get start date
- start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
-
- # make mon_list for Quaterly Period
- if period == 'Quarterly' and count % 3 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column names
- append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Half Yearly Period
- if period == 'Half Yearly' and count % 6 == 0 :
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Annual Period
- if period == 'Annual' and count % 12 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
- count = count +1
-
-def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
- col = ['Target', 'Actual', 'Variance']
- for c in col:
- n = str(name) and ' (' + str(name) +')' or ''
- colnames.append(str(c) + n )
- coltypes.append('Currency')
- colwidths.append('150px')
- coloptions.append('')
- col_idx[str(c) + n ] = len(colnames) - 1
-
-
-
-
-# get start date
-start_date = webnotes.conn.get_value('Fiscal Year', fiscal_year, 'year_start_date')
-if not start_date:
- msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
- raise Exception
-start_date = start_date.strftime('%Y-%m-%d')
-
-# make month list and columns
-make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
-
-
-bc_obj = get_obj('Budget Control')
-for r in res:
-
- count = 0
-
- for idx in range(3, len(colnames), 3):
-
- cidx = 2
- # ================= Calculate Target ==========================================
- r.append(bc_obj.get_monthly_budget(r[cidx], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[cidx-1]))
-
- #================== Actual Amount =============================================
- actual = 0
-
-
- #----------------------------------------------------------
- if target_on == "Quantity":
-
- actual = sql("select sum(ifnull(t2.qty,0) * ifnull(t3.allocated_percentage,0) / 100) from `tab%s` t1, `tab%s Item` t2, `tabSales Team` t3 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t2.item_group = '%s' and t1.docstatus = 1 and t1.%s between '%s' and '%s' "%(under, under, based_on_fn, sales_person, r[0].strip(), date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
- #----------------------------------------------------------
- if target_on == "Amount":
-
- actual = sql("select sum(ifnull(t2.amount,0) * ifnull(t3.allocated_percentage,0) / 100) from `tab%s` t1, `tab%s Item` t2, `tabSales Team` t3 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t2.item_group = '%s' and t1.docstatus = 1 and t1.%s between '%s' and '%s' "%(under, under, based_on_fn, sales_person, r[0].strip(), date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
- #----------------------------------------------------------
-
- actual = actual and flt(actual[0][0]) or 0
- r.append(actual)
- # ================ Variance ===================================================
-
- r.append(r[idx] - r[idx + 1])
-
- count = count +1
diff --git a/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.txt b/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.txt
deleted file mode 100644
index 5535182..0000000
--- a/selling/search_criteria/sales_persons_target_variance_item_group_wise/sales_persons_target_variance_item_group_wise.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "parent_doc_type": "Sales Person",
- "module": "Selling",
- "doctype": "Search Criteria",
- "sort_order": "DESC",
- "filters": "{'Sales Person\u0001Country':'','Sales Person\u0001State':'','Target Detail\u0001Fiscal Year':''}",
- "standard": "Yes",
- "doc_type": "Target Detail",
- "name": "__common__",
- "sort_by": "`tabTarget Detail`.`target_amount`",
- "page_len": 50,
- "criteria_name": "Sales Persons Target Variance (Item Group wise)"
- },
- {
- "name": "sales_persons_target_variance_item_group_wise",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/sales_personwise_transaction_summary/__init__.py b/selling/search_criteria/sales_personwise_transaction_summary/__init__.py
deleted file mode 100755
index baffc48..0000000
--- a/selling/search_criteria/sales_personwise_transaction_summary/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.js b/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.js
deleted file mode 100755
index 79dd9d5..0000000
--- a/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.js
+++ /dev/null
@@ -1,53 +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();
-
- //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 == "Delivery Note") 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';
-}
-
diff --git a/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.py b/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.py
deleted file mode 100755
index 632e545..0000000
--- a/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.py
+++ /dev/null
@@ -1,30 +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
-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
diff --git a/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.txt b/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.txt
deleted file mode 100755
index 5f29981..0000000
--- a/selling/search_criteria/sales_personwise_transaction_summary/sales_personwise_transaction_summary.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Person\u0001Saved':1,'Sales Person\u0001Submitted':1,'Sales Person\u0001Country':'','Sales Person\u0001State':''}",
- "doctype": "Search Criteria",
- "doc_type": "Sales Person",
- "name": "__common__",
- "sort_by": "`tabSales Person`.`name`",
- "page_len": 50,
- "criteria_name": "Sales Personwise Transaction Summary",
- "columns": "Sales Person\u0001ID"
- },
- {
- "name": "sales_personwise_transaction_summary",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/serial_no_amc_expiring_this_month/__init__.py b/selling/search_criteria/serial_no_amc_expiring_this_month/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/serial_no_amc_expiring_this_month/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/serial_no_amc_expiring_this_month/serial_no_amc_expiring_this_month.txt b/selling/search_criteria/serial_no_amc_expiring_this_month/serial_no_amc_expiring_this_month.txt
deleted file mode 100644
index 463d077..0000000
--- a/selling/search_criteria/serial_no_amc_expiring_this_month/serial_no_amc_expiring_this_month.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Serial No\u0001Saved':1,'Serial No\u0001Submitted':1,'Serial No\u0001Status':'','Serial No\u0001Warranty Status':''}",
- "doc_type": "Serial No",
- "name": "__common__",
- "add_cond": "`tab Serial No`.month(amc_expiry_date)=month(now()) \n`tab Serial No`.year(amc_expiry_date)=year(now())",
- "doctype": "Search Criteria",
- "sort_by": "`tabSerial No`.`name`",
- "page_len": 50,
- "criteria_name": "Serial No-AMC expiring this month",
- "columns": "Serial No\u0001ID,Serial No\u0001Status,Serial No\u0001AMC Expiry Date,Serial No\u0001Customer Name"
- },
- {
- "name": "serial_no-amc_expiring_this_month",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/serial_no_warranty_expiring_this_month/__init__.py b/selling/search_criteria/serial_no_warranty_expiring_this_month/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/serial_no_warranty_expiring_this_month/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/serial_no_warranty_expiring_this_month/serial_no_warranty_expiring_this_month.txt b/selling/search_criteria/serial_no_warranty_expiring_this_month/serial_no_warranty_expiring_this_month.txt
deleted file mode 100644
index 05a9f0f..0000000
--- a/selling/search_criteria/serial_no_warranty_expiring_this_month/serial_no_warranty_expiring_this_month.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:52",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:52"
- },
- {
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Serial No\u0001Saved':1,'Serial No\u0001Submitted':1,'Serial No\u0001Status':'Issued','Serial No\u0001Maintenance Status':''}",
- "doc_type": "Serial No",
- "name": "__common__",
- "add_cond": "`tab Serial No`.docstatus!=2\n`tab Serial No`.maintenance_status='Under Warranty'\n`tab Serial No`.status!='Scrapped'\n`tab Serial No`.status!='Not in Use'\n`tab Serial No`.month(ifnull(warranty_expiry_date,0)) = month(now()) \n`tab Serial No`.yearmonth(ifnull(warranty_expiry_date,0)) = year(now())",
- "doctype": "Search Criteria",
- "sort_by": "`tabSerial No`.`name`",
- "page_len": 50,
- "criteria_name": "Serial No-Warranty expiring this month",
- "columns": "Serial No\u0001ID,Serial No\u0001Status,Serial No\u0001Warranty Expiry Date,Serial No\u0001Customer Name"
- },
- {
- "name": "serial_no-warranty_expiring_this_month",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/target_variance_report/__init__.py b/selling/search_criteria/target_variance_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/target_variance_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/target_variance_report/target_variance_report.js b/selling/search_criteria/target_variance_report/target_variance_report.js
deleted file mode 100644
index cc8e03e..0000000
--- a/selling/search_criteria/target_variance_report/target_variance_report.js
+++ /dev/null
@@ -1,43 +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:'based_on', label:'Based On', fieldtype:'Select', options:'Cost Center'+NEWLINE+'Sales Person'+NEWLINE+'Sales Partner',report_default:'Cost Center',ignore : 1,parent:'Target Detail'});
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company',report_default:sys_defaults.company, ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'group_by', label:'Group By', fieldtype:'Select', options:NEWLINE+'Item Group',ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'under', label:'Under',fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice',report_default:'Sales Order',ignore : 1, parent:'Target Detail'});
-
-}
-
-report.get_query = function() {
- group_by = '';
- group_by = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Group By'].get_value();
- based_on = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Based On'].get_value();
- sel_fields = '`tabTarget Detail`.parent AS "' + cstr(based_on)+'"';
- cond = ' and ifnull(`tabTarget Detail`.item_group, "") = ""'
- if (group_by == 'Item Group'){
- sel_fields = cstr(sel_fields) + ', `tabTarget Detail`.item_group';
- cond = ' and ifnull(`tabTarget Detail`.item_group,"") != ""'
- }
- sel_fields = cstr(sel_fields) + ', `tabTarget Detail`.target_amount, `tabTarget Detail`.distribution_id';
- var q = 'SELECT '+ cstr(sel_fields) +' FROM `tabTarget Detail` WHERE `tabTarget Detail`.parenttype = "' + cstr(based_on) + '"'+ cstr(cond);
- return q
-}
-
-this.mytabs.items['Select Columns'].hide();
\ No newline at end of file
diff --git a/selling/search_criteria/target_variance_report/target_variance_report.py b/selling/search_criteria/target_variance_report/target_variance_report.py
deleted file mode 100644
index 0c14112..0000000
--- a/selling/search_criteria/target_variance_report/target_variance_report.py
+++ /dev/null
@@ -1,127 +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/>.
-
-# validate Filters
-from __future__ import unicode_literals
-flt_dict = {'fiscal_year': 'Fiscal Year', 'period': 'Period', 'company':'Company', 'under' : 'Under', 'based_on' : 'Based On'}
-for f in flt_dict:
- if not filter_values.get(f):
- msgprint("Please Select " + cstr(flt_dict[f]))
- raise Exception
-
-# Get Values from fliters
-fiscal_year = filter_values.get('fiscal_year')
-period = filter_values.get('period')
-under = filter_values.get('under')
-based_on = filter_values.get('based_on')
-group_by = filter_values.get('group_by')
-
-# Set required field names
-based_on_fn = (based_on == 'Cost Center') and 'cost_center' or (based_on == 'Sales Partner') and 'sales_partner' or (based_on == 'Sales Person') and 'sales_person'
-date_fn = (under == 'Sales Order' ) and 'transaction_date' or 'posting_date'
-
-mon_list = []
-data = {'start_date':0, 'end_date':1}
-
-def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
- count = 1
- if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
- for m in range(12):
- # get last date
- last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
-
- # make mon_list for Monthly Period
- if period == 'Monthly' :
- mon_list.append([start_date, last_date])
- # add months as Column names
- month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
- append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
-
- # get start date
- start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
-
- # make mon_list for Quaterly Period
- if period == 'Quarterly' and count % 3 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column names
- append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Half Yearly Period
- if period == 'Half Yearly' and count % 6 == 0 :
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Annual Period
- if period == 'Annual' and count % 12 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
- count = count +1
-
-def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
- col = ['Budget', 'Actual', 'Variance']
- for c in col:
- colnames.append(str(c) + ' (' + str(name) +')' )
- coltypes.append('Currency')
- colwidths.append('150px')
- coloptions.append('')
- col_idx[str(c) + ' (' + str(name) +')' ] = len(colnames) - 1
-
-# make default columns
-coltypes[col_idx[based_on]] = 'Link'
-coloptions[col_idx[based_on]]= based_on
-
-# get start date
-start_date = webnotes.conn.get_value('Fiscal Year', fiscal_year, 'year_start_date')
-if not start_date:
- msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
- raise Exception
-start_date = start_date.strftime('%Y-%m-%d')
-
-# make month list and columns
-make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
-
-bc_obj = get_obj('Budget Control')
-for r in res:
- count = 0
- for idx in range((group_by == 'Item Group') and 4 or 3, len(colnames), 3):
- cidx = (group_by == 'Item Group') and 3 or 2
- # ================= Calculate Target ==========================================
- r.append(bc_obj.get_monthly_budget( r[cidx], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[cidx-1]))
-
- #================== Actual Amount =============================================
- actual = 0
- if based_on == 'Cost Center' or based_on == 'Sales Partner':
- if group_by =='Item Group':
- actual = sql("select sum(ifnull(t2.amount,0)) from `tab%s` t1, `tab%s Detail` t2, `tabItem` t3 where t2.parenttype = '%s' and t2.parent = t1.name and t1.%s = '%s' and t3.name = t2.item_code and t3.item_group = '%s' and t1.docstatus = 1 and t1.%s between '%s' and '%s'" % (under, (under == 'Sales Invoice') and 'RV' or under, under, based_on_fn, r[0], r[1], date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
- actual = flt(actual[0][0])
- else:
- actual = sql("select sum(ifnull(net_total,0)) from `tab%s` where %s = '%s' and docstatus = 1 and %s between '%s' and '%s' " % (under, based_on_fn, r[0], date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
- actual = flt(actual[0][0])
- elif based_on == 'Sales Person':
- if group_by =='Item Group':
- actual = sql("select sum(ifnull(t2.amount,0) * ifnull(t3.allocated_percentage,0) / 100) from `tab%s` t1, `tab%s Detail` t2, `tabSales Team` t3, `tabItem` t4 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t4.name = t2.item_code and t4.item_group = '%s' and t1.docstatus != 2 and t1.docstatus = 1 and t1.%s between '%s' and '%s' "%(under, (under == 'Sales Invoice') and 'RV' or under, based_on_fn, r[0], r[1], date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
- actual = flt(actual[0][0])
- else:
- actual = sql("select sum(ifnull(t2.allocated_amount,0)) from `tab%s` t1, `tabSales Team` t2 where t2.%s = '%s' and t2.parenttype='%s' and t1.docstatus != 2 and t2.parent = t1.name and t1.%s between '%s' and '%s'"%(under, based_on_fn, r[0], under, date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
- actual = flt(actual[0][0])
- r.append(actual)
- # ================ Variance ===================================================
- r.append(r[idx] - r[idx + 1])
- count = count +1
\ No newline at end of file
diff --git a/selling/search_criteria/target_variance_report/target_variance_report.txt b/selling/search_criteria/target_variance_report/target_variance_report.txt
deleted file mode 100644
index c892366..0000000
--- a/selling/search_criteria/target_variance_report/target_variance_report.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "harshada@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "parent_doc_type": "Sales Person",
- "module": "Selling",
- "standard": "Yes",
- "disabled": 0,
- "sort_order": "DESC",
- "filters": "{'Sales Person\u0001Saved':1,'Sales Person\u0001Submitted':1,'Sales Person\u0001Country':'','Sales Person\u0001State':'','Target Detail\u0001Fiscal Year':''}",
- "doc_type": "Target Detail",
- "name": "__common__",
- "doctype": "Search Criteria",
- "page_len": 50,
- "criteria_name": "Target Variance Report",
- "columns": "Sales Person\u0001ID,Sales Person\u0001Owner,Sales Person\u0001Sales Person,Sales Person\u0001Country,Sales Person\u0001State,Target Detail\u0001Item Group,Target Detail\u0001Fiscal Year,Target Detail\u0001Target Amount"
- },
- {
- "name": "target_variance_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/territories_target_variance_item_group_wise/__init__.py b/selling/search_criteria/territories_target_variance_item_group_wise/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/territories_target_variance_item_group_wise/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.js b/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.js
deleted file mode 100644
index d7dcf70..0000000
--- a/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.js
+++ /dev/null
@@ -1,61 +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:'territory', label:'Territory', fieldtype:'Link', options:'Territory',ignore : 1,parent:'Target Detail'});
-
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Target Detail'});
-
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Target Detail'});
-
- this.add_filter({fieldname:'under', label:'Under',fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice',report_default:'Sales Order',ignore : 1, parent:'Target Detail'});
-
- this.add_filter({fieldname : 'target_on', label:'Target On', fieldtype:'Select', options:'Quantity'+NEWLINE+'Amount',report_default:'Quantity',ignore : 1,parent:'Target Detail'});
- this.filter_fields_dict['Target Detail'+FILTER_SEP +'Territory'].df.in_first_page = 1;
-}
-this.mytabs.items['Select Columns'].hide();
-report.get_query = function() {
-
- territory = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Territory'].get_value();
- target_on = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Target On'].get_value();
- under = this.filter_fields_dict['Target Detail'+FILTER_SEP+'Under'].get_value();
- if(under == 'Sales Invoice') under = 'Sales Invoice';
-
- if(target_on == 'Quantity'){
- q1 = 't1.target_qty AS "Target Quantity"';
- q2 = '0 AS "Target Quantity"';
- cond1 = 'ifnull(t1.target_qty,"")!=""';
- cond2 = 'ifnull(t5.target_qty,"")!=""';
- }
- else{
- q1 = 't1.target_amount AS "Target Amount"';
- q2 = '0 AS "Target Amount"';
- cond1 = 'ifnull(t1.target_amount,"")!=""';
- cond2 = 'ifnull(t5.target_amount,"")!=""';
- }
- if(under =='Sales Invoice')
- tab = 'RV';
- else
- tab = under;
-
- var q ='SELECT distinct t1.item_group AS "Item Group", '+q1+', t2.distribution_id AS "Distribution Id" FROM `tabTarget Detail` t1, `tabTerritory` t2 WHERE t1.parenttype = "Territory" AND t1.parent = "'+territory+'" AND t1.parent=t2.name AND ifnull(t1.item_group,"")!="" AND '+cond1+' UNION SELECT distinct t3.item_group AS "Item Group", '+q2+',"" AS "Distribution Id" FROM `tab'+tab+' Detail` t3,`tab'+under+'` t4 where t3.item_group NOT IN (SELECT t5.item_group FROM `tabTarget Detail` t5, `tabTerritory` t6 WHERE t5.parenttype = "Territory" AND t5.parent = "'+territory+'" AND t5.parent=t6.name AND '+cond2+') AND t4.territory = "'+territory+'" AND t3.parent = t4.name AND t4.docstatus = 1';
-
- return q;
-
-}
\ No newline at end of file
diff --git a/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.py b/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.py
deleted file mode 100644
index 17acb47..0000000
--- a/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.py
+++ /dev/null
@@ -1,144 +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/>.
-
-# validate Filters
-from __future__ import unicode_literals
-flt_dict = {'fiscal_year': 'Fiscal Year', 'period': 'Period', 'under' : 'Under', 'territory':'Territory', 'target_on':'Target On'}
-for f in flt_dict:
- if not filter_values.get(f):
- msgprint("Please Select " + cstr(flt_dict[f]))
- raise Exception
-
-# Get Values from fliters
-fiscal_year = filter_values.get('fiscal_year')
-period = filter_values.get('period')
-under = filter_values.get('under')
-if under == 'Sales Invoice': under = 'Sales Invoice'
-territory = filter_values.get('territory')
-target_on = filter_values.get('target_on')
-
-
-# Set required field names
-based_on_fn = 'territory'
-
-date_fn = (under == 'Sales Order' ) and 'transaction_date' or 'posting_date'
-
-mon_list = []
-
-data = {'start_date':0, 'end_date':1}
-
-def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
- count = 1
- if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
- for m in range(12):
- # get last date
- last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
-
- # make mon_list for Monthly Period
- if period == 'Monthly' :
- mon_list.append([start_date, last_date])
- # add months as Column names
- month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
- append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
-
- # get start date
- start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
-
- # make mon_list for Quaterly Period
- if period == 'Quarterly' and count % 3 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column names
- append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Half Yearly Period
- if period == 'Half Yearly' and count % 6 == 0 :
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Annual Period
- if period == 'Annual' and count % 12 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
- count = count +1
-
-def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
- col = ['Target', 'Actual', 'Variance']
- for c in col:
- n = str(name) and ' (' + str(name) +')' or ''
- colnames.append(str(c) + n )
- coltypes.append('Currency')
- colwidths.append('150px')
- coloptions.append('')
- col_idx[str(c) + n ] = len(colnames) - 1
-
-
-
-# make default columns
-#coltypes[col_idx['Item Group']] = 'Link'
-#coloptions[col_idx['Item Group']]= 'Sales '
-
-# get start date
-start_date = webnotes.conn.get_value('Fiscal Year', fiscal_year, 'year_start_date')
-if not start_date:
- msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
- raise Exception
-start_date = start_date.strftime('%Y-%m-%d')
-
-# make month list and columns
-make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
-
-
-
-bc_obj = get_obj('Budget Control')
-for r in res:
-
- count = 0
-
- for idx in range(3, len(colnames), 3):
-
- cidx = 2
- # ================= Calculate Target ==========================================
- r.append(bc_obj.get_monthly_budget(r[cidx], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[cidx-1]))
-
- #================== Actual Amount =============================================
- actual = 0
-
-
-
- #----------------------------------------------------------
- if target_on == "Quantity":
-
- actual = sql("select sum(ifnull(t2.qty,0)) from `tab%s` t1, `tab%s Detail` t2 where t2.parenttype = '%s' and t2.parent = t1.name and t1.%s = '%s' and t1.docstatus = 1 and t2.item_group = '%s' and t1.%s between '%s' and '%s'" % (under, (under == 'Sales Invoice') and 'RV' or under, under, based_on_fn, territory, r[0],date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
-
- #----------------------------------------------------------
- if target_on == "Amount":
-
- actual = sql("select sum(ifnull(t2.amount,0)) from `tab%s` t1, `tab%s Detail` t2 where t2.parenttype = '%s' and t2.parent = t1.name and t1.%s = '%s' and t1.docstatus = 1 and t2.item_group = '%s' and t1.%s between '%s' and '%s'" % (under, (under == 'Sales Invoice') and 'RV' or under, under, based_on_fn, territory, r[0],date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
- #----------------------------------------------------------
-
- actual = actual and flt(actual[0][0]) or 0
- r.append(actual)
- # ================ Variance ===================================================
-
- r.append(r[idx] - r[idx + 1])
-
- count = count +1
\ No newline at end of file
diff --git a/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.txt b/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.txt
deleted file mode 100644
index a64b47e..0000000
--- a/selling/search_criteria/territories_target_variance_item_group_wise/territories_target_variance_item_group_wise.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "parent_doc_type": "Sales Person",
- "module": "Selling",
- "doctype": "Search Criteria",
- "sort_order": "DESC",
- "filters": "{'Sales Person\u0001Country':'','Sales Person\u0001State':'','Target Detail\u0001Fiscal Year':''}",
- "standard": "Yes",
- "doc_type": "Target Detail",
- "name": "__common__",
- "sort_by": "`tabTarget Detail`.`target_amount`",
- "page_len": 50,
- "criteria_name": "Territories Target Variance (Item Group wise)"
- },
- {
- "name": "territories_target_variance_item_group_wise",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/territory_sales___variance_report/__init__.py b/selling/search_criteria/territory_sales___variance_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/territory_sales___variance_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.js b/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.js
deleted file mode 100644
index aabd4e1..0000000
--- a/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.js
+++ /dev/null
@@ -1,22 +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.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:'Territory'});
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Territory'});
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company',report_default:sys_defaults.company, ignore : 1, parent:'Territory'});
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Territory'});
-}
\ No newline at end of file
diff --git a/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.py b/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.py
deleted file mode 100644
index e9e40aa..0000000
--- a/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.py
+++ /dev/null
@@ -1,205 +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
-if filter_values.get('period'):
- period_values = filter_values['period']
- if len(period_values.split(NEWLINE))>1:
- msgprint("You can view report only for one period. Please select only one value in period.")
- raise Exception
- else:
- period = period_values.split(NEWLINE)[0]
-
-if filter_values.get('based_on'):
- based_on = filter_values['based_on']
- if len(based_on.split(NEWLINE)) > 1:
- msgprint("You can view report based on only one criteria. Please select only one value in Based On.")
- raise Exception
- else:
- based_on = based_on.split(NEWLINE)[0]
-
-if not filter_values.get('fiscal_year'):
- msgprint("Please Select Fiscal Year")
- raise Exception
-elif not filter_values.get('period'):
- msgprint("Please Select Period")
- raise Exception
-elif not filter_values.get('based_on'):
- msgprint("Please Select the Criteria on which you want your report to be based")
- raise Exception
-
-fiscal_year = filter_values.get('fiscal_year')
-
-# get fiscal year start date and start month
-# ---------------------------------------------------------
-year_start_date = sql("select year_start_date,MONTH(year_start_date) from `tabFiscal Year` where name = %s",fiscal_year)
-start_date = year_start_date and year_start_date[0][0] or ''
-start_month = year_start_date and year_start_date[0][1] or ''
-month_name = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
-
-# Add columns based on period
-# --------------------------------
-columns = []
-# ================ Annual ======================
-if period == 'Annual':
- columns.append(['Target','Currency','120px',''])
- columns.append(['Actual','Currency','120px',''])
-
-# =========== Half Yearly ======================
-elif period == 'Half Yearly':
- columns.append(['Target (H1)','Currency','120px','']) # first half
- columns.append(['Actual (H1)','Currency','120px','']) # first half
- if start_month == 1: # this is case when fiscal year starts with JAN
- columns.append(['Target (H2)','Currency','120px',''])
- columns.append(['Actual (H2)','Currency','120px',''])
- else: #this is case when fiscal year starts with other than JAN
- columns.append(['Target (H2)','Currency','120px',''])
- columns.append(['Actual (H2)','Currency','120px',''])
-
-# ================ Quarterly ===================
-elif period == 'Quarterly':
- length_1 = (len(month_name) - start_month + 1) / 3 #this gives the total no. of times we need to iterate for quarter
- val = length_1 % 4
- q_no = 1
- for i in range(length_1):
- value = 3*i + val
- columns.append(['Target (Q'+cstr(q_no)+')','Currency','120px',''])
- columns.append(['Actual (Q'+cstr(q_no)+')','Currency','120px',''])
- q_no += 1
- length_2 = (start_month - 1) / 3 #this gives the total no. of times we need to iterate for quarter (this is required only if fiscal year starts from april)
- for i in range(length_2):
- columns.append(['Target (Q'+cstr(q_no)+')','Currency','120px',''])
- columns.append(['Actual (Q'+cstr(q_no)+')','Currency','120px',''])
- q_no += 1;
-
-
-# =============== Monthly ======================
-elif period == 'Monthly':
- for i in range(start_month-1,len(month_name)):
- columns.append(['Target ('+month_name[i]+')','Currency','120px',''])
- columns.append(['Actual ('+month_name[i]+')','Currency','120px',''])
-
- for i in range(start_month-1):
- columns.append(['Target('+month_name[i]+')','Currency','120px',''])
- columns.append(['Actual ('+month_name[i]+')','Currency','120px',''])
-
-
-
-for c in columns:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)-1
-
-
-condition = ' docstatus = 1 and fiscal_year = "'+fiscal_year+'"'
-
-
-for r in res:
- query = ''
-
- # ================= Annual Report ===============
- if period == 'Annual':
-
- target = sql("select sum(target_amount) from `tabTarget Detail` where parent = %s and parenttype= 'Territory' and fiscal_year = %s ",(r[col_idx['ID']],fiscal_year))
- target = target and flt(target[0][0]) or 0
- r.append(target)
-
-
- so = sql("select sum(net_total) from `tab%s` where territory = '%s' and %s" % (based_on, r[col_idx['ID']],condition))
- so = so and flt(so[0][0]) or 0
- r.append(so)
-
- # ================= Half Yearly Report ===============
- elif period == 'Half Yearly':
- target = sql("select sum(target_amount) from `tabTarget Detail` where parent = %s and parenttype= 'Territory' and fiscal_year = %s",(r[col_idx['ID']],fiscal_year))
- target = target and flt(flt(target[0][0])/2) or 0
- r.append(target)
-
- query += ' MONTH(transaction_date) BETWEEN '+cstr(start_month)+' and '+cstr(start_month+5)
- so = sql("select sum(net_total) from `tab%s` where territory = '%s' and %s and %s" % (based_on, r[col_idx['ID']],condition,query))
- so = so and flt(so[0][0]) or 0
- r.append(so)
-
- r.append(target)
-
- query =''
- query += 'MONTH(transaction_date) NOT BETWEEN '+cstr(start_month)+' and '+cstr(start_month+5)
- so = sql("select sum(net_total) from `tab%s` where territory = '%s' and %s and %s" % (based_on, r[col_idx['ID']],condition,query))
- so = so and flt(so[0][0]) or 0
- r.append(so)
- query = ''
-
- # =============== Quarterly Report ==============
- elif period == 'Quarterly':
- query = ''
- length_1 = (len(month_name) - start_month + 1) / 3; #this gives the total no. of times we need to iterate for quarter
- val = length_1 % 4;
- for i in range(length_1):
- value = 3*i + val;
- query +='SUM(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN net_total ELSE NULL END),'
- length_2 = (start_month - 1) / 3; #this gives the total no. of times we need to iterate for quarter (this is required only if fiscal year starts from april)
- for i in range(length_2):
- query += 'SUM(CASE WHEN MONTH(transaction_date) BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN net_total ELSE NULL END)';
-
- target = sql("select sum(target_amount) from `tabTarget Detail` where parent = %s and parenttype= 'Territory' and fiscal_year = %s",(r[col_idx['ID']],fiscal_year))
- target = target and flt(flt(target[0][0])/4) or 0
-
-
- so = sql("SELECT %s from `tab%s` where territory ='%s' and %s " %(query,based_on,r[col_idx['ID']],condition))
- i = 0
- length_l = 0
- for c in columns:
- if length_l == 0:
- r.append(target)
- length_l += 1
- else:
- so_total = so and flt(so[0][i]) or 0
- r.append(so_total)
- i +=1
- length_l = 0
-
- # ================ Monthly Report ===============
- elif period == 'Monthly':
- query =''
- target = sql("select sum(target_amount) from `tabTarget Detail` where parent = %s and parenttype= 'Territory' and fiscal_year = %s",(r[col_idx['ID']],fiscal_year))
- #msgprint(target)
- target = target and flt(flt(target[0][0])/12) or 0
-
-
- # for loop is required twice coz fiscal year starts from April (this will also work if fiscal year starts in January)
- for i in range(start_month-1,len(month_name)):
- query += 'SUM(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END),'
-
- for i in range(start_month-1):
- if i != (start_month-2):
- query += 'SUM(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END),'
- else:
- query += 'SUM(CASE WHEN MONTH(transaction_date) = '+cstr(i+1)+' THEN net_total ELSE NULL END)';
- so = sql("SELECT %s from `tab%s` where territory ='%s' and %s " %(query,based_on,r[col_idx['ID']],condition))
-
- i = 0
- length_l = 0
- for c in columns:
- if length_l == 0:
- r.append(target)
- length_l += 1
- else:
- so_total = so and flt(so[0][i]) or 0
- r.append(so_total)
- i +=1
- length_l = 0
\ No newline at end of file
diff --git a/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.txt b/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.txt
deleted file mode 100644
index 011b957..0000000
--- a/selling/search_criteria/territory_sales___variance_report/territory_sales___variance_report.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Territory\u0001State':'','Territory\u0001Based On':'Sales Order','Territory\u0001Fiscal Year':'2009-2010','Territory\u0001Company':'Alpha Company','Territory\u0001Period':'Quarterly'}",
- "doctype": "Search Criteria",
- "doc_type": "Territory",
- "name": "__common__",
- "sort_by": "ID",
- "page_len": 50,
- "criteria_name": "Territory Sales - Variance Report",
- "columns": "Territory\u0001ID"
- },
- {
- "name": "territory_sales_-_variance_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/total_target_variance_report/__init__.py b/selling/search_criteria/total_target_variance_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/total_target_variance_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/total_target_variance_report/total_target_variance_report.js b/selling/search_criteria/total_target_variance_report/total_target_variance_report.js
deleted file mode 100644
index 59a9b89..0000000
--- a/selling/search_criteria/total_target_variance_report/total_target_variance_report.js
+++ /dev/null
@@ -1,28 +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:'based_on', label:'Based On', fieldtype:'Select', options:'Territory'+NEWLINE+'Sales Person',report_default:'Territory',ignore : 1,parent:'Target Detail', single_select :1});
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Target Detail', single_select :1});
- this.add_filter({fieldname:'under', label:'Under',fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice',report_default:'Sales Order',ignore : 1, parent:'Target Detail', single_select :1});
- this.add_filter({fieldname : 'target_on', label:'Target On', fieldtype:'Select', options:'Quantity'+NEWLINE+'Amount',report_default:'Quantity',ignore : 1,parent:'Target Detail', single_select :1});
-}
-report.aftertableprint = function(t) {
- $yt(t,'*',1,{whiteSpace:'pre'});
-}
-this.mytabs.items['Select Columns'].hide();
\ No newline at end of file
diff --git a/selling/search_criteria/total_target_variance_report/total_target_variance_report.py b/selling/search_criteria/total_target_variance_report/total_target_variance_report.py
deleted file mode 100644
index 954f9f2..0000000
--- a/selling/search_criteria/total_target_variance_report/total_target_variance_report.py
+++ /dev/null
@@ -1,223 +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/>.
-
-# validate Filters
-from __future__ import unicode_literals
-flt_dict = {'fiscal_year': 'Fiscal Year', 'period': 'Period', 'under' : 'Under', 'based_on' : 'Based On','target_on':'Target On'}
-for f in flt_dict:
- if not filter_values.get(f):
- msgprint("Please Select " + cstr(flt_dict[f]))
- raise Exception
-
-# Get Values from fliters
-fiscal_year = filter_values.get('fiscal_year')
-period = filter_values.get('period')
-under = filter_values.get('under')
-if under == 'Sales Invoice': under = 'Sales Invoice'
-based_on = filter_values.get('based_on')
-target_on = filter_values.get('target_on')
-
-#add distributed id field
-col = []
-col.append([based_on,'Date','150px',''])
-if target_on == 'Quantity':
- col.append(['Target Quantity','Currency','150px',''])
-else:
- col.append(['Target Amount','Currency','150px',''])
-col.append(['Distribution Id','Date','150px',''])
-
-for c in col:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
-
- col_idx[c[0]] = len(colnames)-1
-
-def make_child_lst(based_on,name):
- rg = sql("select lft, rgt from `tab%s` where name = '%s'"%(based_on,name))
- ch_name = sql("select name from `tab%s` where lft between %d and %d"%(based_on,int(rg[0][0]),int(rg[0][1])))
- chl ='('
- flag = 1
- for c in ch_name:
- if flag == 1:
- chl += "'%s'"%c[0]
- flag = 2
- else:
- chl +=",'%s'"%c[0]
-
- chl +=")"
- return chl
-
-
-def get_target(target_on,based_on,fiscal_year,r):
-
- if target_on == 'Quantity':
- q1 = "select t1.target_qty "
- q2 = "select sum(t1.target_qty)"
- if target_on == 'Amount':
- q1 = "select t1.target_amount "
- q2 = "select sum(t1.target_amount)"
-
- cond1 =" t1.fiscal_year ='%s' and t1.parent=t2.name and t1.parenttype = '%s' and t1.docstatus !=2"
- #----------------------------------------------------------------
- q = "select t1.name from `tabTarget Detail` t1, `tab%s` t2 where "+cond1+" and t2.name = '%s'"
- ch = sql(q%(based_on,fiscal_year,based_on,r))
-
- return {'q1':q1,'q2':q2,'cond1':cond1,'ch':ch}
-
-for r in res:
-
- tt = get_target(target_on,based_on,fiscal_year,r[0].strip())
-
- if tt['ch']:
-
- cond2 = " ifnull(t1.item_group,'')='' and"
- qur = tt['q1']+"from `tabTarget Detail` t1, `tab%s` t2 where "+cond2+tt['cond1']+" and t2.name = '%s'"
- ret_amt = sql(qur%(based_on,fiscal_year,based_on,r[0].strip()))
-
- #----------------------------------------------------------------
- if not ret_amt:
- qur = tt['q2']+"from `tabTarget Detail` t1, `tab%s` t2 where "+tt['cond1']+" and t2.name = '%s'"
- ret_amt = sql(qur%(based_on,fiscal_year,based_on,r[0].strip()))
-
- #----------------------------------------------------------------
- else:
- node_lst = make_child_lst(based_on,r[0].strip())
- qur = tt['q2']+"from `tabTarget Detail` t1, `tab%s` t2 where "+tt['cond1']+" and t2.name in %s"
- ret_amt = sql(qur%(based_on,fiscal_year,based_on,node_lst))
-
- #----------------------------------------------------------------
- ret_dis_id = sql("select distribution_id from `tab%s` where name = '%s'"%(based_on,r[0].strip()))
-
- target_amt = ret_amt and flt(ret_amt[0][0]) or 0
- dis_id = ret_dis_id and ret_dis_id[0][0] or ''
-
- r.append(target_amt)
- r.append(dis_id)
-
-
-# Set required field names
-based_on_fn = (based_on == 'Territory') and 'territory' or 'sales_person'
-
-date_fn = (under == 'Sales Order' ) and 'transaction_date' or 'posting_date'
-
-mon_list = []
-
-data = {'start_date':0, 'end_date':1}
-
-def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
- count = 1
- if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
- for m in range(12):
- # get last date
- last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
-
- # make mon_list for Monthly Period
- if period == 'Monthly' :
- mon_list.append([start_date, last_date])
- # add months as Column names
- month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
- append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
-
- # get start date
- start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
-
- # make mon_list for Quaterly Period
- if period == 'Quarterly' and count % 3 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column names
- append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Half Yearly Period
- if period == 'Half Yearly' and count % 6 == 0 :
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
- if count != 12: mon_list.append([start_date])
-
- # make mon_list for Annual Period
- if period == 'Annual' and count % 12 == 0:
- mon_list[len(mon_list) - 1 ].append(last_date)
- # add Column Names
- append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
- count = count +1
-
-def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
- col = ['Target', 'Actual', 'Variance']
- for c in col:
- n = str(name) and ' (' + str(name) +')' or ''
- colnames.append(str(c) + n)
- coltypes.append('Currency')
- colwidths.append('150px')
- coloptions.append('')
- col_idx[str(c) + n ] = len(colnames) - 1
-
-
-
-# make default columns
-#coltypes[col_idx[based_on]] = 'Link'
-#coloptions[col_idx[based_on]]= based_on
-
-# get start date
-start_date = webnotes.conn.get_value('Fiscal Year', fiscal_year, 'year_start_date')
-if not start_date:
- msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
- raise Exception
-start_date = start_date.strftime('%Y-%m-%d')
-
-# make month list and columns
-make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
-
-
-bc_obj = get_obj('Budget Control')
-for r in res:
- count = 0
-
- for idx in range(3, len(colnames), 3):
- cidx = 2
-
- # ================= Calculate Target ==========================================
- r.append(bc_obj.get_monthly_budget( r[cidx], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[cidx-1]))
-
- #================== Actual Amount =============================================
- actual = 0
-
- ch = make_child_lst(based_on,r[0].strip())
-
- #----------------------------------------------------------
- if target_on == "Quantity":
- if based_on == "Territory":
- actual = sql("select sum(ifnull(t2.qty,0)) from `tab%s` t1, `tab%s Detail` t2 where t2.parenttype = '%s' and t2.parent = t1.name and t1.%s in %s and t1.docstatus = 1 and t1.%s between '%s' and '%s'" % (under, (under == 'Sales Invoice') and 'RV' or under, under, based_on_fn, ch, date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
- elif based_on == 'Sales Person':
- actual = sql("select sum(ifnull(t2.qty,0) * ifnull(t3.allocated_percentage,0) / 100) from `tab%s` t1, `tab%s Detail` t2, `tabSales Team` t3 where t2.parent = t1.name and t3.parent = t1.name and t3.%s in %s and t1.docstatus != 2 and t1.docstatus = 1 and t1.%s between '%s' and '%s' "%(under, (under == 'Sales Invoice') and 'RV' or under, based_on_fn, ch, date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
- #----------------------------------------------------------
- if target_on == "Amount":
- if based_on == 'Territory':
-
- actual = sql("select sum(ifnull(net_total,0)) from `tab%s` where %s in %s and docstatus = 1 and %s between '%s' and '%s' " % (under, based_on_fn, ch, date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
-
- elif based_on == 'Sales Person':
- actual = sql("select sum(ifnull(t2.allocated_amount,0)) from `tab%s` t1, `tabSales Team` t2 where t2.%s in %s and t2.parenttype='%s' and t1.docstatus != 2 and t2.parent = t1.name and t1.%s between '%s' and '%s'"%(under, based_on_fn, ch, under, date_fn, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
- #----------------------------------------------------------
- actual = flt(actual[0][0])
- r.append(actual)
- # ================ Variance ===================================================
- r.append(r[idx] - r[idx + 1])
- count = count +1
\ No newline at end of file
diff --git a/selling/search_criteria/total_target_variance_report/total_target_variance_report.sql b/selling/search_criteria/total_target_variance_report/total_target_variance_report.sql
deleted file mode 100644
index ebd7ae8..0000000
--- a/selling/search_criteria/total_target_variance_report/total_target_variance_report.sql
+++ /dev/null
@@ -1 +0,0 @@
-SELECT CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM `tab%(based_on)s` AS node,`tab%(based_on)s` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.docstatus !=2 GROUP BY node.name ORDER BY node.lft
\ No newline at end of file
diff --git a/selling/search_criteria/total_target_variance_report/total_target_variance_report.txt b/selling/search_criteria/total_target_variance_report/total_target_variance_report.txt
deleted file mode 100644
index cf1484b..0000000
--- a/selling/search_criteria/total_target_variance_report/total_target_variance_report.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "parent_doc_type": "Sales Person",
- "module": "Selling",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Sales Person\u0001Saved':1,'Sales Person\u0001Submitted':1,'Sales Person\u0001Country':'','Sales Person\u0001State':'','Target Detail\u0001Fiscal Year':''}",
- "doc_type": "Target Detail",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Person`.`name`",
- "page_len": 50,
- "criteria_name": "Total Target Variance Report",
- "columns": "Sales Person\u0001ID,Sales Person\u0001Owner,Sales Person\u0001Sales Person,Sales Person\u0001Country,Sales Person\u0001State,Sales Person\u0001lft,Sales Person\u0001rgt,Target Detail\u0001Item Group,Target Detail\u0001Fiscal Year,Target Detail\u0001Target Amount"
- },
- {
- "name": "total_target_variance_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/selling/search_criteria/variance_report/__init__.py b/selling/search_criteria/variance_report/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/variance_report/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/variance_report/variance_report.js b/selling/search_criteria/variance_report/variance_report.js
deleted file mode 100644
index b5fe3fb..0000000
--- a/selling/search_criteria/variance_report/variance_report.js
+++ /dev/null
@@ -1,28 +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:'based_on', label:'Based On', fieldtype:'Select', options:'Territory'+NEWLINE+'Sales Person'+NEWLINE+'Sales Partner',report_default:'Territory',ignore : 1,parent:'Target Detail'});
- this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company',report_default:sys_defaults.company, ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Target Detail'});
-// this.add_filter({fieldname:'item_group', label:'Item Group', fieldtype:'Link', options:'Item Group', ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'group_by', label:'Group By', fieldtype:'Select', options:NEWLINE+'Item Group',ignore : 1, parent:'Target Detail'});
- this.add_filter({fieldname:'under', label:'Under',fieldtype:'Select', options:'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice',report_default:'Sales Order',ignore : 1, parent:'Target Detail'});
-}
-
-//this.mytabs.items['Select Columns'].hide()
diff --git a/selling/search_criteria/variance_report/variance_report.py b/selling/search_criteria/variance_report/variance_report.py
deleted file mode 100644
index 7b6856c..0000000
--- a/selling/search_criteria/variance_report/variance_report.py
+++ /dev/null
@@ -1,520 +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/>.
-
-# Add columns
-# -----------
-from __future__ import unicode_literals
-row_list = [['ID','Data','150px','']]
-
-for r in row_list:
- colnames.append(r[0])
- coltypes.append(r[1])
- colwidths.append(r[2])
- coloptions.append(r[3])
- col_idx[r[0]] = len(colnames)-1
-
-if not filter_values.get('fiscal_year'):
- msgprint("Please Select Fiscal Year")
- raise Exception
-elif not filter_values.get('period'):
- msgprint("Please Select Period")
- raise Exception
-elif not filter_values.get('based_on'):
- msgprint("Please Select the Criteria on which you want your report to be based")
- raise Exception
-elif not filter_values.get('group_by') and filter_values.get('item_group'):
- msgprint("Item Group cannot be selected if Group By is not Item Group")
- raise Exception
-
-fiscal_year = filter_values.get('fiscal_year')
-period = filter_values.get('period')
-based_on = filter_values.get('based_on')
-group_by = filter_values.get('group_by')
-item_group = filter_values.get('item_group')
-msgprint(item_group)
-company = filter_values.get('company')
-under = filter_values.get('under')
-
-#if filter_values.get('item_group'):
-# itm_grp = filter_values.get('item_group')
-
-if based_on == 'Territory':
- based = 'territory'
-elif based_on == 'Sales Person':
- based = 'sales_person'
-elif based_on == 'Sales Partner':
- based = 'sales_partner'
-
-
-if under == 'Sales Invoice':
- under_detail = 'RV'
- dt = 'posting_date'
-else:
- under_detail = under
- dt = "transaction_date"
-
-# get fiscal year start date and start month
-year_start_date = sql("select year_start_date,MONTH(year_start_date) from `tabFiscal Year` where name = %s",fiscal_year)
-start_date = year_start_date and year_start_date[0][0] or ''
-start_month = year_start_date and year_start_date[0][1] or ''
-month_name = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
-
-# Add columns based on period
-# --------------------------------
-columns = []
-if group_by == 'Item Group':
- columns.append(['Item Group','Data','120px',''])
-# ================ Annual ======================
-if period == 'Annual':
- columns.append(['Target','Currency','120px',''])
- columns.append(['Actual','Currency','120px',''])
-
-# =========== Half Yearly ======================
-elif period == 'Half Yearly':
- columns.append(['Target (H1)','Currency','120px','']) # first half
- columns.append(['Actual (H1)','Currency','120px','']) # first half
- columns.append(['Target (H2)','Currency','120px',''])
- columns.append(['Actual (H2)','Currency','120px',''])
-
-# ================ Quarterly ===================
-elif period == 'Quarterly':
- length_1 = (len(month_name) - start_month + 1) / 3 #this gives the total no. of times we need to iterate for quarter
- val = length_1 % 4
- q_no = 1
- for i in range(length_1):
- value = 3*i + val
- columns.append(['Target (Q'+cstr(q_no)+')','Currency','120px',''])
- columns.append(['Actual (Q'+cstr(q_no)+')','Currency','120px',''])
- q_no += 1
- length_2 = (start_month - 1) / 3 #this gives the total no. of times we need to iterate for quarter (this is required only if fiscal year starts from april)
- for i in range(length_2):
- columns.append(['Target (Q'+cstr(q_no)+')','Currency','120px',''])
- columns.append(['Actual (Q'+cstr(q_no)+')','Currency','120px',''])
- q_no += 1;
-
-# =============== Monthly ======================
-elif period == 'Monthly':
- for i in range(start_month-1,len(month_name)):
- columns.append(['Target ('+month_name[i]+')','Currency','120px',''])
- columns.append(['Actual ('+month_name[i]+')','Currency','120px',''])
-
- for i in range(start_month-1):
- columns.append(['Target('+month_name[i]+')','Currency','120px',''])
- columns.append(['Actual ('+month_name[i]+')','Currency','120px',''])
-
-for c in columns:
- colnames.append(c[0])
- coltypes.append(c[1])
- colwidths.append(c[2])
- coloptions.append(c[3])
- col_idx[c[0]] = len(colnames)-1
-
-out = []
-if company:
- condition = ' fiscal_year = "'+fiscal_year+'" and company = "'+company+'"'
-else:
- condition = ' fiscal_year = "'+fiscal_year+'"'
-
-#=================== function for fetching allocated percentage in Distribution id according to period=============
-def get_budget_distribution(period,dist_id,fiscal_year):
- query = ''
- id1 = 1
- if period == 'Half Yearly':
- id2 = 6
- for i in range(2):
- query += 'SUM(CASE WHEN t2.idx BETWEEN '+str(id1)+' AND '+str(id2)+' THEN t2.percentage_allocation ELSE NULL END)'
- id1 += 6
- id2 += 6
- if i < 1 :
- query += ','
-
- elif period == 'Quarterly':
- id2 = 3
- for i in range(4):
- query += 'SUM(CASE WHEN t2.idx BETWEEN '+str(id1)+' AND '+str(id2)+' THEN t2.percentage_allocation ELSE NULL END)'
- id1 += 3
- id2 += 3
- if i < 3 :
- query += ','
-
- elif period == 'Monthly':
- for i in range(12):
- query += 'SUM(CASE WHEN t2.idx ='+str(id1)+' THEN t2.percentage_allocation ELSE NULL END)'
- id1 += 1
- if i < 11 :
- query += ','
-
-# msgprint(query)
-
- # Main Query
- dist = sql("select %s from `tabBudget Distribution` t1, `tabBudget Distribution Detail` t2 where t1.name = '%s' and t2.parent = t1.name and t1.fiscal_year = '%s'"%(query,dist_id,fiscal_year))
- dist = dist and dist[0] or 0
-# msgprint(dist)
- bug = []
- for i in dist:
- i = i and float(i) or 0
- bug.append(i)
-# msgprint(bug)
- return bug
-
-
-#============ function for appending target amt and actual amt in a proper order =======================
-def appending_func(ran,tl,lst,actual,flt):
-
- c = 2
- for i in range(ran):
- #==== for each itemgroup their actual amt is appended/inserted between target amt
- if tl == 0:
- lst.insert(c,actual and flt(actual[0][i]) or 0)
- #======== here actual amt is appended/inserted b/w target amt for a particular territory/sales person/sales partner only if target is not zero
- elif tl == 1:
-# msgprint(lst)
- lst.insert(c,actual and flt(actual[0][i]) or 0)
- c += 2
- return lst
-
-def get_target(tar_det,group_by,period,fiscal_year,rng,r,get_budget_distribution,flt):
-
- grp,lst = [],[]
- list_range,tl = 0,0
- if group_by == 'Item Group':
- for i in tar_det:
- if i[0] != '':
- igrp = [i[0]]
- if i[2]:
- dist_id = i[2]
- dist = get_budget_distribution(period,dist_id,fiscal_year)
- for d in dist:
- t = flt(flt(flt(i[1]) * flt(d))/ 100)
- igrp.append(t)
- else:
- t = i and flt(i[1]/rng) or 0
- for i in range(rng):
- igrp.append(t)
-
- grp.append(igrp)
- list_range +=1
- lst = [1,grp,list_range]
-
- #============== Total target(on basis of whole target ) ============
- else:
- for i in tar_det:
- if i[0] == '':
- if i[2]:
- dist_id = i[2]
- dist = get_budget_distribution(period,dist_id,fiscal_year)
- for d in dist:
- t = flt((flt(i[1]) * flt(d))/ 100)
- r.append(t)
- else:
- tot_target = i and flt(i[1]/rng) or 0
- for i in range(rng):
- r.append(tot_target)
- tl = 1
- lst = [0,r,tl]
- return lst
-#============ report display function =====================
-for r in res:
- query = ''
- grp=[]
- list_range, count, ap, tot_target, tl = 0,0,0,0,0
-
- #============= ANNUAL REPORT ===================
- if period == 'Annual':
- tar_det = sql("select item_group, target_amount, distribution_id from `tabTarget Detail` where parent = %s and parenttype = %s and fiscal_year = %s",(r[col_idx['ID']],based_on,fiscal_year))
-# msgprint(tar_det)
-
- #================ Target based on individual item group ==============
- if group_by == 'Item Group':
- for i in tar_det:
- if i[0] != '':
- grp_target = i and flt(i[1]) or 0
- igrp = [i[0],grp_target]
- grp.append(igrp)
-# msgprint(grp)
- list_range +=1
- count = 3
-
- #============== Total target(will be displayed only if target is specified by the user) ============
- else:
- for i in tar_det:
- # ======= here target is considered and not sum of target of item groups
- if i[0] == '':
- tot_target = tar_det and flt(i[1]) or 0
-# msgprint(tot_target)
-
- #================== Actual Amount =============================================
- if based_on == 'Territory' or based_on == 'Sales Partner':
-
- if group_by =='Item Group':
-
- for i in grp:
- item_group = i[0]
- actual = sql("select sum(t2.amount) from `tab%s` t1, `tab%s Detail` t2, `tabItem` t3 where t2.parent = t1.name and t1.%s = '%s' and t3.name = t2.item_code and t3.item_group = '%s' and t1.docstatus = 1 and t1.docstatus != 2 and %s"%(under,under_detail,based,r[col_idx['ID']],item_group,condition))
- msgprint(actual)
- actual = actual and flt(actual[0][0]) or 0
- i.append(actual)
-
- else:
- actual = sql("select sum(net_total) from `tab%s` where %s = '%s' and docstatus = 1 and %s" % (under, based, r[col_idx['ID']],condition))
- actual = actual and flt(actual[0][0]) or 0
-
- elif based_on == 'Sales Person':
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select sum(t2.amount) from `tab%s` t1, `tab%s Detail` t2, `tabSales Team` t3, `tabItem` t4 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t4.name = t2.item_code and t4.item_group = '%s' and t1.docstatus != 2 and t1.docstatus = 1 and %s"%(under,under_detail,based,r[col_idx['ID']],item_group,condition))
- actual = actual and flt(actual[0][0]) or 0
-# msgprint(actual)
- i.append(actual)
-
- else:
- actual = sql("select sum(t1.net_total) from `tab%s` t1, `tabSales Team` t2 where t2.%s = '%s' and t2.parenttype='%s' and t1.docstatus != 2 and t2.parent = t1.name and %s"%(under,based,r[col_idx['ID']],under,condition))
- actual = actual and flt(actual[0][0]) or 0
-# msgprint(actual)
-
- # ================= Half Yearly Report ===============
- elif period == 'Half Yearly':
- tl = 0
- grp_target = []
-
- tar_det = sql("select item_group, target_amount, distribution_id from `tabTarget Detail` where parent = %s and parenttype = %s and fiscal_year = %s",(r[col_idx['ID']],based_on,fiscal_year))
-# msgprint(tar_det)
-
- tar = get_target(tar_det,group_by,period,fiscal_year,2,r,get_budget_distribution,flt)
- if tar[0] == 1:
- grp = tar[1]
- list_range = tar[2]
- count = 5
- else:
- r = tar[1]
- tl = tar[2]
-
- #============= Actual Amount======================
- if group_by == 'Item Group':
- # first half
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN t2.amount ELSE NULL END),'
- # second half
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN t2.amount ELSE NULL END)';
-
- elif based_on != 'Sales Person':
- # first half
- query += 'SUM(CASE WHEN MONTH('+dt+') BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END),'
- # second half
- query += 'SUM(CASE WHEN MONTH('+dt+') NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN net_total ELSE NULL END)';
-
- else:
- # first half
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN t1.net_total ELSE NULL END),'
- # second half
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') NOT BETWEEN '+cstr(start_month)+' AND '+cstr(start_month+5)+' THEN t1.net_total ELSE NULL END)';
-
- #=========== Main Query ===============
- if based_on == 'Territory' or based_on == 'Sales Partner':
-
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select %s from `tab%s` t1, `tab%s Detail` t2, `tabItem` t3 where t2.parent = t1.name and t1.%s = '%s' and t3.name = t2.item_code and t3.item_group = '%s' and t1.docstatus = 1 and t1.docstatus != 2 and %s"%(query,under,under_detail,based,r[col_idx['ID']],item_group,condition))
-# msgprint(actual)
- i = appending_func(2,tl,i,actual,flt)
-
- else:
- actual = sql("select %s from `tab%s` where %s = '%s' and docstatus = 1 and %s" % (query,under, based, r[col_idx['ID']],condition))
-# msgprint(actual)
-
- elif based_on == 'Sales Person':
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select %s from `tab%s` t1, `tab%s Detail` t2, `tabSales Team` t3, `tabItem` t4 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t4.name = t2.item_code and t4.item_group = '%s' and t1.docstatus != 2 and t1.docstatus = 1 and %s"%(query,under,under_detail,based,r[col_idx['ID']],item_group,condition))
-# msgprint(actual)
- i = appending_func(2,tl,i,actual,flt)
- else:
- actual = sql("select %s from `tab%s` t1, `tabSales Team` t2 where t2.%s = '%s' and t2.parenttype='%s' and t1.docstatus != 2 and t2.parent = t1.name and %s"%(query,under,based,r[col_idx['ID']],under,condition))
-# msgprint(actual)
-
- if tl == 1:
- r = appending_func(2,tl,r,actual,flt)
-# msgprint(r)
-
- #============== Quarterly Report =========================
- elif period == 'Quarterly':
- tl = 0
- grp_target = []
- tar_det = sql("select item_group, target_amount, distribution_id from `tabTarget Detail` where parent = %s and parenttype = %s and fiscal_year = %s",(r[col_idx['ID']],based_on,fiscal_year))
-
- tar = get_target(tar_det,group_by,period,fiscal_year,4,r,get_budget_distribution,flt)
- if tar[0] == 1:
- grp = tar[1]
- list_range = tar[2]
- count = 9
- else:
- r = tar[1]
- tl = tar[2]
-
- #======= Actual Amt ==================
- length_1 = (len(month_name) - start_month + 1) / 3; #this gives the total no. of times we need to iterate for quarter
- val = length_1 % 4;
- for i in range(length_1):
- value = 3*i + val;
-
- if group_by == 'Item Group':
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN t2.amount ELSE NULL END),'
-
- elif based_on != 'Sales Person':
- query += 'SUM(CASE WHEN MONTH('+dt+') BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN net_total ELSE NULL END),'
-
- else:
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') BETWEEN '+cstr(value+1)+' AND '+cstr(value+3)+' THEN t1.net_total ELSE NULL END),'
-
- length_2 = (start_month - 1) / 3; #this gives the total no. of times we need to iterate for quarter (this is required only if fiscal year starts from april)
- for i in range(length_2):
- if group_by == 'Item Group':
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN t2.amount ELSE NULL END)';
-
- elif based_on != 'Sales Person':
- query += 'SUM(CASE WHEN MONTH('+dt+') BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN net_total ELSE NULL END)';
-
- else:
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') BETWEEN '+cstr(3*i+1)+' AND '+cstr(3*i+3)+' THEN t1.net_total ELSE NULL END)';
-
- #=========== Main Query ===============
- if based_on == 'Territory' or based_on == 'Sales Partner':
-
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select %s from `tab%s` t1, `tab%s Detail` t2, `tabItem` t3 where t2.parent = t1.name and t1.%s = '%s' and t3.name = t2.item_code and t3.item_group = '%s' and t1.docstatus = 1 and t1.docstatus != 2 and %s"%(query,under,under_detail,based,r[col_idx['ID']],item_group,condition))
-# msgprint(actual)
- #================common function
- i = appending_func(4,tl,i,actual,flt)
-
- else:
- actual = sql("select %s from `tab%s` where %s = '%s' and docstatus = 1 and %s" % (query,under, based, r[col_idx['ID']],condition))
-# msgprint(actual)
-
- elif based_on == 'Sales Person':
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select %s from `tab%s` t1, `tab%s Detail` t2, `tabSales Team` t3, `tabItem` t4 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t4.name = t2.item_code and t4.item_group = '%s' and t1.docstatus != 2 and t1.docstatus = 1 and %s"%(query,under,under_detail,based,r[col_idx['ID']],item_group,condition))
-# msgprint(actual)
- i = appending_func(4,tl,i,actual,flt)
- else:
- actual = sql("select %s from `tab%s` t1, `tabSales Team` t2 where t2.%s = '%s' and t2.parenttype='%s' and t1.docstatus != 2 and t2.parent = t1.name and %s"%(query,under,based,r[col_idx['ID']],under,condition))
-# msgprint(actual)
-
- if tl == 1:
- r = appending_func(4,tl,r,actual,flt)
-# msgprint(r)
-
- #================ Monthly Report ===========================
- elif period == 'Monthly':
- tl = 0
- grp_target = []
- tar_det = sql("select item_group, target_amount, distribution_id from `tabTarget Detail` where parent = %s and parenttype = %s and fiscal_year = %s",(r[col_idx['ID']],based_on,fiscal_year))
-
- tar = get_target(tar_det,group_by,period,fiscal_year,12,r,get_budget_distribution,flt)
- if tar[0] == 1:
- grp = tar[1]
- list_range = tar[2]
- count = 25
- else:
- r = tar[1]
- tl = tar[2]
-
- #======= Actual Amt ==================
- # for loop is required twice coz fiscal year starts from April (this will also work if fiscal year starts in January)
- for i in range(start_month-1,len(month_name)):
- if group_by == 'Item Group':
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') = '+cstr(i+1)+' THEN t2.amount ELSE NULL END),'
-
- elif based_on != 'Sales Person':
- query += 'SUM(CASE WHEN MONTH('+dt+') = '+cstr(i+1)+' THEN net_total ELSE NULL END),'
-
- else:
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') = '+cstr(i+1)+' THEN t1.net_total ELSE NULL END),'
-
- for i in range(start_month-1):
- if i != (start_month-1):
- if group_by == 'Item Group':
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') = '+cstr(i+1)+' THEN t2.amount ELSE NULL END)'
-
- elif based_on != 'Sales Person':
- query += 'SUM(CASE WHEN MONTH('+dt+') = '+cstr(i+1)+' THEN net_total ELSE NULL END)'
-
- else:
- query += 'SUM(CASE WHEN MONTH(t1.'+dt+') = '+cstr(i+1)+' THEN t1.net_total ELSE NULL END)'
-
- if i < (start_month -2):
- query += ','
-
- #=========== Main Query ===============
- if based_on == 'Territory' or based_on == 'Sales Partner':
-
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select %s from `tab%s` t1, `tab%s Detail` t2, `tabItem` t3 where t2.parent = t1.name and t1.%s = '%s' and t3.name = t2.item_code and t3.item_group = '%s' and t1.docstatus = 1 and t1.docstatus != 2 and %s"%(query,under,under_detail,based,r[col_idx['ID']],item_group,condition))
-# msgprint(actual)
- #===============common function=====================
- i = appending_func(12,tl,i,actual,flt)
-
- else:
- actual = sql("select %s from `tab%s` where %s = '%s' and docstatus = 1 and %s" % (query,under, based, r[col_idx['ID']],condition))
-# msgprint(actual)
-
- elif based_on == 'Sales Person':
- if group_by =='Item Group':
- for i in grp:
- item_group = i[0]
- actual = sql("select %s from `tab%s` t1, `tab%s Detail` t2, `tabSales Team` t3, `tabItem` t4 where t2.parent = t1.name and t3.parent = t1.name and t3.%s = '%s' and t4.name = t2.item_code and t4.item_group = '%s' and t1.docstatus != 2 and t1.docstatus = 1 and %s"%(query,under,under_detail,based,r[col_idx['ID']],item_group,condition))
-# msgprint(actual)
- i = appending_func(12,tl,i,actual,flt)
- else:
- actual = sql("select %s from `tab%s` t1, `tabSales Team` t2 where t2.%s = '%s' and t2.parenttype='%s' and t1.docstatus != 2 and t2.parent = t1.name and %s"%(query,under,based,r[col_idx['ID']],under,condition))
-# msgprint(actual)
-
- if tl == 1:
- r = appending_func(12,tl,r,actual,flt)
-# msgprint(r)
-
-#-------------DISPLAY OF TARGET vs ACTUAL ON BASIS OF TOTAL TARGET / ITEM GROUP
-
- if group_by == 'Item Group':
- for col in range(len(colnames)-1): # this would make all first row blank. just for look
- r.append('')
-
- for des in range(list_range):
- if ap == 0:
- out.append(r)
- ap = 1
- t_row = ['' for i in range(len(colnames))]
-
- for v in range(count):
- t_row[col_idx[colnames[v+1]]] = grp[des][v]
-# msgprint(t_row)
- out.append(t_row)
-
- elif tot_target != 0 and period =='Annual':
- r.append(tot_target)
- r.append(actual)
- out.append(r)
- tot_target = 0
-
- elif tl == 1:
- out.append(r)
diff --git a/selling/search_criteria/variance_report/variance_report.sql b/selling/search_criteria/variance_report/variance_report.sql
deleted file mode 100644
index 89becb7..0000000
--- a/selling/search_criteria/variance_report/variance_report.sql
+++ /dev/null
@@ -1 +0,0 @@
-SELECT DISTINCT t1.`name` FROM `tab%(based_on)s` t1, `tabTarget Detail` t2 WHERE t2.parent = t1.name and (t2.target_amount != 0 or t2.target_amount is not null)
\ No newline at end of file
diff --git a/selling/search_criteria/variance_report/variance_report.txt b/selling/search_criteria/variance_report/variance_report.txt
deleted file mode 100644
index e141191..0000000
--- a/selling/search_criteria/variance_report/variance_report.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "parent_doc_type": "Territory",
- "module": "Selling",
- "doctype": "Search Criteria",
- "sort_order": "DESC",
- "filters": "{'Territory\u0001State':'','Target Detail\u0001Fiscal Year':'2009-2010','Target Detail\u0001Based On':'Territory','Target Detail\u0001Company':'Alpha Company','Target Detail\u0001Period':'Quarterly','Target Detail\u0001Under':'Sales Order'}",
- "standard": "Yes",
- "doc_type": "Target Detail",
- "name": "__common__",
- "sort_by": "ID",
- "page_len": 50,
- "criteria_name": "Variance Report"
- },
- {
- "name": "variance_report",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/support/search_criteria/__init__.py b/support/search_criteria/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/amc_summary/__init__.py b/support/search_criteria/amc_summary/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/amc_summary/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/amc_summary/amc_summary.js b/support/search_criteria/amc_summary/amc_summary.js
deleted file mode 100644
index 0ce3619..0000000
--- a/support/search_criteria/amc_summary/amc_summary.js
+++ /dev/null
@@ -1,25 +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.mytabs.items['Select Columns'].hide();
- this.mytabs.items['More Filters'].hide()
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Territory'].df.filter_hide = 0;
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Item Group'].df.filter_hide = 0;
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Territory'].df.in_first_page = 1;
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Item Group'].df.in_first_page = 1;
-}
\ No newline at end of file
diff --git a/support/search_criteria/amc_summary/amc_summary.py b/support/search_criteria/amc_summary/amc_summary.py
deleted file mode 100644
index 926da01..0000000
--- a/support/search_criteria/amc_summary/amc_summary.py
+++ /dev/null
@@ -1,87 +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/>.
-
-# ADD NEW COLUMNS
-from __future__ import unicode_literals
-row_list = [['Item Group','Data','150px',''],
- ['Out of AMC','Int','150px',''],
- ['Under AMC','Int','150px',''],
- ['Out of Warranty','Int','150px',''],
- ['Under Warranty','Int','150px',''],
- ['Total','Int','150px','']
- ]
-
-for r in row_list:
- colnames.append(r[0])
- coltypes.append(r[1])
- colwidths.append(r[2])
- coloptions.append(r[3])
- col_idx[r[0]] = len(colnames)-1
-
-
-#ADD VALUES TO THE COLUMN
-out=[]
-oa,ua,ow,uw,sum=0,0,0,0,0
-nowdate = nowdate()
-for r in res:
- cc = r[col_idx['Territory']]
- item_groups = sql("select distinct item_group from `tabSerial No` where territory = '%s' and item_group like '%%%s'" %(cc,filter_values.get('item_group')))
-
- for col in range(len(colnames)-1): # this would make all first row blank. just for look
- r.append('')
- out.append(r)
-
- # Add Totals for each Territory
- # -----------------------------
- det = sql("select COUNT(CASE WHEN amc_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN amc_expiry_date <= '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date <= '%s' THEN name ELSE NULL END) from `tabSerial No` where territory = '%s' and item_group like '%%%s'" %(nowdate,nowdate,nowdate,nowdate,cc,filter_values.get('item_group')))
- r[col_idx['Item Group']] = ''
-
- r[col_idx['Out of AMC']] = cstr(det[0][0])
- r[col_idx['Under AMC']] = cstr(det[0][1])
- r[col_idx['Out of Warranty']] = cstr(det[0][2])
- r[col_idx['Under Warranty']] = cstr(det[0][3])
- tot = cint(det[0][0]) + cint(det[0][1]) + cint(det[0][2]) + cint(det[0][3])
- r[col_idx['Total']] = cstr(tot)
-
-
- oa += cint(det[0][0])
- ua += cint(det[0][1])
- ow += cint(det[0][2])
- uw += cint(det[0][3])
- sum += tot
-
-
- # Add Brand Details belonging to Territory
- # ----------------------------------------
- for br in item_groups:
- br_det = sql("select COUNT(CASE WHEN amc_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN amc_expiry_date <= '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date <= '%s' THEN name ELSE NULL END) from `tabSerial No` where territory = '%s' and item_group = '%s'"%(nowdate,nowdate,nowdate,nowdate,cc,br[0]))
- t_row = ['' for i in range(len(colnames))]
- t_row[col_idx['Item Group']] = br[0]
-
- t_row[col_idx['Out of AMC']] = cint(br_det[0][0])
- t_row[col_idx['Under AMC']] = cint(br_det[0][1])
- t_row[col_idx['Out of Warranty']] = cint(br_det[0][2])
- t_row[col_idx['Under Warranty']] = cint(br_det[0][3])
- tot = cint(br_det[0][0]) + cint(br_det[0][1]) + cint(br_det[0][2])+ cint(br_det[0][3])
- t_row[col_idx['Total']] = tot
- out.append(t_row)
-
-
-#ADD NEW ROW
-# ----------
-newrow=['','TOTAL',oa,ua,ow,uw,sum]
-out.append(newrow)
-res=out
\ No newline at end of file
diff --git a/support/search_criteria/amc_summary/amc_summary.txt b/support/search_criteria/amc_summary/amc_summary.txt
deleted file mode 100644
index a83e0d3..0000000
--- a/support/search_criteria/amc_summary/amc_summary.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:50",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:50"
- },
- {
- "module": "Support",
- "standard": "Yes",
- "sort_order": "ASC",
- "filters": "{'Serial No\u0001Saved':1,'Serial No\u0001Status':''}",
- "doc_type": "Serial No",
- "name": "__common__",
- "add_cond": "`tabSerial No`.`territory` is not null\n`tabSerial No`.`territory` != ''\n`tabSerial No`.`status` not in ('In Store', 'Scrapped')",
- "doctype": "Search Criteria",
- "sort_by": "`tabSerial No`.`cost_center`",
- "group_by": "`tabSerial No`.`cost_center`",
- "page_len": 50,
- "criteria_name": "AMC Summary",
- "columns": "Serial No\u0001Territory"
- },
- {
- "name": "amc_summary",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/support/search_criteria/customer_issues/__init__.py b/support/search_criteria/customer_issues/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/customer_issues/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/customer_issues/customer_issues.js b/support/search_criteria/customer_issues/customer_issues.js
deleted file mode 100644
index 8eaf6f6..0000000
--- a/support/search_criteria/customer_issues/customer_issues.js
+++ /dev/null
@@ -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['Customer Issue'+FILTER_SEP +'Status'].df.in_first_page = 1;
- this.filter_fields_dict['Customer Issue'+FILTER_SEP +'Allocated To'].df.in_first_page = 1;
- this.filter_fields_dict['Customer Issue'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-}
-
-this.mytabs.items['Select Columns'].hide()
\ No newline at end of file
diff --git a/support/search_criteria/customer_issues/customer_issues.txt b/support/search_criteria/customer_issues/customer_issues.txt
deleted file mode 100644
index caa0775..0000000
--- a/support/search_criteria/customer_issues/customer_issues.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "module": "Support",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Customer Issue\u0001Saved':1,'Customer Issue\u0001Submitted':1,'Customer Issue\u0001Status':'','Customer Issue\u0001Fiscal Year':''}",
- "doctype": "Search Criteria",
- "doc_type": "Customer Issue",
- "name": "__common__",
- "sort_by": "`tabCustomer Issue`.`name`",
- "page_len": 50,
- "criteria_name": "Customer Issues",
- "columns": "Customer Issue\u0001ID,Customer Issue\u0001Status,Customer Issue\u0001Complaint Date,Customer Issue\u0001Complaint,Customer Issue\u0001Item Code,Customer Issue\u0001Item Name,Customer Issue\u0001Allocated To,Customer Issue\u0001Allocated On,Customer Issue\u0001Resolved By,Customer Issue\u0001Resolution Date,Customer Issue\u0001Customer Name,Customer Issue\u0001Fiscal Year"
- },
- {
- "name": "customer_issues",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/__init__.py b/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/maintenance_orderwise_pending_amount_to_bill.js b/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/maintenance_orderwise_pending_amount_to_bill.js
deleted file mode 100644
index 1b3837a..0000000
--- a/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/maintenance_orderwise_pending_amount_to_bill.js
+++ /dev/null
@@ -1,20 +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['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;
-}
\ No newline at end of file
diff --git a/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/maintenance_orderwise_pending_amount_to_bill.txt b/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/maintenance_orderwise_pending_amount_to_bill.txt
deleted file mode 100644
index ad9fe08..0000000
--- a/support/search_criteria/maintenance_orderwise_pending_amount_to_bill/maintenance_orderwise_pending_amount_to_bill.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[
- {
- "owner": "ashwini@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "add_col": "SUM((`tabSales Order Item`.`qty` - `tabSales Order Item`.`billed_qty`) * `tabSales Order Item`.`basic_rate`) AS 'Pending Amount'",
- "parent_doc_type": "Sales Order",
- "module": "Support",
- "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 Item",
- "name": "__common__",
- "add_cond": "`tabSales Order`.status != 'Stopped'\n`tabSales Order`.order_type='Maintenance'",
- "doctype": "Search Criteria",
- "sort_by": "`tabSales Order`.`name`",
- "page_len": 50,
- "criteria_name": "Maintenance Orderwise Pending Amount To Bill",
- "columns": "Sales Order\u0001ID,Sales Order\u0001Customer,Sales Order\u0001Customer Name,Sales Order\u0001Customer Address,Sales Order\u0001Status,Sales Order\u0001% Billed,Sales Order\u0001Sales Order Date"
- },
- {
- "name": "maintenance_orderwise_pending_amount_to_bill",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/support/search_criteria/maintenance_schedule_details/__init__.py b/support/search_criteria/maintenance_schedule_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/maintenance_schedule_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/maintenance_schedule_details/maintenance_schedule_details.js b/support/search_criteria/maintenance_schedule_details/maintenance_schedule_details.js
deleted file mode 100644
index c4800ea..0000000
--- a/support/search_criteria/maintenance_schedule_details/maintenance_schedule_details.js
+++ /dev/null
@@ -1,29 +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['Maintenance Schedule Detail'+FILTER_SEP +'From Scheduled Date'].df.in_first_page = 1;
- this.filter_fields_dict['Maintenance Schedule Detail'+FILTER_SEP +'To Scheduled Date'].df.in_first_page = 1;
- this.filter_fields_dict['Maintenance Schedule Detail'+FILTER_SEP +'Incharge Name'].df.in_first_page = 1;
- this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Customer'].df.in_first_page = 1;
- this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Customer Name'].df.in_first_page = 1;
- this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Sales Order No'].df.in_first_page = 1;
- //this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Status'].df.in_first_page = 0;
- this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
-}
-
-this.mytabs.items['Select Columns'].hide()
\ No newline at end of file
diff --git a/support/search_criteria/maintenance_schedule_details/maintenance_schedule_details.txt b/support/search_criteria/maintenance_schedule_details/maintenance_schedule_details.txt
deleted file mode 100644
index f8a5882..0000000
--- a/support/search_criteria/maintenance_schedule_details/maintenance_schedule_details.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "owner": "nabin@webnotestech.com",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:51",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:51"
- },
- {
- "parent_doc_type": "Maintenance Schedule",
- "module": "Support",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Maintenance Schedule\u0001Submitted':1,'Maintenance Schedule\u0001Status':''}",
- "doc_type": "Maintenance Schedule Detail",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "`tabMaintenance Schedule Detail`.`item_code`",
- "page_len": 50,
- "criteria_name": "Maintenance Schedule Details",
- "columns": "Maintenance Schedule Detail\u0001Item Code,Maintenance Schedule Detail\u0001Item Name,Maintenance Schedule Detail\u0001Serial No,Maintenance Schedule Detail\u0001Incharge Name,Maintenance Schedule Detail\u0001Scheduled Date,Maintenance Schedule\u0001Customer Name,Maintenance Schedule\u0001Address,Maintenance Schedule\u0001Sales Order No"
- },
- {
- "name": "maintenance_schedule_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/support/search_criteria/warranty_amc_expiry_details/__init__.py b/support/search_criteria/warranty_amc_expiry_details/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/warranty_amc_expiry_details/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/warranty_amc_expiry_details/warranty_amc_expiry_details.js b/support/search_criteria/warranty_amc_expiry_details/warranty_amc_expiry_details.js
deleted file mode 100644
index ad5ce26..0000000
--- a/support/search_criteria/warranty_amc_expiry_details/warranty_amc_expiry_details.js
+++ /dev/null
@@ -1,25 +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/>.
-
-//this.mytabs.items['Select Columns'].hide();
-
-report.customize_filters = function() {
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Status'].df.in_first_page = 0;
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Customer'].df.in_first_page = 1;
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Customer Name'].df.in_first_page = 1;
- this.filter_fields_dict['Serial No'+FILTER_SEP +'Maintenance Status'].df.in_first_page = 1;
-
-}
\ No newline at end of file
diff --git a/support/search_criteria/warranty_amc_expiry_details/warranty_amc_expiry_details.txt b/support/search_criteria/warranty_amc_expiry_details/warranty_amc_expiry_details.txt
deleted file mode 100644
index bad5c9f..0000000
--- a/support/search_criteria/warranty_amc_expiry_details/warranty_amc_expiry_details.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "module": "Support",
- "standard": "Yes",
- "sort_order": "DESC",
- "filters": "{'Serial No\u0001Saved':1,'Serial No\u0001Status':'','Serial No\u0001Maintenance Status':''}",
- "doctype": "Search Criteria",
- "doc_type": "Serial No",
- "name": "__common__",
- "sort_by": "`tabSerial No`.`name`",
- "page_len": 50,
- "criteria_name": "Warranty/AMC Expiry Details",
- "columns": "Serial No\u0001ID,Serial No\u0001Item Code,Serial No\u0001Description,Serial No\u0001Status,Serial No\u0001Item Group,Serial No\u0001Purchase Receipt No,Serial No\u0001Delivery Note No,Serial No\u0001Customer,Serial No\u0001Customer Name,Serial No\u0001AMC Expiry Date,Serial No\u0001Warranty Expiry Date"
- },
- {
- "name": "warranty-amc_expiry_details",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file
diff --git a/support/search_criteria/warranty_amc_summary/__init__.py b/support/search_criteria/warranty_amc_summary/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/support/search_criteria/warranty_amc_summary/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.js b/support/search_criteria/warranty_amc_summary/warranty_amc_summary.js
deleted file mode 100644
index 4ad5a76..0000000
--- a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.js
+++ /dev/null
@@ -1,26 +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.mytabs.items['Select Columns'].hide();
- this.mytabs.items['More Filters'].hide();
- this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Territory'+NEWLINE+'Item Group',ignore:1,parent:'Serial No',in_first_page:1, report_default:'Item Group'});
-}
-
-report.aftertableprint = function(t) {
- $yt(t,'*',1,{whiteSpace:'pre'});
-}
\ No newline at end of file
diff --git a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.py b/support/search_criteria/warranty_amc_summary/warranty_amc_summary.py
deleted file mode 100644
index 8c102c3..0000000
--- a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.py
+++ /dev/null
@@ -1,54 +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
-opt = filter_values.get('based_on')
-opt_dict = {'Territory':'territory', 'Item Group':'item_group'}
-
-# ADD NEW COLUMNS
-row_list = [[opt,'Data','150px',''],
- ['Out of AMC','Int','150px',''],
- ['Under AMC','Int','150px',''],
- ['Out of Warranty','Int','150px',''],
- ['Under Warranty','Int','150px',''],
- ['Total','Int','150px','']]
-
-for r in row_list:
- colnames.append(r[0])
- coltypes.append(r[1])
- colwidths.append(r[2])
- coloptions.append(r[3])
- col_idx[r[0]] = len(colnames)-1
-
-
-#ADD VALUES TO THE COLUMN
-out=[]
-oa,ua,ow,uw,sum=0,0,0,0,0
-nowdate = nowdate()
-for r in res:
- lft_rgt = sql("select lft, rgt from `tab%s` where name = '%s'" % (opt,r[col_idx[opt]].strip()))
-
-
- det = sql("select COUNT(CASE WHEN t1.amc_expiry_date < '%s' THEN t1.name ELSE NULL END), COUNT(CASE WHEN t1.amc_expiry_date >= '%s' THEN t1.name ELSE NULL END), COUNT(CASE WHEN t1.warranty_expiry_date < '%s' THEN t1.name ELSE NULL END), COUNT(CASE WHEN t1.warranty_expiry_date >= '%s' THEN t1.name ELSE NULL END) from `tabSerial No` t1, `tab%s` t2 where t1.%s = t2.name and t2.lft>= '%s' and t2. rgt <= '%s' and t1.status = 'Delivered' and ifnull(item_group,'')!='' and ifnull(territory,'')!=''" %(nowdate,nowdate,nowdate,nowdate,opt, opt_dict[opt], lft_rgt[0][0], lft_rgt[0][1]))
-
- r.append(cint(det[0][0]))
- r.append(cint(det[0][1]))
- r.append(cint(det[0][2]))
- r.append(cint(det[0][3]))
- tot = cint(det[0][0]) + cint(det[0][1]) + cint(det[0][2]) + cint(det[0][3])
- r.append(tot)
- out.append(r)
diff --git a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.sql b/support/search_criteria/warranty_amc_summary/warranty_amc_summary.sql
deleted file mode 100644
index ebd7ae8..0000000
--- a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.sql
+++ /dev/null
@@ -1 +0,0 @@
-SELECT CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM `tab%(based_on)s` AS node,`tab%(based_on)s` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.docstatus !=2 GROUP BY node.name ORDER BY node.lft
\ No newline at end of file
diff --git a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.txt b/support/search_criteria/warranty_amc_summary/warranty_amc_summary.txt
deleted file mode 100644
index 098b5d6..0000000
--- a/support/search_criteria/warranty_amc_summary/warranty_amc_summary.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-03 12:49:53",
- "modified_by": "Administrator",
- "modified": "2012-04-03 12:49:53"
- },
- {
- "module": "Support",
- "sort_order": "DESC",
- "filters": "{'Serial No\u0001Saved':1,'Serial No\u0001Status':''}",
- "standard": "Yes",
- "doc_type": "Serial No",
- "name": "__common__",
- "doctype": "Search Criteria",
- "sort_by": "name",
- "page_len": 50,
- "criteria_name": "Warranty/AMC Summary"
- },
- {
- "name": "warranty-amc_summary",
- "doctype": "Search Criteria"
- }
-]
\ No newline at end of file