Missing Invoice

Geert Janssens janssens-geert at telenet.be
Thu Dec 5 06:22:23 EST 2013


On Wednesday 04 December 2013 04:19:56 Roman wrote:
> John Ralls <jralls <at> ceridwen.us> writes:
> 
> (Skipping initial portion of lengthy thread)
> 
> > That’s unlikely to explain how your invoice got deleted, if it did.
> > I
> 
> proposed some queries in my previous
> 
> > reply and I’m looking forward to hearing what you find out.
> > 
> > Regards,
> > John Ralls
> 
> On researching the situation I discovered essentially the same
> procedure you suggested and applied it to my data. I was able to
> recreate a similar Invoice directly within MySQL. Then on executing
> GnuCash, I was able to unpost that Invoice and note the offending
> transaction was removed as I hoped would happen. (Of course we need
> to be careful not to edit the MySQL database directly while GnuCash
> is running and also accessing the same data.)
> 
Glad you got that fixed.

> I have on final comment: Prior posts specifically state that Invoices
> should not and cannot be deleted. However, I believe we should parse
> this statement further. I agree that transactions created via an
> Invoice should not be deletable as long as the Invoice is posted.
> However, such a transaction is removed by unposting the Invoice. At
> that time (when it is not posted) one should be able to delete the
> Invoice or edit it to include changing the Invoice ID number and any
> other field for that form. After all, there is no longer any link
> between that Invoice and other database records. As it stands now,
> Invoices that have been created but not used for a variety of reasons
> remain in and clutter the database.
> 
We clearly agree that you should not be allowed to delete a posted invoice.

However the created transaction is not the reason GnuCash won't let you delete an invoice. 
There have been attempts in the past to add the option to delete an unposted invoice. 
Unfortunately they failed. Whenever an unposted invoice (with entries) was deleted, GnuCash 
crashed. This is a bug somewhere deep down in the object handling code. This bug is the 
reason you can't currently delete invoices, not even unposted ones.

I have come across this issue  when fixing a bug with duplicating invoices, which is in the same 
area in the code. I managed to work around this invoice removal bug for my "duplicate invoice" 
work (note I write "work around" not fix).But I haven't had time to implement invoice removal 
using this workaround before feature freeze. I will probably add this for GnuCash 2.8.

Meanwhile, you can perfectly "recycle" unposted invoices. You seem to suggest that's not 
allowed. It is. You can alter every detail of an unposted invoice, including the vendor/customer. 
So there's no need to pile up unposted invoices. Just use them instead of creating a new invoice 
the next time you want to add an invoice.

Geert


More information about the gnucash-user mailing list