exactonline/elements/invoice.py
def get_ledger_code_to_guid_map(self, codes):
        """
        Convert set of human codes and to a dict of code to exactonline
        guid mappings.

        Example::

            ret = inv.get_ledger_code_to_guid_map(['1234', '5555'])
            ret == {'1234': '<guid1_from_exactonline_ledgeraccounts>',
                    '5555': '<guid2_from_exactonline_ledgeraccounts>'}
        """
        if codes:
            codes = set(str(i) for i in codes)
            ledger_ids = self._api.ledgeraccounts.filter(code__in=codes)
            ret = dict((str(i['Code']), i['ID']) for i in ledger_ids)
            found = set(ret.keys())
            missing = (codes - found)
            if missing:
                raise UnknownLedgerCodes(missing)
            return ret
        return {}
def get_ledger_code_to_guid_map(self, codes):
        """
        Convert set of human codes and to a dict of code to exactonline
        guid mappings.

        Example::

            ret = inv.get_ledger_code_to_guid_map(['1234', '5555'])
            ret == {'1234': '<guid1_from_exactonline_ledgeraccounts>',
                    '5555': '<guid2_from_exactonline_ledgeraccounts>'}
        """
        if codes:
            codes = set(str(i) for i in codes)
            ledger_ids = self._api.ledgeraccounts.filter(code__in=codes)
            ret = dict((str(i['Code']), i['ID']) for i in ledger_ids)
            found = set(ret.keys())
            missing = (codes - found)
            if missing:
                raise UnknownLedgerCodes(missing)
            return ret
        return {}
Convert set of human codes and to a dict of code to exactonline
        guid mappings.

        Example::

            ret = inv.get_ledger_code_to_guid_map(['1234', '5555'])
            ret == {'1234': '<guid1_from_exactonline_ledgeraccounts>',
                    '5555': '<guid2_from_exactonline_ledgeraccounts>'}