#NEWLINE# def changelist_view( self , request , extra_context = None ) : #NEWLINE# #INDENT# from django.contrib.admin.views.main import ChangeList #NEWLINE# cl = ChangeList ( request , self . model , list ( self . list_display ) , self . list_display_links , self . list_filter , self . date_hierarchy , self . search_fields , self . list_select_related , self . list_per_page , self . list_editable , self ) #NEWLINE# total_dict = dict ( ) #NEWLINE# outstanding_dict = dict ( ) #NEWLINE# for ( currency , description ) in br_settings . INVOICE_CURRENCY_CHOICES : #NEWLINE# #INDENT# subtotal = Decimal ( 0 ) #NEWLINE# total = Decimal ( 0 ) #NEWLINE# for invoice in cl . get_query_set ( ) . filter ( status = 4 , currency = currency ) : #NEWLINE# #INDENT# subtotal += invoice . subtotal #NEWLINE# total += invoice . total #NEWLINE# #UNINDENT# if ( total > 0 ) : #NEWLINE# #INDENT# subtotal = decimal_to_string ( subtotal , currency ) #NEWLINE# total = decimal_to_string ( total , currency ) #NEWLINE# total_dict [ description . lower ( ) ] = [ subtotal , total ] #NEWLINE# #UNINDENT# subtotal = Decimal ( 0 ) #NEWLINE# total = Decimal ( 0 ) #NEWLINE# for invoice in cl . get_query_set ( ) . filter ( status__in = [ 1 , 2 , 3 ] , currency = currency ) : #NEWLINE# #INDENT# subtotal += invoice . subtotal #NEWLINE# total += invoice . total #NEWLINE# #UNINDENT# if ( total > 0 ) : #NEWLINE# #INDENT# subtotal = decimal_to_string ( subtotal , currency ) #NEWLINE# total = decimal_to_string ( total , currency ) #NEWLINE# outstanding_dict [ description . lower ( ) ] = [ subtotal , total_dict ] #NEWLINE# #UNINDENT# #UNINDENT# extra_context = dict ( ) #NEWLINE# extra_context [ 'total_dict' ] = total_dict #NEWLINE# extra_context [ 'outstanding_dict' ] = outstanding_dict #NEWLINE# return super ( InvoiceAdmin , self ) . changelist_view ( request , extra_context = extra_context )