mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
Fixed conflict merge
This commit is contained in:
@@ -257,6 +257,16 @@ wn.module_page["Accounts"] = [
|
||||
route: "query-report/Budget Variance Report",
|
||||
doctype: "Cost Center"
|
||||
},
|
||||
{
|
||||
"label":wn._("Purchase Invoice Trends"),
|
||||
route: "query-report/Purchase Invoice Trends",
|
||||
doctype: "Purchase Invoice"
|
||||
},
|
||||
{
|
||||
"label":wn._("Sales Invoice Trends"),
|
||||
route: "query-report/Sales Invoice Trends",
|
||||
doctype: "Sales Invoice"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
0
accounts/report/purchase_invoice_trends/__init__.py
Normal file
0
accounts/report/purchase_invoice_trends/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
wn.require("app/js/purchase_trends_filters.js");
|
||||
|
||||
wn.query_reports["Purchase Invoice Trends"] = {
|
||||
filters: get_filters()
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
# 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
|
||||
import webnotes
|
||||
from controllers.trends import get_columns,get_data
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters ={}
|
||||
data = []
|
||||
|
||||
trans = "Purchase Invoice"
|
||||
tab = ["tabPurchase Invoice","tabPurchase Invoice Item"]
|
||||
|
||||
details = get_columns(filters, trans)
|
||||
data = get_data(filters, tab, details)
|
||||
|
||||
if not data :
|
||||
webnotes.msgprint("Data not found for selected criterias")
|
||||
|
||||
return details["columns"], data
|
||||
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-06-13 18:46:55",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-06-13 18:46:55",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"is_standard": "Yes",
|
||||
"name": "__common__",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Purchase Invoice Trends",
|
||||
"report_type": "Script Report"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"name": "Purchase Invoice Trends"
|
||||
}
|
||||
]
|
||||
@@ -107,6 +107,7 @@ def get_invoices(filters):
|
||||
from `tabPurchase Invoice` where docstatus = 1 %s
|
||||
order by posting_date desc, name desc""" % conditions, filters, as_dict=1)
|
||||
|
||||
|
||||
def get_invoice_expense_map(invoice_list):
|
||||
expense_details = webnotes.conn.sql("""select parent, expense_head, sum(amount) as amount
|
||||
from `tabPurchase Invoice Item` where parent in (%s) group by parent, expense_head""" %
|
||||
|
||||
0
accounts/report/sales_invoice_trends/__init__.py
Normal file
0
accounts/report/sales_invoice_trends/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
wn.require("app/js/sales_trends_filters.js");
|
||||
|
||||
wn.query_reports["Sales Invoice Trends"] = {
|
||||
filters: get_filters()
|
||||
}
|
||||
34
accounts/report/sales_invoice_trends/sales_invoice_trends.py
Normal file
34
accounts/report/sales_invoice_trends/sales_invoice_trends.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# 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
|
||||
import webnotes
|
||||
from controllers.trends import get_columns,get_data
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters ={}
|
||||
data = []
|
||||
|
||||
trans = "Sales Invoice"
|
||||
tab = ["tabSales Invoice","tabSales Invoice Item"]
|
||||
|
||||
details = get_columns(filters, trans)
|
||||
data = get_data(filters, tab, details)
|
||||
|
||||
if not data :
|
||||
webnotes.msgprint("Data not found for selected criterias")
|
||||
|
||||
return details["columns"], data
|
||||
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-06-13 18:44:21",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-06-13 18:44:21",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"is_standard": "Yes",
|
||||
"name": "__common__",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Sales Invoice Trends",
|
||||
"report_type": "Script Report"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"name": "Sales Invoice Trends"
|
||||
}
|
||||
]
|
||||
@@ -155,7 +155,7 @@ for r in res:
|
||||
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
|
||||
@@ -167,11 +167,11 @@ for r in res:
|
||||
|
||||
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)
|
||||
out.append(t_row)
|
||||
Reference in New Issue
Block a user