Data Structures | |
struct | QofExpense |
Wraps QOF around Expense_t. More... | |
Defines | |
#define | PQOF_EXPENSES_DESC "Pilot-link QOF expenses" |
#define | PILOT_LINK_QOF_EXPENSES "pilot_expenses" |
#define | EXP_DATE "expense_date" |
#define | EXP_TYPE "type_of_expense" |
#define | EXP_PAYMENT "form_of_payment" |
#define | EXP_CURRENCY "currency_code" |
#define | EXP_AMOUNT "expense_amount" |
#define | EXP_ATTENDEES "expense_attendees" |
#define | EXP_NOTE "expense_note" |
#define | EXP_CATEGORY "category" |
#define | EXP_DISTANCE "distance_unit" |
#define | EXP_VENDOR "expense_vendor" |
#define | EXP_CITY "expense_city" |
#define | EXP_KVP "currency_lookup" |
#define | PQ_CURRENCY_MNEMONIC "expense/currency/mnemonic" |
#define | PQ_CURRENCY_SYMBOL "expense/currency/symbol" |
#define | PQ_CURRENCY_FRACTION "expense/currency/fraction" |
#define | PQ_EXPENSE_PREF Expense_Pref |
#define | EXPENSE_CREATOR "exps" |
Typedefs | |
typedef struct Expense | Expense_t |
Functions | |
void | populate_currencies (void) |
Populate the currency table with the known currencies. | |
PQCurrency * | pq_currency_lookup (QofInstance *inst, gint currency_code) |
static gboolean | currency_cb (gpointer key, gpointer value, gpointer data) |
gint32 | pq_set_currency (QofInstance *inst, gchar *mnemonic) |
Expense_t * | pq_expense_get_pilot (QofEntity *inst) |
static QofExpense * | expense_create (QofBook *book) |
static const gchar * | qof_exp_distanceAsString (enum ExpenseDistance distance) |
static const gchar * | qof_exp_paymentAsString (enum ExpensePayment payment) |
static const gchar * | qof_exp_typeAsString (enum ExpenseType type) |
static enum ExpensePayment | qof_exp_paymentFromString (const gchar *payment_string) |
static enum ExpenseType | qof_exp_typeFromString (const gchar *type_string) |
static QofTime * | exp_getTime (QofExpense *e) |
static const gchar * | exp_getType (QofExpense *e) |
static const gchar * | exp_getPayment (QofExpense *e) |
static gint | exp_getCurrency (QofExpense *e) |
static QofNumeric | exp_getAmount (QofExpense *e) |
static const gchar * | exp_getVendor (QofExpense *e) |
static const gchar * | exp_getCity (QofExpense *e) |
static const gchar * | exp_getAttendees (QofExpense *e) |
static const gchar * | exp_getNote (QofExpense *e) |
static const gchar * | exp_getDistance (QofExpense *e) |
static const gchar * | exp_getCategory (QofExpense *e) |
static void | exp_setTime (QofExpense *e, QofTime *h) |
static void | exp_setType (QofExpense *e, const gchar *type_string) |
static void | exp_setPayment (QofExpense *e, const gchar *payment_string) |
static void | exp_combine_currency_with_amount (QofExpense *e) |
static void | exp_setCurrency (QofExpense *e, gint code) |
static void | exp_setAmount (QofExpense *e, QofNumeric h) |
static void | exp_setVendor (QofExpense *e, gchar *h) |
static void | exp_setCity (QofExpense *e, gchar *h) |
static void | exp_setAttendees (QofExpense *e, gchar *h) |
static void | exp_setNote (QofExpense *e, gchar *h) |
static void | exp_setDistance (QofExpense *e, const gchar *distance_name) |
static void | exp_setCategory (QofExpense *e, gchar *n) |
static const gchar * | expensePrintable (gpointer instance) |
gboolean | PQExpensesRegister (void) |
Register this object with QOF. | |
Variables | |
static QofLogModule | log_module = PQ_MOD_PILOT |
static GHashTable * | PQCurrencyTable = NULL |
Currency Table data. | |
static QofObject | expenses_object_def |
Like DB, Expenses uses UTC time within QOF and sets localtime when calling pilot-link code.
#define EXPENSE_CREATOR "exps" |
Inherited from pilot-link because the exported form using makelong is not constant.
Definition at line 71 of file pilot-expenses.h.
#define PQ_CURRENCY_FRACTION "expense/currency/fraction" |
type: KVP_TYPE_GINT64
Definition at line 64 of file pilot-expenses.h.
#define PQ_CURRENCY_MNEMONIC "expense/currency/mnemonic" |
type: KVP_TYPE_STRING
Definition at line 60 of file pilot-expenses.h.
#define PQ_CURRENCY_SYMBOL "expense/currency/symbol" |
type: KVP_TYPE_STRING
Definition at line 62 of file pilot-expenses.h.
#define PQ_EXPENSE_PREF Expense_Pref |
Expense Preferences identifier.
Definition at line 67 of file pilot-expenses.h.
static void exp_setAmount | ( | QofExpense * | e, | |
QofNumeric | h | |||
) | [static] |
Definition at line 843 of file pilot-expenses.c.
References QofExpense::reset_amount, and QofExpense::temp_amount.
00844 { 00845 Expense_t *qe; 00846 00847 g_return_if_fail (e != NULL); 00848 qe = &e->wrap; 00849 e->temp_amount = qof_numeric_to_double (h); 00850 e->reset_amount = TRUE; 00851 /* if an amount can ever be set without a currency_code, 00852 this needs to be reviewed. */ 00855 if (e->currency) 00856 exp_combine_currency_with_amount (e); 00857 }
static void exp_setDistance | ( | QofExpense * | e, | |
const gchar * | distance_name | |||
) | [static] |
Definition at line 900 of file pilot-expenses.c.
void populate_currencies | ( | void | ) |
Populate the currency table with the known currencies.
Custom currencies are not included.
All mnemonics are from gnucash and use the ISO4217 namespace
custom currencies are the same and may end up with the same struct: gchar name[16], gchar symbol[4], gchar rate[8].
Ignore currencies[5] (the five available currencies from the main table above) but:
QofObject expenses_object_def [static] |
{ interface_version : QOF_OBJECT_VERSION, e_type : PILOT_LINK_QOF_EXPENSES, type_label : "Pilot-link QOF expenses" , create : (gpointer) expense_create, book_begin : NULL, book_end : NULL, is_dirty : qof_collection_is_dirty, mark_clean : qof_collection_mark_clean, foreach : qof_collection_foreach, printable : expensePrintable, version_cmp : (gint (*)(gpointer, gpointer)) qof_instance_version_cmp, }
Definition at line 934 of file pilot-expenses.c.
GHashTable* PQCurrencyTable = NULL [static] |
Currency Table data.
Table relating the currencies[5] to the actual currency names, mnemonics and symbols. In pilot-qof it is indexed by GINT_TO_POINTER(pq_code).
Definition at line 53 of file pilot-expenses.c.