brotherton-erpnext/erpnext/stock/page/stock_balance/stock_balance.py

14 lines
535 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:
filters = {'item_code': item_code }
if warehouse:
filters = {'warehouse': warehouse }
return frappe.get_list("Bin", filters=filters, fields=['item_code', 'warehouse',
'projected_qty', 'reserved_qty', 'reserved_qty_for_production', 'actual_qty'],
order_by='{0} {1}'.format(sort_by, sort_order), start=start, page_length = 21)