gnucash maint: [assistant-stock-transaction] input positive capgains for Credit income acct

Christopher Lam clam at code.gnucash.org
Sun Oct 16 11:42:00 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/d27de50c (commit)
	from  https://github.com/Gnucash/gnucash/commit/95a88140 (commit)



commit d27de50c3553e70f59841187537f83ae2dc99172
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Oct 8 14:37:00 2022 +0800

    [assistant-stock-transaction] input positive capgains for Credit income acct
    
    In a long position, a positive capital gain indicates the unit price
    has increased from Buy to Sell.
    
    In a short position, a positive capital gain indicates the unit price
    has decreased from Short Sell to Cover Buy.
    
    i.e. when inputting capital gains, the UI amount being positive
    indicates the income account has a credit value. i.e. the investor has
    enjoyed a 'profit' on their transaction.

diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index d05fb34b8..f83f8a5fe 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -292,7 +292,7 @@ static const TxnTypeVec short_types
         FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO,          // fees_amt
         false,                  // fees_capitalize
         FieldMask::DISABLED,               // dividend_amt
-        FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE,          // capg_amt
+        FieldMask::ENABLED_CREDIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE,          // capg_amt
         // Translators: this is a stock transaction describing cover
         // buying stock, and recording capital gain/loss
         N_("Buy to cover short"),



Summary of changes:
 gnucash/gnome/assistant-stock-transaction.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list