brookie/admin.py
def is_expired(self):
    """ Check if an invoice is expired """
    now = datetime.now().date()
    extra = ""
    image = 'admin/img/icon-yes.svg'
    days_left = (self.exp_date - now).days
    if self.status == 1:
        image = 'admin/img/icon-changelink.svg'
    elif self.status in (2, 3):
        if days_left <= 0:
            image = 'admin/img/icon-no.svg'
            extra = _(' <strong>(%s days late.)</strong>' % (days_left * -1))
        else:
            image = 'admin/img/icon-clock.svg'
            extra = _(" (%s days left.)" % days_left)
    return '<img src="%(admin_media)s%(image)s" />%(extra)s' % {
        'admin_media': settings.STATIC_URL, 'image': image,
        'extra': extra}
 Check if an invoice is expired 
Check if an invoice is expired
Check if an invoice is expired
def is_expired(self):
    now = datetime.now().date()
    extra = ""
    image = 'admin/img/icon-yes.svg'
    days_left = (self.exp_date - now).days
    if self.status == 1:
        image = 'admin/img/icon-changelink.svg'
    elif self.status in (2, 3):
        if days_left <= 0:
            image = 'admin/img/icon-no.svg'
            extra = _(' <strong>(%s days late.)</strong>' % (days_left * -1))
        else:
            image = 'admin/img/icon-clock.svg'
            extra = _(" (%s days left.)" % days_left)
    return '<img src="%(admin_media)s%(image)s" />%(extra)s' % {
        'admin_media': settings.STATIC_URL, 'image': image,
        'extra': extra}
def is_expired ( self ) : now = datetime . now ( ) . date ( ) extra = "" image = 'admin/img/icon-yes.svg' days_left = ( self . exp_date - now ) . days if self . status == 1 : image = 'admin/img/icon-changelink.svg' elif self . status in ( 2 , 3 ) : if days_left <= 0 : image = 'admin/img/icon-no.svg' extra = _ ( ' <strong>(%s days late.)</strong>' % ( days_left * - 1 ) ) else : image = 'admin/img/icon-clock.svg' extra = _ ( " (%s days left.)" % days_left ) return '<img src="%(admin_media)s%(image)s" />%(extra)s' % { 'admin_media' : settings . STATIC_URL , 'image' : image , 'extra' : extra }
Check if an invoice is expired
Check if an invoice is expired
""" Check if an invoice is expired """
self