[Reports] [Customers Not Buying Sinse Long Time] and [Itemwise Recommended Reorder level]
This commit is contained in:
parent
1efc8b3734
commit
5b1e899250
@ -166,8 +166,8 @@ wn.module_page["Selling"] = [
|
||||
route: "query-report/Item-wise Sales History",
|
||||
},
|
||||
{
|
||||
"label":wn._("No Sales Order from Customers (Since 2 months)"),
|
||||
route: "query-report/No Sales Order from Customers",
|
||||
"label":wn._("Customers Not Buying Since Long Time"),
|
||||
route: "query-report/Customers Not Buying Since Long Time",
|
||||
doctype: "Sales Order"
|
||||
},
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
wn.query_reports["Customers Not Buying Since Long Time"] = {
|
||||
"filters": [
|
||||
{
|
||||
"fieldname":"days_since_last_order",
|
||||
"label": "Days Since Last Order",
|
||||
"fieldtype": "Int",
|
||||
"default": 60
|
||||
}
|
||||
]
|
||||
}
|
@ -13,15 +13,24 @@
|
||||
#
|
||||
# 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 webnotes.utils import getdate, cint
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters ={}
|
||||
|
||||
days_since_last_order = filters.get("days_since_last_order")
|
||||
if not days_since_last_order or days_since_last_order <= 0:
|
||||
webnotes.msgprint("Please mention legal value in days since last order field",raise_exception=1)
|
||||
|
||||
columns = get_columns()
|
||||
customers = get_so_details()
|
||||
|
||||
data = []
|
||||
for cust in customers:
|
||||
if cust[8] >= 60: # days_since_last_order
|
||||
if cust[8] >= days_since_last_order:
|
||||
cust.insert(7,get_last_so_amt(cust[0]))
|
||||
data.append(cust)
|
||||
return columns, data
|
@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-06-06 19:15:50",
|
||||
"creation": "2013-06-07 12:27:07",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-06-06 19:15:51",
|
||||
"modified": "2013-06-07 12:27:07",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@ -11,11 +11,11 @@
|
||||
"is_standard": "Yes",
|
||||
"name": "__common__",
|
||||
"ref_doctype": "Sales Order",
|
||||
"report_name": "No Sales Order from Customers",
|
||||
"report_name": "Customers Not Buying Since Long Time ",
|
||||
"report_type": "Script Report"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"name": "No Sales Order from Customers"
|
||||
"name": "Customers Not Buying Since Long Time"
|
||||
}
|
||||
]
|
@ -206,8 +206,8 @@ wn.module_page["Stock"] = [
|
||||
route: "query-report/Requested Items To Be Transferred",
|
||||
},
|
||||
{
|
||||
"label":wn._("Item Reorder Level"),
|
||||
route: "query-report/Item Reorder Level",
|
||||
"label":wn._("Itemwise Recommended Reorder Level"),
|
||||
route: "query-report/Itemwise Recommended Reorder Level",
|
||||
doctype: "Item"
|
||||
},
|
||||
]
|
||||
|
@ -1,4 +1,4 @@
|
||||
wn.query_reports["Item Reorder Level"] = {
|
||||
wn.query_reports["Itemwise Recommended Reorder Level"] = {
|
||||
"filters": [
|
||||
{
|
||||
"fieldname":"from_date",
|
@ -61,7 +61,7 @@ def get_item_info():
|
||||
def get_consumed_items(condition):
|
||||
|
||||
cn_items = webnotes.conn.sql("""select se_item.item_code,
|
||||
sum(se_item.actual_qty) as 'consume_qty'
|
||||
sum(se_item.actual_qty) as 'consume_qty'
|
||||
from `tabStock Entry` se, `tabStock Entry Detail` se_item
|
||||
where se.name = se_item.parent and se.docstatus = 1
|
||||
and ifnull(se_item.t_warehouse, '') = '' %s
|
@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-06-05 15:34:51",
|
||||
"creation": "2013-06-07 12:47:22",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-06-05 15:50:30",
|
||||
"modified": "2013-06-07 13:03:54",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@ -11,11 +11,11 @@
|
||||
"is_standard": "Yes",
|
||||
"name": "__common__",
|
||||
"ref_doctype": "Item",
|
||||
"report_name": "Item Reorder Level",
|
||||
"report_name": "Itemwise Recommended Reorder Level",
|
||||
"report_type": "Script Report"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"name": "Item Reorder Level"
|
||||
"name": "Itemwise Recommended Reorder Level"
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user