68 #ifndef GNC_BILLTERM_H_ 69 #define GNC_BILLTERM_H_ 81 #define GNC_ID_BILLTERM "gncBillTerm" 84 #define GNC_TYPE_BILLTERM (gnc_billterm_get_type ()) 85 #define GNC_BILLTERM(o) \ 86 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_BILLTERM, GncBillTerm)) 87 #define GNC_BILLTERM_CLASS(k) \ 88 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_BILLTERM, GncBillTermClass)) 89 #define GNC_IS_BILLTERM(o) \ 90 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_BILLTERM)) 91 #define GNC_IS_BILLTERM_CLASS(k) \ 92 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_BILLTERM)) 93 #define GNC_BILLTERM_GET_CLASS(o) \ 94 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_BILLTERM, GncBillTermClass)) 95 GType gnc_billterm_get_type(
void);
99 #define GNC_BILLTERM_NAME "name" 100 #define GNC_BILLTERM_DESC "description" 101 #define GNC_BILLTERM_DUEDAYS "number of days due" 102 #define GNC_BILLTERM_DISCDAYS "number of discounted days" 103 #define GNC_BILLTERM_CUTOFF "cut off" 104 #define GNC_BILLTERM_TYPE "bill type" 105 #define GNC_BILLTERM_DISCOUNT "amount of discount" 106 #define GNC_BILLTERM_REFCOUNT "reference count" 116 #define ENUM_TERMS_TYPE(_) \ 117 _(GNC_TERM_TYPE_DAYS,=1) \ 118 _(GNC_TERM_TYPE_PROXIMO,) 124 GNC_TERM_TYPE_DAYS = 1,
125 GNC_TERM_TYPE_PROXIMO,
131 GncBillTerm * gncBillTermCreate (QofBook *book);
132 void gncBillTermDestroy (GncBillTerm *term);
133 void gncBillTermIncRef (GncBillTerm *term);
134 void gncBillTermDecRef (GncBillTerm *term);
136 void gncBillTermChanged (GncBillTerm *term);
137 void gncBillTermBeginEdit (GncBillTerm *term);
138 void gncBillTermCommitEdit (GncBillTerm *term);
144 void gncBillTermSetName (GncBillTerm *term,
const char *name);
145 void gncBillTermSetDescription (GncBillTerm *term,
const char *name);
146 void gncBillTermSetType (GncBillTerm *term, GncBillTermType type);
147 void gncBillTermSetDueDays (GncBillTerm *term, gint days);
148 void gncBillTermSetDiscountDays (GncBillTerm *term, gint days);
149 void gncBillTermSetDiscount (GncBillTerm *term, gnc_numeric discount);
150 void gncBillTermSetCutoff (GncBillTerm *term, gint cutoff);
160 static inline GncBillTerm * gncBillTermLookup (
const QofBook *book,
const GncGUID *guid)
165 GncBillTerm *gncBillTermLookupByName (QofBook *book,
const char *name);
166 GList * gncBillTermGetTerms (QofBook *book);
168 const char *gncBillTermGetName (
const GncBillTerm *term);
169 const char *gncBillTermGetDescription (
const GncBillTerm *term);
170 GncBillTermType gncBillTermGetType (
const GncBillTerm *term);
171 gint gncBillTermGetDueDays (
const GncBillTerm *term);
172 gint gncBillTermGetDiscountDays (
const GncBillTerm *term);
173 gnc_numeric gncBillTermGetDiscount (
const GncBillTerm *term);
174 gint gncBillTermGetCutoff (
const GncBillTerm *term);
176 gboolean gncBillTermIsDirty (
const GncBillTerm *term);
178 GncBillTerm *gncBillTermGetParent (
const GncBillTerm *term);
179 GncBillTerm *gncBillTermReturnChild (GncBillTerm *term, gboolean make_new);
180 #define gncBillTermGetChild(t) gncBillTermReturnChild((t),FALSE) 181 gint64 gncBillTermGetRefcount (
const GncBillTerm *term);
205 time64 gncBillTermComputeDueDate (
const GncBillTerm *term,
time64 post_date);
208 #define gncBillTermGetGUID(x) qof_instance_get_guid (QOF_INSTANCE(x)) int gncBillTermCompare(const GncBillTerm *a, const GncBillTerm *b)
Compare BillTerms on their name for sorting.
#define ENUM_TERMS_TYPE(_)
How to interpret the amount.
#define QOF_BOOK_RETURN_ENTITY(book, guid, e_type, c_type)
Encapsulates all the information about a dataset manipulated by QOF.
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".
– Business Helper Functions
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
The type used to store guids in C.