brotherton-erpnext/erpnext/stock/dashboard/item_dashboard.py

14 lines
547 B
Python
Raw Normal View History

2016-04-21 13:30:34 +00:00
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_data(item_code=None, warehouse=None, start=0, sort_by='actual_qty', sort_order='desc'):
filters = {}
if item_code:
2016-04-22 11:52:22 +00:00
filters['item_code'] = item_code
2016-04-21 13:30:34 +00:00
if warehouse:
2016-04-22 11:52:22 +00:00
filters['warehouse'] = warehouse
2016-04-21 13:30:34 +00:00
return frappe.get_list("Bin", filters=filters, fields=['item_code', 'warehouse',
2016-04-25 12:23:42 +00:00
'projected_qty', 'reserved_qty', 'reserved_qty_for_production', 'actual_qty', 'valuation_rate'],
2016-04-21 13:30:34 +00:00
order_by='{0} {1}'.format(sort_by, sort_order), start=start, page_length = 21)