commodity income/expense accounts?

Daniel Hagerty hag at linnaean.org
Mon Jan 12 13:47:54 EST 2015


    gnucash insists that only stock and mutual fund accounts are able
to use non-currency commodities as the account commodity.

    Is there any reason for this?  I've certainly received income in
commodity form.

    It seemed easy to change; the patch below seemed to work.

commit 6dd27dd50fac7269f9208622de0c0ba3893a6c74
Author: Daniel Hagerty <hag at linnaean.org>
Date:   Sun Dec 28 11:18:37 2014 -0500

    Allow all commodities for non-stock/mf accts

diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c
index 7e590d5..29c50c9 100644
--- a/src/gnome-utils/dialog-account.c
+++ b/src/gnome-utils/dialog-account.c
@@ -185,12 +185,10 @@ gnc_account_commodity_from_type (AccountWindow * aw, gboolean update)
 {
     dialog_commodity_mode new_mode;

-    if (aw->type == ACCT_TYPE_TRADING)
-        new_mode = DIAG_COMM_ALL;
-    else if ((aw->type == ACCT_TYPE_STOCK) || (aw->type == ACCT_TYPE_MUTUAL))
-        new_mode = DIAG_COMM_NON_CURRENCY;
+    if ((aw->type == ACCT_TYPE_STOCK) || (aw->type == ACCT_TYPE_MUTUAL))
+      new_mode = DIAG_COMM_NON_CURRENCY;
     else
-        new_mode = DIAG_COMM_CURRENCY;
+        new_mode = DIAG_COMM_ALL;

     if (update && (new_mode != aw->commodity_mode))
     {


More information about the gnucash-user mailing list