|
GnuCash 2.4.99
|
00001 /* 00002 * qif-objects-p.h -- Private header: QIF objects for the QIF importer 00003 * 00004 * Written By: Derek Atkins <derek@ihtfp.com> 00005 * Copyright (c) 2003 Derek Atkins <warlord@MIT.EDU> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, contact: 00019 * 00020 * Free Software Foundation Voice: +1-617-542-5942 00021 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 00022 * Boston, MA 02110-1301, USA gnu@gnu.org 00023 */ 00024 00025 #ifndef QIF_OBJECTS_P_H 00026 #define QIF_OBJECTS_P_H 00027 00028 #include "qof.h" 00029 00030 #include "qif-import.h" 00031 #include "qif-objects.h" 00032 00033 struct _QifAccount 00034 { 00035 struct _QifObject obj; 00036 00037 char * name; 00038 char * desc; 00039 00040 char * limitstr; 00041 gnc_numeric limit; 00042 00043 char * budgetstr; 00044 gnc_numeric budget; 00045 00046 GList * type_list; 00047 00048 }; 00049 00050 struct _QifCategory 00051 { 00052 struct _QifObject obj; 00053 00054 char * name; 00055 char * desc; 00056 char * taxclass; 00057 00058 gboolean taxable; 00059 gboolean expense; 00060 gboolean income; 00061 00062 char * budgetstr; 00063 gnc_numeric budget; 00064 00065 }; 00066 00067 struct _QifClass 00068 { 00069 struct _QifObject obj; 00070 00071 char * name; 00072 char * desc; 00073 char * taxdesig; 00074 00075 }; 00076 00077 struct _QifSecurity 00078 { 00079 struct _QifObject obj; 00080 00081 char * name; 00082 char * symbol; 00083 char * type; 00084 00085 }; 00086 00087 struct _QifTxn 00088 { 00089 struct _QifObject obj; 00090 00091 QifType txn_type; 00092 00093 char * datestr; 00094 Timespec date; 00095 00096 char * payee; 00097 char * address; 00098 char * num; 00099 00100 QifRecnFlag cleared; 00101 00102 /* Investment info */ 00103 QifInvstTxn invst_info; 00104 00105 /* The default_split is the default (forward) part of the QIF transaction */ 00106 QifSplit default_split; 00107 00108 /* The current_split (if any) defines the current "qif split" we are handling */ 00109 QifSplit current_split; 00110 00111 /* The "from" account */ 00112 QifAccount from_acct; 00113 00114 /* The list of splits for this txn */ 00115 GList * splits; 00116 00117 }; 00118 00119 struct _QifSplit 00120 { 00121 char * memo; 00122 00123 char * amountstr; 00124 gnc_numeric amount; 00125 gnc_numeric value; 00126 00127 char * catstr; 00128 00129 /* parsed category/account info */ 00130 00131 union 00132 { 00133 QifObject obj; 00134 QifCategory cat; 00135 QifAccount acct; 00136 } cat; 00137 gboolean cat_is_acct; 00138 QifClass cat_class; 00139 00140 }; 00141 00142 struct _QifInvstTxn 00143 { 00144 QifAction action; 00145 00146 gnc_numeric amount; 00147 gnc_numeric d_amount; 00148 gnc_numeric price; 00149 gnc_numeric shares; 00150 gnc_numeric commission; 00151 00152 char * amountstr; 00153 char * d_amountstr; 00154 char * pricestr; 00155 char * sharesstr; 00156 char * commissionstr; 00157 00158 char * security; 00159 char * catstr; 00160 00161 union 00162 { 00163 QifObject obj; 00164 QifCategory cat; 00165 QifAccount acct; 00166 } far_cat; 00167 gboolean far_cat_is_acct; 00168 }; 00169 00170 /* to be run after parsing all the dates and amounts */ 00171 void qif_txn_setup_splits(QifTxn txn); 00172 void qif_invst_txn_setup_splits(QifContext ctx, QifTxn txn); 00173 00174 #endif /* QIF_OBJECTS_P_H */
1.7.4