| #define GNC_TT_NAME "tax table name" |
QOF parameter definitions
Definition at line 191 of file gncTaxTable.h.
| #define gncTaxTableGetGUID | ( | x | ) | qof_instance_get_guid(QOF_INSTANCE(x)) |
| #define gncTaxTableLookup | ( | book, | |||
| guid | ) | QOF_BOOK_LOOKUP_ENTITY((book),(guid),GNC_ID_TAXTABLE, GncTaxTable) |
Return a pointer to the instance gncTaxTable that is identified by the guid, and is residing in the book. Returns NULL if the instance can't be found. Equivalent function prototype is GncTaxTable * gncTaxTableLookup (QofBook *book, const GUID *guid);
Definition at line 145 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.
00093 { 00094 GNC_AMT_TYPE_VALUE = 1, 00095 GNC_AMT_TYPE_PERCENT 00096 } GncAmountType;
| 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 99 of file gncTaxTable.h.
00099 { 00100 GNC_TAXINCLUDED_YES = 1, 00101 GNC_TAXINCLUDED_NO, 00102 GNC_TAXINCLUDED_USEGLOBAL, 00103 } GncTaxIncluded;
| 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 718 of file gncTaxTable.c.
00719 { 00720 GList *li; 00721 GncAccountValue *res = NULL; 00722 00723 g_return_val_if_fail (acc, list); 00724 g_return_val_if_fail (gnc_numeric_check (value) == GNC_ERROR_OK, list); 00725 00726 /* Try to find the account in the list */ 00727 for (li = list; li; li = li->next) { 00728 res = li->data; 00729 if (res->account == acc) { 00730 res->value = gnc_numeric_add (res->value, value, GNC_DENOM_AUTO, 00731 GNC_DENOM_LCD); 00732 return list; 00733 } 00734 } 00735 /* Nope, didn't find it. */ 00736 00737 res = g_new0 (GncAccountValue, 1); 00738 res->account = acc; 00739 res->value = value; 00740 return g_list_prepend (list, res); 00741 }
| GList* gncAccountValueAddList | ( | GList * | l1, | |
| GList * | l2 | |||
| ) |
Merge l2 into l1. l2 is not touched.
Definition at line 744 of file gncTaxTable.c.
00745 { 00746 GList *li; 00747 00748 for (li = l2; li; li = li->next ) { 00749 GncAccountValue *val = li->data; 00750 l1 = gncAccountValueAdd (l1, val->account, val->value); 00751 } 00752 00753 return l1; 00754 }
| void gncAccountValueDestroy | ( | GList * | list | ) |
Destroy a list of accountvalues
Definition at line 769 of file gncTaxTable.c.
00770 { 00771 GList *node; 00772 for ( node = list; node ; node = node->next) 00773 g_free (node->data); 00774 00775 g_list_free (list); 00776 }
| gnc_numeric gncAccountValueTotal | ( | GList * | list | ) |
return the total for this list
Definition at line 757 of file gncTaxTable.c.
00758 { 00759 gnc_numeric total = gnc_numeric_zero (); 00760 00761 for ( ; list ; list = list->next) { 00762 GncAccountValue *val = list->data; 00763 total = gnc_numeric_add (total, val->value, GNC_DENOM_AUTO, GNC_DENOM_LCD); 00764 } 00765 return total; 00766 }
1.5.2