qof-expenses.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *            qof-expenses.h
00003  *
00004  *  Thu Oct 21 08:18:44 2004-2005
00005  *  Copyright  2004,2005,2006  Neil Williams  <linux@codehelp.co.uk>
00006  ****************************************************************************/
00007 /*
00008  *  This program 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 2 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 Library 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, write to the Free Software
00020  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00036 #ifndef _QOF_EXPENSES_H
00037 #define _QOF_EXPENSES_H
00038 
00039 #include <glib.h>
00040 #include <qof.h>
00041 
00042 #define GPE_MOD_EXP "gpe-expenses-module"
00043 #define GPE_QOF_EXPENSES "gpe_expenses"
00044 #define QOF_EXPENSES_DESC "GPE QOF expenses"
00045 #define EXP_DATE      "expense_date"
00046 #define EXP_TYPE      "type_of_expense"
00047 #define EXP_PAYMENT   "form_of_payment"
00048 #define EXP_CURRENCY  "currency_code"
00049 #define EXP_AMOUNT    "expense_amount"
00050 #define EXP_VENDOR    "expense_vendor"
00051 #define EXP_CITY      "expense_city"
00052 #define EXP_ATTENDEES "expense_attendees"
00053 #define EXP_NOTE      "expense_note"
00054 #define EXP_CATEGORY  "category"
00055 #define EXP_DISTANCE  "distance_unit"
00056 #define EXP_KVP       "currency_lookup"
00057 
00059 #define PQ_CURRENCY_MNEMONIC "expense/currency/mnemonic"  
00060 
00061 #define PQ_CURRENCY_SYMBOL   "expense/currency/symbol"
00062 
00063 #define PQ_CURRENCY_FRACTION "expense/currency/fraction"
00064 
00065 typedef struct Expense Expense_t;
00066 
00073 typedef struct QofExp_s QofExp;
00074 
00075 typedef void (*GpeCurrencyCB) (gpointer key, gpointer value, gpointer user_data);
00076 
00077 void gpe_currency_foreach(GpeCurrencyCB cb, gpointer user_data);
00078 
00085 typedef struct 
00086 {
00088         gint            pq_code;
00090         gint            fraction;
00092         const gchar*    symbol;
00094         const gchar*    mnemonic;
00098         gboolean        non_utf8;
00099 }GpeCurrency;
00100 
00118 GpeCurrency *
00119 gpe_currency_lookup (QofInstance* inst, gint currency_code);
00120 
00127 GpeCurrency *
00128 gpe_currency_lookup_name (QofInstance* inst, gchar * mnemonic);
00129 
00130 #define DISTANCE_LIST(_) \
00131  _(Miles, = 0) \
00132  _(Kilometers,)
00133 
00134 #define PAYMENT_TYPE_LIST(_) \
00135  _(AmericanExpress, = 0) \
00136  _(Cash, = 1 ) \
00137  _(Cheque, ) \
00138  _(CreditCard, ) \
00139  _(MasterCard, ) \
00140  _(Prepaid, ) \
00141  _(VISA, ) \
00142  _(Unfiled, )
00143 
00144 #define EXPENSE_TYPE_LIST(_) \
00145  _(Airfare, = 0) \
00146  _(Breakfast, = 1) \
00147  _(Bus, = 2) \
00148  _(BusinessMeals, ) \
00149  _(CarRental, ) \
00150  _(Dinner, ) \
00151  _(Entertainment, ) \
00152  _(Fax, ) \
00153  _(Gas, ) \
00154  _(Gifts, ) \
00155  _(Hotel, ) \
00156  _(Incidentals, ) \
00157  _(Laundry, ) \
00158  _(Limo, ) \
00159  _(Lodging, ) \
00160  _(Lunch, ) \
00161  _(Mileage, ) \
00162  _(Other, ) \
00163  _(Parking, ) \
00164  _(Postage, ) \
00165  _(Snack, ) \
00166  _(Subway, ) \
00167  _(Supplies, ) \
00168  _(Taxi, ) \
00169  _(Telephone, ) \
00170  _(Tips, ) \
00171  _(Tolls, ) \
00172  _(Train, )
00173 
00174 DEFINE_ENUM(ExpenseDistance, DISTANCE_LIST)
00175 DEFINE_ENUM(ExpensePayment, PAYMENT_TYPE_LIST)
00176 DEFINE_ENUM(ExpenseType, EXPENSE_TYPE_LIST)
00177 
00178 AS_STRING_DEC  (ExpenseDistance, DISTANCE_LIST)
00179 FROM_STRING_DEC(ExpenseDistance, DISTANCE_LIST)
00180 AS_STRING_DEC  (ExpensePayment, PAYMENT_TYPE_LIST)
00181 FROM_STRING_DEC(ExpensePayment, PAYMENT_TYPE_LIST)
00182 AS_STRING_DEC  (ExpenseType, EXPENSE_TYPE_LIST)
00183 FROM_STRING_DEC(ExpenseType, EXPENSE_TYPE_LIST)
00184 
00187 gboolean ExpensesRegister (void);
00188 
00191 #endif                          /* _QOF_EXPENSES_H */

Generated on Mon Jun 4 11:24:16 2007 for gpe-expenses by  doxygen 1.5.2