# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from coin.billing.models import Invoice
from django.shortcuts import render, get_object_or_404

def get_invoice_from_id_or_number(id):
    try:
        return Invoice.objects.get(pk=id)
    except:
        return get_object_or_404(Invoice, number=id)
