gnucash stable: [assistant-stock-transaction] in sell/cover-buy the cash may be zero.

Christopher Lam clam at code.gnucash.org
Wed Dec 11 18:07:41 EST 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/8b9865ee (commit)
	from  https://github.com/Gnucash/gnucash/commit/996ce3a0 (commit)



commit 8b9865ee888fb007e35e5660cd508f3a475b95f1
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Thu Dec 12 07:05:35 2024 +0800

    [assistant-stock-transaction] in sell/cover-buy the cash may be zero.
    
    this may occur if the broker fee equals the total sale from the sale
    of shares.

diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 17219ff5bc..00ce9dc965 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -188,7 +188,7 @@ static const TxnTypeVec long_types
     },
     {
         FieldMask::ENABLED_CREDIT | FieldMask::AMOUNT_CREDIT,         // stock_amt
-        FieldMask::ENABLED_DEBIT,          // cash_amt
+        FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO,          // cash_amt
         FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO,          // fees_amt
         FieldMask::DISABLED,               // dividend_amt
         FieldMask::ENABLED_CREDIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE | FieldMask::CAPGAINS_IN_STOCK, // capgains_amt
@@ -303,7 +303,7 @@ static const TxnTypeVec short_types
     },
     {
         FieldMask::ENABLED_DEBIT | FieldMask::AMOUNT_DEBIT,          // stock_amt
-        FieldMask::ENABLED_CREDIT,         // cash_amt
+        FieldMask::ENABLED_CREDIT | FieldMask::ALLOW_ZERO,         // cash_amt
         FieldMask::ENABLED_DEBIT | FieldMask::ALLOW_ZERO,          // fees_amt
         FieldMask::DISABLED,               // dividend_amt
         FieldMask::ENABLED_CREDIT | FieldMask::ALLOW_ZERO | FieldMask::ALLOW_NEGATIVE | FieldMask::CAPGAINS_IN_STOCK,          // capg_amt



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



More information about the gnucash-changes mailing list