mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Prevent assigning capital gains splits to lots.
They're generated by lots, and when xaccSplitComputeCapGains sees one it grabs the originating lot which naturally doesn't balance.
This commit is contained in:
parent
1134d64a35
commit
bad092a46d
@ -93,6 +93,7 @@ xaccAccountHasTrades (const Account *acc)
|
||||
{
|
||||
Split *s = node->data;
|
||||
Transaction *t = s->parent;
|
||||
if (s->gains == GAINS_STATUS_GAINS) continue;
|
||||
if (acc_comm != t->common_currency) return TRUE;
|
||||
}
|
||||
|
||||
@ -444,6 +445,8 @@ xaccSplitAssign (Split *split)
|
||||
* have lots, we are done.
|
||||
*/
|
||||
if (split->lot) return FALSE;
|
||||
g_assert (split->gains == GAINS_STATUS_UNKNOWN ||
|
||||
(split->gains & GAINS_STATUS_GAINS) == FALSE);
|
||||
acc = split->acc;
|
||||
if (!xaccAccountHasTrades (acc))
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user