|
GnuCash c935c2f+
|
Describes billing terms, that is when a bill is due, and what sort of discount is applied (if any). More...
Files | |
| file | gncBillTerm.h |
| Billing Term interface. | |
Macros | |
| #define | GNC_ID_BILLTERM "gncBillTerm" |
| #define | GNC_TYPE_BILLTERM (gnc_billterm_get_type ()) |
| #define | GNC_BILLTERM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_BILLTERM, GncBillTerm)) |
| #define | GNC_BILLTERM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_BILLTERM, GncBillTermClass)) |
| #define | GNC_IS_BILLTERM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_BILLTERM)) |
| #define | GNC_IS_BILLTERM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_BILLTERM)) |
| #define | GNC_BILLTERM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_BILLTERM, GncBillTermClass)) |
| #define | ENUM_TERMS_TYPE(_) |
| How to interpret the amount. | |
| #define | gncBillTermGetGUID(x) qof_instance_get_guid (QOF_INSTANCE(x)) |
Enumerations | |
| enum | GncBillTermType { ENUM_TERMS_TYPE =(ENUM_BODY) } |
Functions | |
| GType | gnc_billterm_get_type (void) |
| time64 | gncBillTermComputeDueDate (const GncBillTerm *term, time64 post_date) |
Create/Destroy Functions | |
| GncBillTerm * | gncBillTermCreate (QofBook *book) |
| void | gncBillTermDestroy (GncBillTerm *term) |
| void | gncBillTermIncRef (GncBillTerm *term) |
| void | gncBillTermDecRef (GncBillTerm *term) |
| void | gncBillTermChanged (GncBillTerm *term) |
| void | gncBillTermBeginEdit (GncBillTerm *term) |
| void | gncBillTermCommitEdit (GncBillTerm *term) |
Set Functions | |
| void | gncBillTermSetName (GncBillTerm *term, const char *name) |
| void | gncBillTermSetDescription (GncBillTerm *term, const char *name) |
| void | gncBillTermSetType (GncBillTerm *term, GncBillTermType type) |
| void | gncBillTermSetDueDays (GncBillTerm *term, gint days) |
| void | gncBillTermSetDiscountDays (GncBillTerm *term, gint days) |
| void | gncBillTermSetDiscount (GncBillTerm *term, gnc_numeric discount) |
| void | gncBillTermSetCutoff (GncBillTerm *term, gint cutoff) |
Get Functions | |
| GncBillTerm * | gncBillTermLookupByName (QofBook *book, const char *name) |
| GList * | gncBillTermGetTerms (QofBook *book) |
| const char * | gncBillTermGetName (const GncBillTerm *term) |
| const char * | gncBillTermGetDescription (const GncBillTerm *term) |
| GncBillTermType | gncBillTermGetType (const GncBillTerm *term) |
| gint | gncBillTermGetDueDays (const GncBillTerm *term) |
| gint | gncBillTermGetDiscountDays (const GncBillTerm *term) |
| gnc_numeric | gncBillTermGetDiscount (const GncBillTerm *term) |
| gint | gncBillTermGetCutoff (const GncBillTerm *term) |
| gboolean | gncBillTermIsDirty (const GncBillTerm *term) |
| GncBillTerm * | gncBillTermGetParent (const GncBillTerm *term) |
| GncBillTerm * | gncBillTermReturnChild (GncBillTerm *term, gboolean make_new) |
| gint64 | gncBillTermGetRefcount (const GncBillTerm *term) |
| #define | gncBillTermGetChild(t) gncBillTermReturnChild((t),FALSE) |
Comparison Functions | |
| int | gncBillTermCompare (const GncBillTerm *a, const GncBillTerm *b) |
| Compare BillTerms on their name for sorting. | |
| gboolean | gncBillTermEqual (const GncBillTerm *a, const GncBillTerm *b) |
| Check if all internal fields of a and b match. | |
| gboolean | gncBillTermIsFamily (const GncBillTerm *a, const GncBillTerm *b) |
| Check only if the bill terms are "family". | |
BillTerm parameter names | |
| #define | GNC_BILLTERM_NAME "name" |
| #define | GNC_BILLTERM_DESC "description" |
| #define | GNC_BILLTERM_DUEDAYS "number of days due" |
| #define | GNC_BILLTERM_DISCDAYS "number of discounted days" |
| #define | GNC_BILLTERM_CUTOFF "cut off" |
| #define | GNC_BILLTERM_TYPE "bill type" |
| #define | GNC_BILLTERM_DISCOUNT "amount of discount" |
| #define | GNC_BILLTERM_REFCOUNT "reference count" |
Describes billing terms, that is when a bill is due, and what sort of discount is applied (if any).
The BillTerm object currently supports: the discount applied to a bill (absolute numeric value) the number of days until a discount expires information about the invoice due date
This last one can be defined in multiple ways: using a simple number of days value: the due date is posted date incremented with this number of days using the "proximo" method which is explained below:
A proximo billing term has two parameters: due day: day of the month the invoice/bill will be due cutoff: day of the month used to decide if the due date will be in the next month or in the month thereafter. This can be a negative number in which case the cutoff date is relative to the end of the month and counting backwards. Eg: cutoff = -3 would mean 25 in February or 28 in June
How does it work: Assume cutoff = 19 and due day = 20
Example 1 post date = 14-06-2010 (European date format) 14 is less than the cutoff of 19, so the due date will be in the next month. Since the due day is set to 20, the due date will be 20-07-2010
Example 2 post date = 22-06-2010 (European date format) 22 is more than the cutoff of 19, so the due date will be in the month after next month. Since the due day is set to 20, the due date will be 20-02-2010
| #define ENUM_TERMS_TYPE | ( | _ | ) |
How to interpret the amount.
You can interpret it as a VALUE or a PERCENT. ??? huh? NOTE: This enum /depends/ on starting at value 1
Definition at line 116 of file gncBillTerm.h.
| #define GNC_BILLTERM | ( | o | ) | (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_BILLTERM, GncBillTerm)) |
Definition at line 85 of file gncBillTerm.h.
| #define GNC_BILLTERM_CLASS | ( | k | ) | (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_BILLTERM, GncBillTermClass)) |
Definition at line 87 of file gncBillTerm.h.
| #define GNC_BILLTERM_CUTOFF "cut off" |
Definition at line 103 of file gncBillTerm.h.
| #define GNC_BILLTERM_DESC "description" |
Definition at line 100 of file gncBillTerm.h.
| #define GNC_BILLTERM_DISCDAYS "number of discounted days" |
Definition at line 102 of file gncBillTerm.h.
| #define GNC_BILLTERM_DISCOUNT "amount of discount" |
Definition at line 105 of file gncBillTerm.h.
| #define GNC_BILLTERM_DUEDAYS "number of days due" |
Definition at line 101 of file gncBillTerm.h.
| #define GNC_BILLTERM_GET_CLASS | ( | o | ) | (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_BILLTERM, GncBillTermClass)) |
Definition at line 93 of file gncBillTerm.h.
| #define GNC_BILLTERM_NAME "name" |
Definition at line 99 of file gncBillTerm.h.
| #define GNC_BILLTERM_REFCOUNT "reference count" |
Definition at line 106 of file gncBillTerm.h.
| #define GNC_BILLTERM_TYPE "bill type" |
Definition at line 104 of file gncBillTerm.h.
| #define GNC_ID_BILLTERM "gncBillTerm" |
Definition at line 81 of file gncBillTerm.h.
| #define GNC_IS_BILLTERM | ( | o | ) | (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_BILLTERM)) |
Definition at line 89 of file gncBillTerm.h.
| #define GNC_IS_BILLTERM_CLASS | ( | k | ) | (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_BILLTERM)) |
Definition at line 91 of file gncBillTerm.h.
| #define GNC_TYPE_BILLTERM (gnc_billterm_get_type ()) |
Definition at line 84 of file gncBillTerm.h.
| #define gncBillTermGetChild | ( | t | ) | gncBillTermReturnChild((t),FALSE) |
Definition at line 180 of file gncBillTerm.h.
| #define gncBillTermGetGUID | ( | x | ) | qof_instance_get_guid (QOF_INSTANCE(x)) |
Definition at line 208 of file gncBillTerm.h.
| enum GncBillTermType |
Definition at line 120 of file gncBillTerm.h.
| void gncBillTermBeginEdit | ( | GncBillTerm * | term | ) |
Definition at line 466 of file gncBillTerm.c.
| void gncBillTermChanged | ( | GncBillTerm * | term | ) |
Definition at line 460 of file gncBillTerm.c.
| void gncBillTermCommitEdit | ( | GncBillTerm * | term | ) |
Definition at line 485 of file gncBillTerm.c.
| int gncBillTermCompare | ( | const GncBillTerm * | a, |
| const GncBillTerm * | b | ||
| ) |
Compare BillTerms on their name for sorting.
Definition at line 629 of file gncBillTerm.c.
Definition at line 824 of file gncBillTerm.c.
| GncBillTerm * gncBillTermCreate | ( | QofBook * | book | ) |
Definition at line 248 of file gncBillTerm.c.
| void gncBillTermDecRef | ( | GncBillTerm * | term | ) |
Definition at line 430 of file gncBillTerm.c.
| void gncBillTermDestroy | ( | GncBillTerm * | term | ) |
Definition at line 263 of file gncBillTerm.c.
| gboolean gncBillTermEqual | ( | const GncBillTerm * | a, |
| const GncBillTerm * | b | ||
| ) |
Check if all internal fields of a and b match.
Definition at line 643 of file gncBillTerm.c.
| gint gncBillTermGetCutoff | ( | const GncBillTerm * | term | ) |
Definition at line 565 of file gncBillTerm.c.
| const char * gncBillTermGetDescription | ( | const GncBillTerm * | term | ) |
Definition at line 522 of file gncBillTerm.c.
| gnc_numeric gncBillTermGetDiscount | ( | const GncBillTerm * | term | ) |
Definition at line 559 of file gncBillTerm.c.
| gint gncBillTermGetDiscountDays | ( | const GncBillTerm * | term | ) |
Definition at line 553 of file gncBillTerm.c.
| gint gncBillTermGetDueDays | ( | const GncBillTerm * | term | ) |
Definition at line 547 of file gncBillTerm.c.
| const char * gncBillTermGetName | ( | const GncBillTerm * | term | ) |
Definition at line 516 of file gncBillTerm.c.
| GncBillTerm * gncBillTermGetParent | ( | const GncBillTerm * | term | ) |
Definition at line 611 of file gncBillTerm.c.
| gint64 gncBillTermGetRefcount | ( | const GncBillTerm * | term | ) |
Definition at line 617 of file gncBillTerm.c.
| GList * gncBillTermGetTerms | ( | QofBook * | book | ) |
Definition at line 507 of file gncBillTerm.c.
| GncBillTermType gncBillTermGetType | ( | const GncBillTerm * | term | ) |
Definition at line 528 of file gncBillTerm.c.
| void gncBillTermIncRef | ( | GncBillTerm * | term | ) |
Definition at line 420 of file gncBillTerm.c.
| gboolean gncBillTermIsDirty | ( | const GncBillTerm * | term | ) |
Definition at line 715 of file gncBillTerm.c.
| gboolean gncBillTermIsFamily | ( | const GncBillTerm * | a, |
| const GncBillTerm * | b | ||
| ) |
Check only if the bill terms are "family".
This is the case if
In practice, this check if performed by comparing the bill term's names. This is required to be unique per parent/children group.
Definition at line 707 of file gncBillTerm.c.
| GncBillTerm * gncBillTermLookupByName | ( | QofBook * | book, |
| const char * | name | ||
| ) |
Definition at line 494 of file gncBillTerm.c.
| GncBillTerm * gncBillTermReturnChild | ( | GncBillTerm * | term, |
| gboolean | make_new | ||
| ) |
Definition at line 595 of file gncBillTerm.c.
| void gncBillTermSetCutoff | ( | GncBillTerm * | term, |
| gint | cutoff | ||
| ) |
Definition at line 378 of file gncBillTerm.c.
| void gncBillTermSetDescription | ( | GncBillTerm * | term, |
| const char * | name | ||
| ) |
Definition at line 317 of file gncBillTerm.c.
| void gncBillTermSetDiscount | ( | GncBillTerm * | term, |
| gnc_numeric | discount | ||
| ) |
Definition at line 368 of file gncBillTerm.c.
| void gncBillTermSetDiscountDays | ( | GncBillTerm * | term, |
| gint | days | ||
| ) |
Definition at line 358 of file gncBillTerm.c.
| void gncBillTermSetDueDays | ( | GncBillTerm * | term, |
| gint | days | ||
| ) |
Definition at line 348 of file gncBillTerm.c.
| void gncBillTermSetName | ( | GncBillTerm * | term, |
| const char * | name | ||
| ) |
Definition at line 308 of file gncBillTerm.c.
| void gncBillTermSetType | ( | GncBillTerm * | term, |
| GncBillTermType | type | ||
| ) |
Definition at line 326 of file gncBillTerm.c.