Patch by Mike E and Mark Jenkins:
When creating or appending to invoices, customers and bills, searching by ID is
likely more useful than by GUID. I've added this functionality to the Python
bindings.
Search by ID using the python code:
tmp = gnucash.gnucash_core_c.search_invoice_on_id(ID,book.instance)
if tmp:
invoice = gnucash.gnucash_business.Invoice(instance=tmp)
Use the invoice object as in sample_scripts/simple_invoice_insert.py
I support this patch, but I've made a few improvments of my own.
I switched up the arguments in search_customer_on_id, search_invoice_on_id,
search_bill_on_id to have Book first and ID second. The reason for this was to
make these functions more consistent with the other functions where a search is
done through a book on a particular attribute.
Also added some specific python bindings support to allow this to be used as
methods of Book: Book.CustomerLookupByID, Book.InvoiceLookupByID,
Book.BillLoookupByID.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19431 57a11ea4-9604-0410-9ed3-97b8803252fd