Problem with duplicate invoice Id.
Hello.
I just had a problem where the invoice id of the customer invoice I wanted to print was already used by a vendor invoice. gcinvoice always generated a blank invoice with the address from the vendor.
Looking at the Gnucash XML file I did not see an obvious way to distinguish between customer and vendor invoices on first glance. So I tried to deactivate the vendor invoice in Gnucash, generate the customer invoice and activate the vendor invoice again.
Unfortunately this did not work. Gcinvoice used the data from the deactivated vendor invoice which is a bug in my opinion.
I added the following three lines to the loop over gnc:GncInvoice in gcivc.py (about line 336):
active = invc.findtext(ns('invoice:active'))
if active != "1":
invcdict['id'] = "%s-inactive" % invcdict['id']
This did the trick. (Just using "continue" produced a lot of errors on parsing the entries for the deactivated invoices, because the GUID was not present in self.invoices_.)
It would be great if this could be fixed in a future release.
Thanks for your work, Lars