#NEWLINE# def track_item( ) : #NEWLINE# #INDENT# ' RESTful CRUD controller ' #NEWLINE# table = s3db . inv_track_item #NEWLINE# s3db . configure ( 'inv_track_item' , create = False , deletable = False , editable = False , insertable = False , listadd = False ) #NEWLINE# report = get_vars . get ( 'report' ) #NEWLINE# if ( table == 'rel' ) : #NEWLINE# #INDENT# s3 . crud_strings [ 'inv_track_item' ] = Storage ( title_list = T ( 'Summary of Releases' ) , subtitle_list = T ( 'Summary Details' ) ) #NEWLINE# s3db . configure ( 'inv_track_item' , list_fields = [ 'id' , ( T ( 'Date Released' ) , 'send_id$date' ) , ( T ( 'Beneficiary' ) , 'send_id$site_id' ) , ( settings . get_inv_send_shortname ( ) , 'send_id$send_ref' ) , ( settings . get_req_shortname ( ) , 'send_id$req_ref' ) , ( T ( 'Items/Description' ) , 'item_id' ) , ( T ( 'Source' ) , 'supply_org_id' ) , ( T ( 'Unit' ) , 'item_pack_id' ) , ( T ( 'Quantity' ) , 'quantity' ) , ( T ( 'Unit Cost' ) , 'pack_value' ) , ( T ( 'Total Cost' ) , 'total_value' ) ] , orderby = 'inv_send.site_id' , sort = True ) #NEWLINE# s3 . filter = ( FS ( 'send_id' ) != None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( report == 'inc' ) : #NEWLINE# #INDENT# s3 . crud_strings [ 'inv_track_item' ] = Storage ( title_list = T ( 'Summary of Incoming Supplies' ) , subtitle_list = T ( 'Summary Details' ) ) #NEWLINE# s3db . configure ( 'inv_track_item' , list_fields = [ 'id' , ( T ( 'Date Received' ) , 'recv_id$date' ) , ( T ( 'Received By' ) , 'recv_id$recipient_id' ) , ( settings . get_inv_send_shortname ( ) , 'recv_id$send_ref' ) , ( settings . get_inv_recv_shortname ( ) , 'recv_id$recv_ref' ) , ( settings . get_proc_shortname ( ) , 'recv_id$purchase_ref' ) , ( T ( 'Item/Description' ) , 'item_id' ) , ( T ( 'Unit' ) , 'item_pack_id' ) , ( T ( 'Quantity' ) , 'quantity' ) , ( T ( 'Unit Cost' ) , 'pack_value' ) , ( T ( 'Total Cost' ) , 'total_value' ) , ( T ( 'Source' ) , 'supply_org_id' ) , ( T ( 'Remarks' ) , 'comments' ) ] , orderby = 'inv_recv.recipient_id' ) #NEWLINE# s3 . filter = ( FS ( 'recv_id' ) != None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( report == 'util' ) : #NEWLINE# #INDENT# s3 . crud_strings [ 'inv_track_item' ] = Storage ( title_list = T ( 'Utilization Report' ) , subtitle_list = T ( 'Utilization Details' ) ) #NEWLINE# s3db . configure ( 'inv_track_item' , list_fields = [ 'id' , ( T ( 'Item/Description' ) , 'item_id$name' ) , ( T ( 'Beneficiary' ) , 'send_id$site_id' ) , ( settings . get_inv_send_shortname ( ) , 'send_id$send_ref' ) , ( settings . get_req_shortname ( ) , 'send_id$req_ref' ) , ( T ( 'Items/Description' ) , 'item_id' ) , ( T ( 'Source' ) , 'supply_org_id' ) , ( T ( 'Unit' ) , 'item_pack_id' ) , ( T ( 'Quantity' ) , 'quantity' ) , ( T ( 'Unit Cost' ) , 'pack_value' ) , ( T ( 'Total Cost' ) , 'total_value' ) ] ) #NEWLINE# s3 . filter = ( FS ( 'item_id' ) != None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( report == 'exp' ) : #NEWLINE# #INDENT# s3 . crud_strings [ 'inv_track_item' ] = Storage ( title_list = T ( 'Expiration Report' ) , subtitle_list = T ( 'Expiration Details' ) ) #NEWLINE# s3db . configure ( 'inv_track_item' , list_fields = [ 'id' , 'recv_inv_item_id$site_id' , ( T ( 'Item/Description' ) , 'item_id' ) , ( T ( 'Expiration Date' ) , 'expiry_date' ) , ( T ( 'Source' ) , 'supply_org_id' ) , ( T ( 'Unit' ) , 'item_pack_id' ) , ( T ( 'Quantity' ) , 'quantity' ) , ( T ( 'Unit Cost' ) , 'pack_value' ) , ( T ( 'Total Cost' ) , 'total_value' ) ] ) #NEWLINE# s3 . filter = ( FS ( 'expiry_date' ) != None ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# output = s3_rest_controller ( rheader = s3db . inv_rheader ) #NEWLINE# return output