#NEWLINE# def is_expired( self ) : #NEWLINE# #INDENT# ' Check if an invoice is expired ' #NEWLINE# now = datetime . now ( ) . date ( ) #NEWLINE# extra = '' #NEWLINE# image = 'img/admin/icon_success.gif' #NEWLINE# days_left = ( image . exp_date - now ) . days #NEWLINE# if ( self . status == 1 ) : #NEWLINE# #INDENT# image = 'img/admin/icon_changelink.gif' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . status in ( 2 , 3 ) ) : #NEWLINE# #INDENT# if ( days_left <= 0 ) : #NEWLINE# #INDENT# image = 'img/admin/icon_error.gif' #NEWLINE# extra = _ ( ( ' <strong>(%s days late.)</strong>' % ( days_left * ( - 1 ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# image = 'img/admin/icon_clock.gif' #NEWLINE# extra = _ ( ( ' (%s days left.)' % days_left ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( '<img src="%(admin_media)s%(image)s" />%(extra)s' % { #NEWLINE# #INDENT# 'admin_media' : settings . ADMIN_MEDIA_PREFIX , #NEWLINE# 'image' : image , #NEWLINE# 'extra' : extra , #NEWLINE# #UNINDENT# } )