|
GnuCash 2.3.0
|
Data Structures | |
| struct | _gncAccountValue |
| struct | GncTaxTable |
| struct | GncTaxTableEntry |
Files | |
| file | gncTaxTable.h |
Tax Table programming interface. | |
Defines | |
| #define | GNC_ID_TAXTABLE "gncTaxTable" |
| #define | GNC_TYPE_TAXTABLE (gnc_taxtable_get_type ()) |
| #define | GNC_TAXTABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_TAXTABLE, GncTaxTable)) |
| #define | GNC_TAXTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_TAXTABLE, GncTaxTableClass)) |
| #define | GNC_IS_TAXTABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_TAXTABLE)) |
| #define | GNC_IS_TAXTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_TAXTABLE)) |
| #define | GNC_TAXTABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_TAXTABLE, GncTaxTableClass)) |
| #define | GNC_TT_NAME "tax table name" |
| #define | GNC_TT_REFCOUNT "reference count" |
| #define | gncTaxTableGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x)) |
| #define | gncTaxTableRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())) |
| #define | gncTaxTableLookupDirect(G, B) gncTaxTableLookup((B), &(G)) |
Typedefs | |
| typedef struct _gncTaxTable | GncTaxTable |
| typedef struct _gncTaxTableClass | GncTaxTableClass |
| typedef struct _gncTaxTableEntry | GncTaxTableEntry |
| typedef struct _gncAccountValue | GncAccountValue |
Enumerations | |
| enum | GncAmountType { GNC_AMT_TYPE_VALUE = 1, GNC_AMT_TYPE_PERCENT } |
| enum | GncTaxIncluded { GNC_TAXINCLUDED_YES = 1, GNC_TAXINCLUDED_NO, GNC_TAXINCLUDED_USEGLOBAL } |
Functions | |
| GType | gnc_taxtable_get_type (void) |
| const char * | gncAmountTypeToString (GncAmountType type) |
| gboolean | gncAmountStringToType (const char *str, GncAmountType *type) |
| const char * | gncTaxIncludedTypeToString (GncTaxIncluded type) |
| gboolean | gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type) |
| void | gncTaxTableAddEntry (GncTaxTable *table, GncTaxTableEntry *entry) |
| void | gncTaxTableRemoveEntry (GncTaxTable *table, GncTaxTableEntry *entry) |
| void | gncTaxTableChanged (GncTaxTable *table) |
| void | gncTaxTableBeginEdit (GncTaxTable *table) |
| void | gncTaxTableCommitEdit (GncTaxTable *table) |
| gboolean | gncTaxTableEqual (const GncTaxTable *a, const GncTaxTable *b) |
| int | gncTaxTableCompare (const GncTaxTable *a, const GncTaxTable *b) |
| int | gncTaxTableEntryCompare (const GncTaxTableEntry *a, const GncTaxTableEntry *b) |
| gboolean | gncTaxTableEntryEqual (const GncTaxTableEntry *a, const GncTaxTableEntry *b) |
| GList * | gncAccountValueAdd (GList *list, Account *acc, gnc_numeric value) |
| GList * | gncAccountValueAddList (GList *l1, GList *l2) |
| gnc_numeric | gncAccountValueTotal (GList *list) |
| void | gncAccountValueDestroy (GList *list) |
Create/Destroy Functions | |
| GncTaxTable * | gncTaxTableCreate (QofBook *book) |
| void | gncTaxTableDestroy (GncTaxTable *table) |
| GncTaxTableEntry * | gncTaxTableEntryCreate (void) |
| void | gncTaxTableEntryDestroy (GncTaxTableEntry *entry) |
Set Functions | |
| void | gncTaxTableSetName (GncTaxTable *table, const char *name) |
| void | gncTaxTableIncRef (GncTaxTable *table) |
| void | gncTaxTableDecRef (GncTaxTable *table) |
| void | gncTaxTableEntrySetAccount (GncTaxTableEntry *entry, Account *account) |
| void | gncTaxTableEntrySetType (GncTaxTableEntry *entry, GncAmountType type) |
| void | gncTaxTableEntrySetAmount (GncTaxTableEntry *entry, gnc_numeric amount) |
Get Functions | |
| typedef GList | GncTaxTableEntryList |
| GncTaxTable * | gncTaxTableLookupByName (QofBook *book, const char *name) |
| GList * | gncTaxTableGetTables (QofBook *book) |
| const char * | gncTaxTableGetName (const GncTaxTable *table) |
| GncTaxTable * | gncTaxTableGetParent (const GncTaxTable *table) |
| GncTaxTable * | gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new) |
| GncTaxTableEntryList * | gncTaxTableGetEntries (const GncTaxTable *table) |
| gint64 | gncTaxTableGetRefcount (const GncTaxTable *table) |
| Timespec | gncTaxTableLastModified (const GncTaxTable *table) |
| Account * | gncTaxTableEntryGetAccount (const GncTaxTableEntry *entry) |
| GncAmountType | gncTaxTableEntryGetType (const GncTaxTableEntry *entry) |
| gnc_numeric | gncTaxTableEntryGetAmount (const GncTaxTableEntry *entry) |
| #define | gncTaxTableGetChild(t) gncTaxTableReturnChild((t),FALSE) |
| #define GNC_TT_NAME "tax table name" |
QOF parameter definitions
Definition at line 199 of file gncTaxTable.h.
| #define gncTaxTableGetGUID | ( | x | ) | qof_instance_get_guid(QOF_INSTANCE(x)) |
Definition at line 203 of file gncTaxTable.h.
| enum GncAmountType |
How to interpret the amount. You can interpret it as a VALUE or a PERCENT.
Definition at line 93 of file gncTaxTable.h.
| enum GncTaxIncluded |
How to interpret the TaxIncluded
| GNC_TAXINCLUDED_YES |
tax is included |
| GNC_TAXINCLUDED_NO |
tax is not included |
| GNC_TAXINCLUDED_USEGLOBAL |
use the global setting |
Definition at line 100 of file gncTaxTable.h.
| GList* gncAccountValueAdd | ( | GList * | list, |
| Account * | acc, | ||
| gnc_numeric | value | ||
| ) |
This will add value to the account-value for acc, creating a new list object if necessary
Definition at line 868 of file gncTaxTable.c.
{
GList *li;
GncAccountValue *res = NULL;
g_return_val_if_fail (acc, list);
g_return_val_if_fail (gnc_numeric_check (value) == GNC_ERROR_OK, list);
/* Try to find the account in the list */
for (li = list; li; li = li->next)
{
res = li->data;
if (res->account == acc)
{
res->value = gnc_numeric_add (res->value, value, GNC_DENOM_AUTO,
GNC_HOW_DENOM_LCD);
return list;
}
}
/* Nope, didn't find it. */
res = g_new0 (GncAccountValue, 1);
res->account = acc;
res->value = value;
return g_list_prepend (list, res);
}
| GList* gncAccountValueAddList | ( | GList * | l1, |
| GList * | l2 | ||
| ) |
Merge l2 into l1. l2 is not touched.
Definition at line 896 of file gncTaxTable.c.
{
GList *li;
for (li = l2; li; li = li->next )
{
GncAccountValue *val = li->data;
l1 = gncAccountValueAdd (l1, val->account, val->value);
}
return l1;
}
| void gncAccountValueDestroy | ( | GList * | list | ) |
Destroy a list of accountvalues
Definition at line 923 of file gncTaxTable.c.
{
GList *node;
for ( node = list; node ; node = node->next)
g_free (node->data);
g_list_free (list);
}
| gnc_numeric gncAccountValueTotal | ( | GList * | list | ) |
return the total for this list
Definition at line 910 of file gncTaxTable.c.
{
gnc_numeric total = gnc_numeric_zero ();
for ( ; list ; list = list->next)
{
GncAccountValue *val = list->data;
total = gnc_numeric_add (total, val->value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
}
return total;
}
1.7.4