Example #1
0
def format_expense_status(expense, full=True):
    """
        Return a formatted status string for the expense
    """
    status_str = EXPENSE_STATUS.get(expense.status,
                                    DEF_STATUS).format(genre=u"e")
    if expense.status_user:
        account = format_account(expense.status_user)
    else:
        account = format_account(expense.user)
    date = format_date(expense.status_date)
    suffix = u" par {0} le {1}".format(account, date)

    if full:
        status_str += suffix

    return status_str
Example #2
0
def format_expense_status(expense, full=True):
    """
        Return a formatted status string for the expense
    """
    status_str = EXPENSE_STATUS.get(expense.status, DEF_STATUS)\
            .format(genre=u"e")
    if expense.status_user:
        account = format_account(expense.status_user)
    else:
        account = format_account(expense.user)
    date = format_date(expense.status_date)
    suffix = u" par {0} le {1}".format(account, date)

    if full:
        status_str += suffix

    return status_str
Example #3
0
def format_status(task, full=True):
    """
        return a formatted status string
    """
    status = task.CAEStatus

    if task.type_ == 'invoice':
        genre = u"e"
    else:
        genre = u""

    status_str = STATUS.get(status, DEF_STATUS).format(genre=genre)
    suffix = u" par {0} le {1}".format(
        format_account(task.statusPersonAccount), format_date(task.statusDate))
    if full:
        status_str += suffix

    return status_str
Example #4
0
def format_status(task, full=True):
    """
        return a formatted status string
    """
    status = task.CAEStatus

    if task.type_ == 'invoice':
        genre = u"e"
    else:
        genre = u""

    status_str = STATUS.get(status, DEF_STATUS).format(genre=genre)
    suffix = u" par {0} le {1}"\
            .format(format_account(task.statusPersonAccount),
                                        format_date(task.statusDate))
    if full:
        status_str += suffix

    return status_str