Rushabh Mehta | 3966f1d | 2012-02-23 12:35:32 +0530 | [diff] [blame] | 1 | # ERPNext - web based ERP (http://erpnext.com) |
| 2 | # Copyright (C) 2012 Web Notes Technologies Pvt Ltd |
| 3 | # |
| 4 | # This program is free software: you can redistribute it and/or modify |
| 5 | # it under the terms of the GNU General Public License as published by |
| 6 | # the Free Software Foundation, either version 3 of the License, or |
| 7 | # (at your option) any later version. |
| 8 | # |
| 9 | # This program is distributed in the hope that it will be useful, |
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | # GNU General Public License for more details. |
| 13 | # |
| 14 | # You should have received a copy of the GNU General Public License |
| 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | |
Anand Doshi | 486f9df | 2012-07-19 13:40:31 +0530 | [diff] [blame] | 17 | from __future__ import unicode_literals |
Rushabh Mehta | d025133 | 2012-02-21 17:26:50 +0530 | [diff] [blame] | 18 | import webnotes |
| 19 | |
| 20 | @webnotes.whitelist() |
Rushabh Mehta | 16aea34 | 2012-05-29 10:53:37 +0530 | [diff] [blame] | 21 | def get_sc_list(arg=None): |
Rushabh Mehta | d025133 | 2012-02-21 17:26:50 +0530 | [diff] [blame] | 22 | """return list of reports for the given module module""" |
| 23 | webnotes.response['values'] = webnotes.conn.sql("""select |
| 24 | distinct criteria_name, doc_type, parent_doc_type |
| 25 | from `tabSearch Criteria` |
| 26 | where module='%(module)s' |
Rushabh Mehta | 12852e7 | 2012-02-29 15:11:06 +0530 | [diff] [blame] | 27 | and docstatus in (0, NULL) |
| 28 | and ifnull(disabled, 0) = 0 |
Rushabh Mehta | d025133 | 2012-02-21 17:26:50 +0530 | [diff] [blame] | 29 | order by criteria_name |
Rushabh Mehta | 16aea34 | 2012-05-29 10:53:37 +0530 | [diff] [blame] | 30 | limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True) |
| 31 | |
| 32 | @webnotes.whitelist() |
| 33 | def get_report_list(): |
| 34 | """return list on new style reports for modules""" |
| 35 | webnotes.response['values'] = webnotes.conn.sql("""select |
| 36 | distinct tabReport.name, tabReport.ref_doctype |
| 37 | from `tabReport`, `tabDocType` |
| 38 | where tabDocType.module='%(module)s' |
| 39 | and tabDocType.name = tabReport.ref_doctype |
| 40 | and tabReport.docstatus in (0, NULL) |
| 41 | order by tabReport.name |
Rushabh Mehta | d025133 | 2012-02-21 17:26:50 +0530 | [diff] [blame] | 42 | limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True) |