From 8b9865ee888fb007e35e5660cd508f3a475b95f1 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Thu, 12 Dec 2024 07:05:35 +0800 Subject: [PATCH] [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. --- gnucash/gnome/assistant-stock-transaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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