gpe-expenses  0.1.9
qof-expenses.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *            qof-expenses.h
00003  *
00004  *  Thu Oct 21 08:18:44 2004
00005  *  Copyright  2004,2005,2006,2009  Neil Williams  <linux@codehelp.co.uk>
00006  ****************************************************************************/
00007 /*
00008     This package is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 3 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00073 #ifndef _QOF_EXPENSES_H
00074 #define _QOF_EXPENSES_H
00075 
00076 #include <glib.h>
00077 #include <qof.h>
00078 
00080 #define GPE_MOD_EXP "gpe-expenses-module"
00081 #define GPE_QOF_EXPENSES "gpe_expenses"
00082 #define QOF_EXPENSES_DESC "GPE QOF expenses"
00083 #define EXP_DATE      "expense_date"
00084 #define EXP_TYPE      "type_of_expense"
00085 #define EXP_PAYMENT   "form_of_payment"
00086 #define EXP_CURRENCY  "currency_code"
00087 #define EXP_AMOUNT    "expense_amount"
00088 #define EXP_VENDOR    "expense_vendor"
00089 #define EXP_CITY      "expense_city"
00090 #define EXP_ATTENDEES "expense_attendees"
00091 #define EXP_NOTE      "expense_note"
00092 #define EXP_CATEGORY  "category"
00093 #define EXP_DISTANCE  "distance_unit"
00094 #define EXP_KVP       "currency_lookup"
00095 
00097 #define PQ_CURRENCY_MNEMONIC "expense/currency/mnemonic"  
00098 
00099 #define PQ_CURRENCY_SYMBOL   "expense/currency/symbol"
00100 
00101 #define PQ_CURRENCY_FRACTION "expense/currency/fraction"
00102 
00103 
00105 typedef struct QofExp_s QofExp;
00106 
00107 typedef void (*QofCurrencyCB) (gpointer key, gpointer value, gpointer user_data);
00108 
00109 void qof_currency_foreach(QofCurrencyCB cb, gpointer user_data);
00110 
00117 typedef struct 
00118 {
00120         gint            pq_code;
00122         gint            fraction;
00124         const gchar*    symbol;
00126         const gchar*    mnemonic;
00130         gboolean        non_utf8;
00131 }QofCurrency;
00132 
00150 QofCurrency *
00151 qof_currency_lookup (QofInstance* inst, gint currency_code);
00152 
00159 QofCurrency *
00160 qof_currency_lookup_name (QofInstance* inst, gchar * mnemonic);
00161 
00162 #define DISTANCE_LIST(_) \
00163  _(Miles, = 0) \
00164  _(Kilometers,)
00165 
00166 #define PAYMENT_TYPE_LIST(_) \
00167  _(AmericanExpress, = 0) \
00168  _(Cash, = 1 ) \
00169  _(Cheque, ) \
00170  _(CreditCard, ) \
00171  _(MasterCard, ) \
00172  _(Prepaid, ) \
00173  _(VISA, ) \
00174  _(Unfiled, )
00175 
00176 #define EXPENSE_TYPE_LIST(_) \
00177  _(Airfare, = 0) \
00178  _(Breakfast, = 1) \
00179  _(Bus, = 2) \
00180  _(BusinessMeals, ) \
00181  _(CarRental, ) \
00182  _(Dinner, ) \
00183  _(Entertainment, ) \
00184  _(Fax, ) \
00185  _(Gas, ) \
00186  _(Gifts, ) \
00187  _(Hotel, ) \
00188  _(Incidentals, ) \
00189  _(Laundry, ) \
00190  _(Limo, ) \
00191  _(Lodging, ) \
00192  _(Lunch, ) \
00193  _(Mileage, ) \
00194  _(Other, ) \
00195  _(Parking, ) \
00196  _(Postage, ) \
00197  _(Snack, ) \
00198  _(Subway, ) \
00199  _(Supplies, ) \
00200  _(Taxi, ) \
00201  _(Telephone, ) \
00202  _(Tips, ) \
00203  _(Tolls, ) \
00204  _(Train, )
00205 
00206 DEFINE_ENUM(ExpenseDistance, DISTANCE_LIST)
00239 DEFINE_ENUM(ExpensePayment, PAYMENT_TYPE_LIST)
00240 
00273 DEFINE_ENUM(ExpenseType, EXPENSE_TYPE_LIST)
00274 
00275 AS_STRING_DEC  (ExpenseDistance, DISTANCE_LIST)
00276 FROM_STRING_DEC(ExpenseDistance, DISTANCE_LIST)
00277 AS_STRING_DEC  (ExpensePayment, PAYMENT_TYPE_LIST)
00278 FROM_STRING_DEC(ExpensePayment, PAYMENT_TYPE_LIST)
00279 AS_STRING_DEC  (ExpenseType, EXPENSE_TYPE_LIST)
00280 FROM_STRING_DEC(ExpenseType, EXPENSE_TYPE_LIST)
00281 
00295 gboolean ExpensesRegister (void);
00296 
00299 #endif                          /* _QOF_EXPENSES_H */