> added a new transaction.  it was for fuel.  it was added to our main
> checking account, with a "xfer from" category of "auto:fuel".  opened
> the "expenses:auto:fuel" register to feel warm and fuzzy.  felt warm
> and fuzzy.  deleted the transaction from the main checking register.
> It remained in the expenses register.  oops.


Well, this is not precisely a bug, but it's not exactly intuitive
either and should perhaps be changed. Here is what is going on.

GnuCash has transactions, splits, and accounts. A transaction has a
list of splits which go together and which balance to zero. Usually,
transactions have two splits. For example, if you buy gas and pay
with a check, you would create a transaction like so:

  Transaction
    Split 1: Subtract $20 from Checking
    Split 2: Add $20 to Expenses:Auto:Fuel

Accounts also have a list of splits. In the above case, Split 1 would
be added to the Checking account and Split 2 to the Fuel account.

So, a register window is really a list of splits, not a list of
transactions, in the gnucash terminology. When you record the blank
split at the bottom of the register, it's doing all of the above for
you.

Currently however, when you delete a 'transaction' in the register,
you are really deleting the split. Thus, if you delete Split 1 from
your Checking account, Split 2 remains in the Fuel account. The
transaction is now unbalanced, because it doesn't add up to 0.

When you delete the split, you should notice the 'transfer from'
field in the Fuel account will go blank, indicating there is no
matching split anymore.

You can find out if an account has any unbalanced transactions by
using the 'Scrub' function in the accounts menu with the account
selected (this hasn't made it to CVS for the gnome version). This will
create an Unbalance account with new splits which are required to
balance any related transactions. I plan on adding menu items to Scrub
sub-accounts and all accounts, too. The functionality is already in
the engine, I just have to add the calls.

Ok, so why not just delete the whole transaction when you delete a
split? Because transactions might have more than two splits:

  Transaction
    Split 1: Add X to Income::Salary (total income)
    Split 2: Add Y to Checking (net income)
    Split 3: Add Z to Expenses:State Taxes
    Split 4: Add W to Expenses:Fed Taxes
    etc.

where X = Y + Z + W + ...

You should be able to delete one of the splits without deleting the
whole transaction.

However, it should be easier to delete a whole transaction without
having to delete every split in it by hand. Here are a couple possibilities:

1. Have two kinds of delete commands in the register -- one to delete
   the split and one to delete the whole transaction and all its splits.

2. If you're in single or double mode, or you're on the 'transaction'
   line in multi-mode, the delete command deletes the whole transaction
   and all its splits. But if you're on a split line in multi-mode,
   delete just deletes the one split.

thoughts, anyone?

dave

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]

Reply via email to