# Path: exactonline/elements/base.py
# class ExactElement(object):
#     def __init__(self, api=None, **kwargs):
#         super(ExactElement, self).__init__(**kwargs)
# 
#         self._api = api
# 
#     def get_guid(self):
#         # Raises ObjectDoesNotExist if it cannot be found remotely.
#         raise NotImplementedError()
# 
#     def commit(self):
#         # This needs API specific work.
#         raise NotImplementedError()
# 
# Path: exactonline/exceptions.py
# class ExactOnlineError(Exception):
#     pass
# 
# class ObjectDoesNotExist(ExactOnlineError):
#     """
#     Exception named Django style.
#     """
#     pass
# 
# Path: exactonline/resource.py
# class DELETE(_Resource):
#     pass
# 
# class POST(_Resource):
#     pass


from datetime import timedelta
from .base import ExactElement
from ..exceptions import ExactOnlineError, ObjectDoesNotExist
from ..resource import DELETE, POST
            vatcode = '2  '  # FIXME: hardcoded.. fetch from API?
        else:
            raise NotImplementedError('Unknown VAT: %s' % (vat_percentage,))

        return vatcode

    def hint_exact_invoice_number(self):
        """
        Return invoice number you suggest ExactOnline will use for the
        invoice.

        This suggestion may be silently ignored if ExactOnline deems
        that the value is wrong. (E.g. because it's decrementing or
        duplicate.)
        """
        raise NotImplementedError()

    def assemble(self):
        invoice_number = self.get_invoice_number()
        customer = self.get_customer()

        total_amount_incl_vat = self.get_total_amount_incl_vat()
        total_vat = self.get_total_vat()
        created_date = self.get_created_date()
        description = u'%s - %s, %s' % (invoice_number, customer.get_name(),
                                        created_date.strftime('%m-%Y'))

        # Make sure the customer exists.
        try:
            customer_guid = customer.get_guid()

# Path: exactonline/elements/base.py
# class ExactElement(object):
#     def __init__(self, api=None, **kwargs):
#         super(ExactElement, self).__init__(**kwargs)
# 
#         self._api = api
# 
#     def get_guid(self):
#         # Raises ObjectDoesNotExist if it cannot be found remotely.
#         raise NotImplementedError()
# 
#     def commit(self):
#         # This needs API specific work.
#         raise NotImplementedError()
# 
# Path: exactonline/exceptions.py
# class ExactOnlineError(Exception):
#     pass
# 
# class ObjectDoesNotExist(ExactOnlineError):
#     """
#     Exception named Django style.
#     """
#     pass
# 
# Path: exactonline/resource.py
# class DELETE(_Resource):
#     pass
# 
# class POST(_Resource):
#     pass


# Path: exactonline/elements/invoice.py
from datetime import timedelta
from .base import ExactElement
from ..exceptions import ExactOnlineError, ObjectDoesNotExist
from ..resource import DELETE, POST

            vatcode = '2  '  # FIXME: hardcoded.. fetch from API?
        else:
            raise NotImplementedError('Unknown VAT: %s' % (vat_percentage,))

        return vatcode

    def hint_exact_invoice_number(self):
        """
        Return invoice number you suggest ExactOnline will use for the
        invoice.

        This suggestion may be silently ignored if ExactOnline deems
        that the value is wrong. (E.g. because it's decrementing or
        duplicate.)
        """
        raise NotImplementedError()

    def assemble(self):
        invoice_number = self.get_invoice_number()
        customer = self.get_customer()

        total_amount_incl_vat = self.get_total_amount_incl_vat()
        total_vat = self.get_total_vat()
        created_date = self.get_created_date()
        description = u'%s - %s, %s' % (invoice_number, customer.get_name(),
                                        created_date.strftime('%m-%Y'))

        # Make sure the customer exists.
        try:
            customer_guid = customer.get_guid()

        except ObjectDoesNotExist: