|
GnuCash 2.4.99
|
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-engine.h" 00066 /*#include "gnc-lot-p.h"*/ 00067 00068 typedef struct 00069 { 00070 QofInstanceClass parent_class; 00071 } GncLotClass; 00072 #define GNCLotClass GncLotClass 00073 00074 /* --- type macros --- */ 00075 #define GNC_TYPE_LOT (gnc_lot_get_type ()) 00076 #define GNC_LOT(o) \ 00077 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_LOT, GNCLot)) 00078 #define GNC_LOT_CLASS(k) \ 00079 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_LOT, GNCLotClass)) 00080 #define GNC_IS_LOT(o) \ 00081 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_LOT)) 00082 #define GNC_IS_LOT_CLASS(k) \ 00083 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_LOT)) 00084 #define GNC_LOT_GET_CLASS(o) \ 00085 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_LOT, GNCLotClass)) 00086 GType gnc_lot_get_type(void); 00087 00088 00089 /*@ dependent @*/ 00090 GNCLot * gnc_lot_new (QofBook *); 00091 void gnc_lot_destroy (GNCLot *); 00092 00093 /*@ dependent @*/ 00094 GNCLot * gnc_lot_lookup (const GncGUID *guid, QofBook *book); 00095 QofBook * gnc_lot_get_book (GNCLot *); 00096 00097 void gnc_lot_begin_edit (GNCLot *lot); 00098 void gnc_lot_commit_edit (GNCLot *lot); 00099 00107 void gnc_lot_add_split (GNCLot *, Split *); 00108 void gnc_lot_remove_split (GNCLot *, Split *); 00109 00117 SplitList * gnc_lot_get_split_list (const GNCLot *); 00118 gint gnc_lot_count_splits (const GNCLot *); 00119 00122 /*@ dependent @*/ 00123 Account * gnc_lot_get_account (const GNCLot *); 00124 void gnc_lot_set_account(GNCLot*, Account*); 00125 00129 gnc_numeric gnc_lot_get_balance (GNCLot *); 00130 00135 void gnc_lot_get_balance_before (const GNCLot *, const Split *, 00136 gnc_numeric *, gnc_numeric *); 00137 00143 gboolean gnc_lot_is_closed (GNCLot *); 00144 00150 Split * gnc_lot_get_earliest_split (GNCLot *lot); 00151 00157 Split * gnc_lot_get_latest_split (GNCLot *lot); 00158 00160 void gnc_lot_set_closed_unknown(GNCLot*); 00161 00163 const char * gnc_lot_get_title (const GNCLot *); 00164 const char * gnc_lot_get_notes (const GNCLot *); 00165 void gnc_lot_set_title (GNCLot *, const char *); 00166 void gnc_lot_set_notes (GNCLot *, const char *); 00167 00171 KvpFrame * gnc_lot_get_slots (const GNCLot *); 00172 00174 GNCLot * gnc_lot_make_default (Account * acc); 00175 00176 #define gnc_lot_get_guid(X) qof_entity_get_guid(QOF_INSTANCE(X)) 00177 00178 #define LOT_IS_CLOSED "is-closed?" 00179 #define LOT_BALANCE "balance" 00180 #define LOT_TITLE "lot-title" 00181 #define LOT_NOTES "notes" 00182 #endif /* GNC_LOT_H */ 00183
1.7.4