GnuCash  5.6-150-g038405b370+
cap-gains.h
Go to the documentation of this file.
1 /********************************************************************\
2  * cap-gains.h -- Automatically Compute Capital Gains/Losses *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20 \********************************************************************/
21 
80 #ifndef XACC_CAP_GAINS_H
81 #define XACC_CAP_GAINS_H
82 
83 #include "gnc-engine.h"
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
100 gnc_numeric xaccSplitGetCapGains(Split *);
101 
111 gboolean xaccAccountHasTrades (const Account *);
112 
125  gnc_numeric sign,
126  gnc_commodity *currency);
127 GNCLot * xaccAccountFindLatestOpenLot (Account *acc,
128  gnc_numeric sign,
129  gnc_commodity *currency);
130 
136 Split * xaccSplitGetCapGainsSplit (const Split *);
137 
143 Split * xaccSplitGetGainsSourceSplit (const Split *);
144 
168 gboolean xaccSplitAssign (Split *split);
169 
188 Split * xaccSplitAssignToLot (Split *split, GNCLot *lot);
189 
209 void xaccSplitComputeCapGains(Split *split, Account *gain_acc);
210 void xaccLotComputeCapGains (GNCLot *lot, Account *gain_acc);
211 
212 #ifdef __cplusplus
213 }
214 #endif
215 
216 #endif /* XACC_CAP_GAINS_H */
217 
220 /* =========================== END OF FILE ======================= */
GNCLot * xaccAccountFindEarliestOpenLot(Account *acc, gnc_numeric sign, gnc_commodity *currency)
The xaccAccountFindEarliestOpenLot() method is a handy utility routine for finding the earliest open ...
Definition: cap-gains.cpp:188
STRUCTS.
void xaccSplitComputeCapGains(Split *split, Account *gain_acc)
The xaccSplitComputeCapGains() routine computes the cap gains or losses for the indicated split...
Definition: cap-gains.cpp:526
gboolean xaccAccountHasTrades(const Account *)
The xaccAccountHasTrades() method checks to see if the indicated account is used in the trading of co...
Definition: cap-gains.cpp:80
Split * xaccSplitGetGainsSourceSplit(const Split *)
The xaccSplitGetGainsSourceSplit() routine returns the split that is the source of the cap gains in t...
Definition: cap-gains.cpp:503
gnc_numeric xaccSplitGetCapGains(Split *)
The xaccSplitGetCapGains() method returns the value of capital gains (if any) associated with the ind...
Definition: cap-gains.cpp:900
Split * xaccSplitGetCapGainsSplit(const Split *)
The xaccSplitGetCapGainsSplit() routine returns the split that records the cap gains for this split...
Definition: cap-gains.cpp:480
All type declarations for the whole Gnucash engine.
Split * xaccSplitAssignToLot(Split *split, GNCLot *lot)
The xaccSplitAssignToLot() routine will fit the indicated split into the indicated lot...
Definition: cap-gains.cpp:219
gboolean xaccSplitAssign(Split *split)
The`xaccSplitAssign() routine will take the indicated split and, if it doesn't already belong to a lo...
Definition: cap-gains.cpp:426