def recv_item_json():
 try:
  item_id = request.args[0]
 except:
  raise HTTP(400, current.xml.json_message(False, 400, 'No value provided!'))
 stable = s3db.org_site
 rtable = s3db.inv_recv
 ittable = s3db.inv_track_item
 rtable.date.represent = (lambda dt: dt[:10])
 query = (((((ittable.req_item_id == item_id) & (rtable.id == ittable.recv_id)) & (rtable.site_id == stable.id)) & (rtable.status == s3db.inv_ship_status['RECEIVED'])) & (ittable.deleted == False))
 records = db(query).select(rtable.id, rtable.date, stable.name, ittable.quantity)
 output = ('[%s,%s' % (json.dumps(dict(id=str(T('Received')), quantity='#')), records.json()[1:]))
 response.headers['Content-Type'] = 'application/json'
 return output

def recv_item_json ( ) : try : item_id = request . args [ 0 ] except : raise HTTP ( 400 , current . xml . json_message ( False , 400 , 'No value provided!' ) ) stable = s3db . org_site rtable = s3db . inv_recv ittable = s3db . inv_track_item rtable . date . represent = ( lambda dt : dt [ : 10 ] ) query = ( ( ( ( ( ittable . req_item_id == item_id ) & ( rtable . id == ittable . recv_id ) ) & ( rtable . site_id == stable . id ) ) & ( rtable . status == s3db . inv_ship_status [ 'RECEIVED' ] ) ) & ( ittable . deleted == False ) ) records = db ( query ) . select ( rtable . id , rtable . date , stable . name , ittable . quantity ) output = ( '[%s,%s' % ( json . dumps ( dict ( id = str ( T ( 'Received' ) ) , quantity = '#' ) ) , records . json ( ) [ 1 : ] ) ) response . headers [ 'Content-Type' ] = 'application/json' return output
used by s3 .