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',
|
|
|
|
'projected_qty', 'reserved_qty', 'reserved_qty_for_production', 'actual_qty'],
|
|
|
|
order_by='{0} {1}'.format(sort_by, sort_order), start=start, page_length = 21)
|