GnuCash  4.8a-80-g9825132ea+
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 
96 gnc_numeric xaccSplitGetCapGains(Split *);
97 
107 gboolean xaccAccountHasTrades (const Account *);
108 
121  gnc_numeric sign,
122  gnc_commodity *currency);
123 GNCLot * xaccAccountFindLatestOpenLot (Account *acc,
124  gnc_numeric sign,
125  gnc_commodity *currency);
126 
132 Split * xaccSplitGetCapGainsSplit (const Split *);
133 
139 Split * xaccSplitGetGainsSourceSplit (const Split *);
140 
164 gboolean xaccSplitAssign (Split *split);
165 
184 Split * xaccSplitAssignToLot (Split *split, GNCLot *lot);
185 
205 void xaccSplitComputeCapGains(Split *split, Account *gain_acc);
206 void xaccLotComputeCapGains (GNCLot *lot, Account *gain_acc);
207 
208 #endif /* XACC_CAP_GAINS_H */
209 
212 /* =========================== 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.c:190
void xaccSplitComputeCapGains(Split *split, Account *gain_acc)
The xaccSplitComputeCapGains() routine computes the cap gains or losses for the indicated split...
Definition: cap-gains.c:528
gboolean xaccAccountHasTrades(const Account *)
The xaccAccountHasTrades() method checks to see if the indicated account is used in the trading of co...
Definition: cap-gains.c:79
Split * xaccSplitGetGainsSourceSplit(const Split *)
The xaccSplitGetGainsSourceSplit() routine returns the split that is the source of the cap gains in t...
Definition: cap-gains.c:505
gnc_numeric xaccSplitGetCapGains(Split *)
The xaccSplitGetCapGains() method returns the value of capital gains (if any) associated with the ind...
Definition: cap-gains.c:902
Split * xaccSplitGetCapGainsSplit(const Split *)
The xaccSplitGetCapGainsSplit() routine returns the split that records the cap gains for this split...
Definition: cap-gains.c:482
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.c:221
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.c:428