After setting up my tax tables I realized it would be best if I renamed one
of the tables I had already created and used, but there is no rename
function.  So, I created a new table using the name I wanted, and went
through each Vendor Bill that used the old table (there are only two) to
unpost, change the table used, and repost.

Then I went to delete the old (now unused) table, but I'm told by GnuCash
that it can't be deleted because it's in use.

After re-checking every bill, invoice, and voucher to be absolutely sure
the table is not in use, I decided to go check the data.  I see that the
taxtables are self-referential in a way that I didn't expect.

sqlite> .schema taxtables
CREATE TABLE taxtables (guid text(32) PRIMARY KEY NOT NULL, name text(50)
NOT NULL, refcount bigint NOT NULL, invisible integer NOT NULL, parent
text(32));
sqlite> select * from taxtables;
55313ec8ff87ef9980a3f4074ef6d563|Sales GST/HST|6|0|
d5be527bcf650c1bcf0b074dcdd6ebf0|Purchase GST/HST|1|0|
3a79f406381f325cad492f4840ea5c82|Sales
GST/HST|0|1|55313ec8ff87ef9980a3f4074ef6d563
a445251ce460d86faf71d7e61500e104|Purchase
GST/HST|0|1|d5be527bcf650c1bcf0b074dcdd6ebf0
6c23f3dcacf149dcfdc5b28f1d1030b1|Purchase GST/HST (ITC)|2|0|
89f9159bbc7e05aed2a93a5af6dd5c0e|Purchase GST/HST (Non-ITC)|0|0|
de880de6ccd478fb1f707f8b145f55d2|Purchase GST/HST
(ITC)|0|1|6c23f3dcacf149dcfdc5b28f1d1030b1

It's the "Purchase GST/HST" table I'd like to delete.  If I'm getting the
sense of the boolean correct, then there is a hidden version with a
refcount of 1, and an unhidden version with a refcount of 0 that references
the former entry.  If the unhidden one is what appears in the UI, then I'm
confused as to why its refcount of 0 prevents me from deleting it.

Any thoughts on how I can fix this up?  I don't want to just delete records
from this table as I'm not sure what else might be referencing it (I'm
still working on understanding the relations in the db).

In googling while troublehsooting I wasn't able to find anyone who had this
exact problem, but I did find some references on renaming tax tables by
going around the UI.  Seeing that it's safe to do so I could revert to an
older save file and directly rename the tax table.. but I'd still like to
understand what the problem is here.  If it's something I've missed... a
bug.. or what.
_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to