Example #1
0
def getCustomer(book, id):

    customer = book.CustomerLookupByID(id)

    if customer is None:
        return None
    else:
        return json.dumps(gnucash_simple.customerToDict(customer))
Example #2
0
def getCustomer(book, id):

	customer = book.CustomerLookupByID(id)

	if customer is None:
		return None
	else:
		return json.dumps(gnucash_simple.customerToDict(customer))
Example #3
0
def getCustomers(book):

	query = gnucash.Query()
	query.search_for('gncCustomer')
	query.set_book(book)
	customers = []

	for result in query.run():
		customers.append(gnucash_simple.customerToDict(gnucash.gnucash_business.Customer(instance=result)))

	query.destroy()

	return json.dumps(customers)
Example #4
0
def getCustomers(book):

    query = gnucash.Query()
    query.search_for('gncCustomer')
    query.set_book(book)
    customers = []

    for result in query.run():
        customers.append(
            gnucash_simple.customerToDict(
                gnucash.gnucash_business.Customer(instance=result)))

    query.destroy()

    return json.dumps(customers)