def get_previous_sle(args, for_update=False):
 args[u'name'] = (args.get(u'sle', None) or u'')
 sle = get_stock_ledger_entries(args, u'<=', u'desc', u'limit 1', for_update=for_update)
 return ((sle and sle[0]) or {})

def get_previous_sle ( args , for_update = False ) : args [ u'name' ] = ( args . get ( u'sle' , None ) or u'' ) sle = get_stock_ledger_entries ( args , u'<=' , u'desc' , u'limit 1' , for_update = for_update ) return ( ( sle and sle [ 0 ] ) or { } )
get the last sle on or before the current time-bucket .