mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
[Reports][Sales and Purchase Trends][Completed]
This commit is contained in:
@@ -173,6 +173,11 @@ wn.module_page["Selling"] = [
|
||||
{
|
||||
"label":wn._("Quotation Trend"),
|
||||
route: "query-report/Quotation Trends",
|
||||
doctype: "Quotation"
|
||||
},
|
||||
{
|
||||
"label":wn._("Sales Order Trend"),
|
||||
route: "query-report/Sales Order Trends",
|
||||
doctype: "Sales Order"
|
||||
},
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import cint, add_days, add_months, cstr
|
||||
from controllers.trends import get_columns,get_data
|
||||
|
||||
def execute(filters=None):
|
||||
@@ -25,13 +24,11 @@ def execute(filters=None):
|
||||
|
||||
trans = "Quotation"
|
||||
tab = ["tabQuotation","tabQuotation Item"]
|
||||
ysd = webnotes.conn.sql("select year_start_date from `tabFiscal Year` where name = '%s'"%filters.get("fiscal_year"))[0][0]
|
||||
year_start_date = ysd.strftime('%Y-%m-%d')
|
||||
start_month = cint(year_start_date.split('-')[1])
|
||||
|
||||
columns, query_bon, query_pwc, basedon, grbc, sup_tab = get_columns(filters, year_start_date, start_month, trans)
|
||||
data = get_data(columns,filters, tab, query_bon, query_pwc, basedon, grbc ,sup_tab)
|
||||
|
||||
details = get_columns(filters, trans)
|
||||
data = get_data(filters, tab, details)
|
||||
|
||||
if data == '':
|
||||
webnotes.msgprint("Data Not Available")
|
||||
return columns, data
|
||||
|
||||
return details["columns"], data
|
||||
@@ -1,5 +1,5 @@
|
||||
wn.require("app/js/sales_trends_filters.js");
|
||||
|
||||
wn.query_reports["Sales Order"] = {
|
||||
wn.query_reports["Sales Order Trends"] = {
|
||||
filters: get_filters()
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import cint, add_days, add_months, cstr
|
||||
from controllers.trends import get_columns,get_data
|
||||
|
||||
def execute(filters=None):
|
||||
@@ -25,13 +24,11 @@ def execute(filters=None):
|
||||
|
||||
trans = "Sales Order"
|
||||
tab = ["tabSales Order","tabSales Order Item"]
|
||||
ysd = webnotes.conn.sql("select year_start_date from `tabFiscal Year` where name = '%s'"%filters.get("fiscal_year"))[0][0]
|
||||
year_start_date = ysd.strftime('%Y-%m-%d')
|
||||
start_month = cint(year_start_date.split('-')[1])
|
||||
|
||||
columns, query_bon, query_pwc, basedon, grbc, sup_tab = get_columns(filters, year_start_date, start_month, trans)
|
||||
data = get_data(columns,filters, tab, query_bon, query_pwc, basedon, grbc ,sup_tab)
|
||||
|
||||
|
||||
details = get_columns(filters, trans)
|
||||
data = get_data(filters, tab, details)
|
||||
|
||||
if data == '':
|
||||
webnotes.msgprint("Data Not Available")
|
||||
return columns, data
|
||||
|
||||
return details["columns"], data
|
||||
Reference in New Issue
Block a user