gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Mon Aug 29 01:59:57 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/70abdbd1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6d15e924 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/44915861 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d98b1767 (commit)



commit 70abdbd1aed80815978694127ffb3b885a216186
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Aug 29 13:48:57 2022 +0800

    [assistant-stock-transaction] send stock_amt | stock_val fieldmask
    
    because the stock_value may be FieldMask::DISABLED with a stock split
    in a short position. The | operator ensures FieldMask::ENABLED_CREDIT
    is used, which negates the stock amount.

diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index fc1928594..798757beb 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -1005,7 +1005,7 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data)
     auto date = gnc_date_edit_get_date (GNC_DATE_EDIT (info->date_edit));
     xaccTransSetDatePostedSecsNormalized (trans, date);
 
-    create_split (trans, info->txn_type->stock_value,
+    create_split (trans, info->txn_type->stock_amount | info->txn_type->stock_value,
                   NC_ ("Stock Assistant: Action field", "Stock"),
                   info->acct, account_commits, info->stock_memo_edit,
                   info->txn_type->stock_amount != FieldMask::DISABLED ? info->stock_amount_edit : nullptr,

commit 6d15e924dba01e74e73b107c00ef5a040d36d8f5
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Aug 29 13:35:13 2022 +0800

    [assistant-stock-transaction] rename capital gains to capital gain
    
    because in each stock transaction there's a singular capital gain or loss

diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 3875fb434..fc1928594 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -180,9 +180,9 @@ static const TxnTypeVec long_types
         FieldMask::DISABLED,               // dividend_amt
         FieldMask::ENABLED_CREDIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE, // capgains_amt
         // Translators: this is a stock transaction describing sale of
-        // stock, and recording capital gains/loss
+        // stock, and recording capital gain/loss
         N_("Sell"),
-        N_("Selling stock, and record capital gains/loss")
+        N_("Selling stock, and record capital gain/loss")
     },
     {
         FieldMask::DISABLED,               // stock_amt
@@ -314,7 +314,7 @@ static const TxnTypeVec short_types
         FieldMask::DISABLED,               // dividend_amt
         FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE,          // capg_amt
         // Translators: this is a stock transaction describing cover
-        // buying stock, and recording capital gains/loss
+        // buying stock, and recording capital gain/loss
         N_("Buy to cover short"),
         N_("Buy back stock to cover short and record capital gain/loss")
     },
@@ -1041,14 +1041,14 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data)
     if (info->txn_type->capgains_value != FieldMask::DISABLED)
     {
         create_split (trans, info->txn_type->capgains_value,
-                      NC_ ("Stock Assistant: Action field", "Capital Gains"),
+                      NC_ ("Stock Assistant: Action field", "Capital Gain"),
                       gas_account (info->capgains_account),
                       account_commits, info->capgains_memo_edit,
                       info->capgains_value, info->capgains_value, false);
 
         create_split (trans,
                       info->txn_type->capgains_value ^ (FieldMask::ENABLED_CREDIT | FieldMask::ENABLED_DEBIT),
-                      NC_ ("Stock Assistant: Action field", "Capital Gains"),
+                      NC_ ("Stock Assistant: Action field", "Capital Gain"),
                       info->acct, account_commits, info->capgains_memo_edit,
                       nullptr, info->capgains_value, false);
     }

commit 44915861c83c67979cf8d630f4f824dc1e40776b
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Aug 29 13:34:39 2022 +0800

    [assistant-stock-transaction] rename "Cover buy" to "Buy to cover short"
    
    more accurate

diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 5763143ba..3875fb434 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -315,8 +315,8 @@ static const TxnTypeVec short_types
         FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE,          // capg_amt
         // Translators: this is a stock transaction describing cover
         // buying stock, and recording capital gains/loss
-        N_("Cover buy"),
-        N_("Cover buying stock, and record capital gains/loss")
+        N_("Buy to cover short"),
+        N_("Buy back stock to cover short and record capital gain/loss")
     },
     {
         FieldMask::DISABLED,               // stock_amt



Summary of changes:
 gnucash/gnome/assistant-stock-transaction.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list