GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-lot.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-lot.h -- AR/AP invoices; inventory lots; stock lots *
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 [email protected] *
20 \********************************************************************/
59 #ifndef GNC_LOT_H
60 #define GNC_LOT_H
61 
62 //typedef struct _GncLotClass GNCLotClass;
63 
64 #include "qof.h"
65 #include "gnc-engine.h"
66 /*#include "gnc-lot-p.h"*/
67 
68 typedef struct
69 {
70  QofInstanceClass parent_class;
71 } GncLotClass;
72 #define GNCLotClass GncLotClass
73 
74 /* --- type macros --- */
75 #define GNC_TYPE_LOT (gnc_lot_get_type ())
76 #define GNC_LOT(o) \
77  (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_LOT, GNCLot))
78 #define GNC_LOT_CLASS(k) \
79  (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_LOT, GNCLotClass))
80 #define GNC_IS_LOT(o) \
81  (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_LOT))
82 #define GNC_IS_LOT_CLASS(k) \
83  (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_LOT))
84 #define GNC_LOT_GET_CLASS(o) \
85  (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_LOT, GNCLotClass))
86 GType gnc_lot_get_type(void);
87 
88 
89 /*@ dependent @*/
90 GNCLot * gnc_lot_new (QofBook *);
91 void gnc_lot_destroy (GNCLot *);
92 
93 /*@ dependent @*/
94 GNCLot * gnc_lot_lookup (const GncGUID *guid, QofBook *book);
95 QofBook * gnc_lot_get_book (GNCLot *);
96 
97 void gnc_lot_begin_edit (GNCLot *lot);
98 void gnc_lot_commit_edit (GNCLot *lot);
99 
107 void gnc_lot_add_split (GNCLot *, Split *);
108 void gnc_lot_remove_split (GNCLot *, Split *);
109 
118 gint gnc_lot_count_splits (const GNCLot *);
119 
122 /*@ dependent @*/
124 void gnc_lot_set_account(GNCLot*, Account*);
125 
130 
135 void gnc_lot_get_balance_before (const GNCLot *, const Split *,
136  gnc_numeric *, gnc_numeric *);
137 
143 gboolean gnc_lot_is_closed (GNCLot *);
144 
151 
158 
161 
163 const char * gnc_lot_get_title (const GNCLot *);
164 const char * gnc_lot_get_notes (const GNCLot *);
165 void gnc_lot_set_title (GNCLot *, const char *);
166 void gnc_lot_set_notes (GNCLot *, const char *);
167 
170 
171 #define gnc_lot_get_guid(X) qof_entity_get_guid(QOF_INSTANCE(X))
172 
173 #define LOT_IS_CLOSED "is-closed?"
174 #define LOT_BALANCE "balance"
175 #define LOT_TITLE "lot-title"
176 #define LOT_NOTES "notes"
177 #endif /* GNC_LOT_H */
178 
void gnc_lot_add_split(GNCLot *, Split *)
Definition: gnc-lot.c:569
void gnc_lot_set_closed_unknown(GNCLot *)
Definition: gnc-lot.c:406
Split * gnc_lot_get_earliest_split(GNCLot *lot)
Definition: gnc-lot.c:648
Definition: guid.h:65
const char * gnc_lot_get_title(const GNCLot *)
Definition: gnc-lot.c:437
Split * gnc_lot_get_latest_split(GNCLot *lot)
Definition: gnc-lot.c:660
GList SplitList
Definition: gnc-engine.h:203
SplitList * gnc_lot_get_split_list(const GNCLot *)
Definition: gnc-lot.c:417
void gnc_lot_get_balance_before(const GNCLot *, const Split *, gnc_numeric *, gnc_numeric *)
Definition: gnc-lot.c:519
All type declarations for the whole Gnucash engine.
GNCLot * gnc_lot_make_default(Account *acc)
Definition: gnc-lot.c:755
gboolean gnc_lot_is_closed(GNCLot *)
Definition: gnc-lot.c:376
Definition: SplitP.h:71
Account * gnc_lot_get_account(const GNCLot *)
Definition: gnc-lot.c:386
gnc_numeric gnc_lot_get_balance(GNCLot *)
Definition: gnc-lot.c:477