gnc-lot.h

Go to the documentation of this file.
00001 /********************************************************************\
00002  * gnc-lot.h -- AR/AP invoices; inventory lots; stock lots          *
00003  *                                                                  *
00004  * This program is free software; you can redistribute it and/or    *
00005  * modify it under the terms of the GNU General Public License as   *
00006  * published by the Free Software Foundation; either version 2 of   *
00007  * the License, or (at your option) any later version.              *
00008  *                                                                  *
00009  * This program is distributed in the hope that it will be useful,  *
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00012  * GNU General Public License for more details.                     *
00013  *                                                                  *
00014  * You should have received a copy of the GNU General Public License*
00015  * along with this program; if not, contact:                        *
00016  *                                                                  *
00017  * Free Software Foundation           Voice:  +1-617-542-5942       *
00018  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00019  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00020 \********************************************************************/
00059 #ifndef GNC_LOT_H
00060 #define GNC_LOT_H
00061 
00062 typedef struct _GncLotClass GNCLotClass;
00063 
00064 #include "qof.h"
00065 #include "gnc-lot-p.h"
00066 
00067 /* --- type macros --- */
00068 #define GNC_TYPE_LOT            (gnc_lot_get_type ())
00069 #define GNC_LOT(o)              \
00070      (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_LOT, GNCLot))
00071 #define GNC_LOT_CLASS(k)        \
00072      (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_LOT, GNCLotClass))
00073 #define GNC_IS_LOT(o)           \
00074      (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_LOT))
00075 #define GNC_IS_LOT_CLASS(k)     \
00076      (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_LOT))
00077 #define GNC_LOT_GET_CLASS(o)    \
00078      (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_LOT, GNCLotClass))
00079 GType gnc_lot_get_type(void);
00080 
00081 
00082 GNCLot * gnc_lot_new (QofBook *);
00083 void gnc_lot_destroy (GNCLot *);
00084 
00085 GNCLot * gnc_lot_lookup (const GUID *guid, QofBook *book);
00086 QofBook * gnc_lot_get_book (GNCLot *);            
00087 
00088 void gnc_lot_begin_edit (GNCLot *lot);
00089 void gnc_lot_commit_edit (GNCLot *lot);
00090 
00098 void gnc_lot_add_split (GNCLot *, Split *);
00099 void gnc_lot_remove_split (GNCLot *, Split *);
00100 
00108 SplitList * gnc_lot_get_split_list (const GNCLot *);
00109 gint gnc_lot_count_splits (const GNCLot *);
00110 
00113 Account * gnc_lot_get_account (const GNCLot *);
00114 
00118 gnc_numeric gnc_lot_get_balance (GNCLot *);
00119 
00124 void gnc_lot_get_balance_before (const GNCLot *, const Split *,
00125                                  gnc_numeric *, gnc_numeric *);
00126 
00132 gboolean gnc_lot_is_closed (GNCLot *);
00133 
00139 Split * gnc_lot_get_earliest_split (GNCLot *lot);
00140 
00146 Split * gnc_lot_get_latest_split (GNCLot *lot);
00147 
00149 const char * gnc_lot_get_title (const GNCLot *);
00150 const char * gnc_lot_get_notes (const GNCLot *);
00151 void gnc_lot_set_title (GNCLot *, const char *);
00152 void gnc_lot_set_notes (GNCLot *, const char *);
00153 
00157 KvpFrame * gnc_lot_get_slots (const GNCLot *);
00158 
00160 GNCLot * gnc_lot_make_default (Account * acc);
00161 
00162 #define gnc_lot_get_guid(X)  qof_entity_get_guid(QOF_INSTANCE(X))
00163 
00164 #define LOT_IS_CLOSED   "is-closed?"
00165 #define LOT_BALANCE     "balance"
00166 #define LOT_TITLE               "lot-title"
00167 #define LOT_NOTES               "notes"
00168 #endif /* GNC_LOT_H */
00169 

Generated on Sun Oct 12 05:07:16 2008 for GnuCash by  doxygen 1.5.2