56typedef GList AccountValueList;
64#define GNC_ID_ENTRY "gncEntry"
67#define GNC_TYPE_ENTRY (gnc_entry_get_type ())
69 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ENTRY, GncEntry))
70#define GNC_ENTRY_CLASS(k) \
71 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ENTRY, GncEntryClass))
72#define GNC_IS_ENTRY(o) \
73 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ENTRY))
74#define GNC_IS_ENTRY_CLASS(k) \
75 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ENTRY))
76#define GNC_ENTRY_GET_CLASS(o) \
77 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ENTRY, GncEntryClass))
78GType gnc_entry_get_type(
void);
90gboolean gncEntryDiscountStringToHow (
const char *str, GncDiscountHow *how);
92const char * gncEntryPaymentTypeToString (GncEntryPaymentType type);
93gboolean gncEntryPaymentStringToType (
const char *str, GncEntryPaymentType *type);
97GncEntry *gncEntryCreate (
QofBook *book);
98void gncEntryDestroy (GncEntry *entry);
111void gncEntrySetDateEntered (GncEntry *entry,
time64 date);
112void gncEntrySetDescription (GncEntry *entry,
const char *desc);
113void gncEntrySetAction (GncEntry *entry,
const char *action);
114void gncEntrySetNotes (GncEntry *entry,
const char *notes);
132void gncEntrySetInvAccount (GncEntry *entry,
Account *acc);
133void gncEntrySetInvPrice (GncEntry *entry, gnc_numeric price);
134void gncEntrySetInvTaxable (GncEntry *entry, gboolean taxable);
135void gncEntrySetInvTaxIncluded (GncEntry *entry, gboolean tax_included);
137void gncEntrySetInvDiscount (GncEntry *entry, gnc_numeric discount);
138void gncEntrySetInvDiscountType (GncEntry *entry,
GncAmountType type);
139void gncEntrySetInvDiscountHow (GncEntry *entry, GncDiscountHow how);
140void qofEntrySetInvDiscType (GncEntry *entry,
const char *type);
141void qofEntrySetInvDiscHow (GncEntry *entry,
const char *type);
146void gncEntrySetBillAccount (GncEntry *entry,
Account *acc);
147void gncEntrySetBillPrice (GncEntry *entry, gnc_numeric price);
148void gncEntrySetBillTaxable (GncEntry *entry, gboolean taxable);
149void gncEntrySetBillTaxIncluded (GncEntry *entry, gboolean tax_included);
151void gncEntrySetBillable (GncEntry *entry, gboolean billable);
152void gncEntrySetBillTo (GncEntry *entry,
GncOwner *billto);
157void gncEntrySetBillPayment (GncEntry *entry, GncEntryPaymentType type);
169time64 gncEntryGetDateEntered (
const GncEntry *entry);
170const char * gncEntryGetDescription (
const GncEntry *entry);
171const char * gncEntryGetAction (
const GncEntry *entry);
172const char * gncEntryGetNotes (
const GncEntry *notes);
189Account * gncEntryGetInvAccount (
const GncEntry *entry);
190gnc_numeric gncEntryGetInvPrice (
const GncEntry *entry);
191gnc_numeric gncEntryGetPrice (
const GncEntry *entry,
const gboolean cust_doc,
const gboolean net);
192gnc_numeric gncEntryGetInvDiscount (
const GncEntry *entry);
193GncAmountType gncEntryGetInvDiscountType (
const GncEntry *entry);
194GncDiscountHow gncEntryGetInvDiscountHow (
const GncEntry *entry);
195char* qofEntryGetInvDiscType (
const GncEntry *entry);
196char* qofEntryGetInvDiscHow (
const GncEntry *entry);
197gboolean gncEntryGetInvTaxable (
const GncEntry *entry);
198gboolean gncEntryGetInvTaxIncluded (
const GncEntry *entry);
199GncTaxTable * gncEntryGetInvTaxTable (
const GncEntry *entry);
204Account * gncEntryGetBillAccount (
const GncEntry *entry);
205gnc_numeric gncEntryGetBillPrice (
const GncEntry *entry);
206gboolean gncEntryGetBillTaxable (
const GncEntry *entry);
207gboolean gncEntryGetBillTaxIncluded (
const GncEntry *entry);
208GncTaxTable * gncEntryGetBillTaxTable (
const GncEntry *entry);
209gboolean gncEntryGetBillable (
const GncEntry *entry);
210GncOwner *gncEntryGetBillTo (GncEntry *entry);
212GncEntryPaymentType gncEntryGetBillPayment (
const GncEntry* entry);
215void gncEntryCopy (
const GncEntry *src, GncEntry *dest, gboolean add_entry);
252gnc_numeric gncEntryGetDocValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
253gnc_numeric gncEntryGetDocTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
256gnc_numeric gncEntryGetDocDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
258gnc_numeric gncEntryGetBalValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
259gnc_numeric gncEntryGetBalTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
262gnc_numeric gncEntryGetBalDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
277 const GncTaxTable *tax_table, gboolean tax_included,
279 GncDiscountHow discount_how,
int SCU,
281 gnc_numeric *value, gnc_numeric *discount_value,
286GncOrder * gncEntryGetOrder (
const GncEntry *entry);
287GncInvoice * gncEntryGetInvoice (
const GncEntry *entry);
288GncInvoice * gncEntryGetBill (
const GncEntry *entry);
294static inline GncEntry * gncEntryLookup (
const QofBook *book,
const GncGUID *guid)
299gboolean gncEntryIsOpen (
const GncEntry *entry);
300void gncEntryBeginEdit (GncEntry *entry);
301void gncEntryCommitEdit (GncEntry *entry);
302int gncEntryCompare (
const GncEntry *a,
const GncEntry *b);
304#define ENTRY_DATE "date"
305#define ENTRY_DATE_ENTERED "date-entered"
306#define ENTRY_DESC "desc"
307#define ENTRY_ACTION "action"
308#define ENTRY_NOTES "notes"
309#define ENTRY_QTY "qty"
311#define ENTRY_IPRICE "iprice"
312#define ENTRY_IACCT "invoice-account"
313#define ENTRY_BACCT "bill-account"
314#define ENTRY_BPRICE "bprice"
315#define ENTRY_BILLABLE "billable?"
316#define ENTRY_BILLTO "bill-to"
318#define ENTRY_ORDER "order"
319#define ENTRY_INVOICE "invoice"
320#define ENTRY_BILL "bill"
322#define ENTRY_INV_DISC_TYPE "discount-type"
323#define ENTRY_INV_DISC_HOW "discount-method"
325#define ENTRY_INV_TAXABLE "invoice-taxable"
326#define ENTRY_BILL_TAXABLE "bill-taxable"
327#define ENTRY_INV_TAX_INC "invoice-tax-included"
328#define ENTRY_BILL_TAX_INC "bill-tax-included"
329#define ENTRY_INV_DISCOUNT "invoice-discount"
330#define ENTRY_BILL_PAY_TYPE "bill-payment-type"
334#define gncEntryGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
-- Business Helper Functions
Business Invoice Interface.
Business Interface: Object OWNERs.
Tax Table programming interface.
#define QOF_BOOK_RETURN_ENTITY(book, guid, e_type, c_type)
Encapsulates all the information about a dataset manipulated by QOF.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
GDate gncEntryGetDateGDate(const GncEntry *entry)
Returns the day of this entry.
void gncEntrySetDocQuantity(GncEntry *entry, gnc_numeric quantity, gboolean is_cn)
Set the internal quantity converting from the quantity as visible on the physical document.
time64 gncEntryGetDate(const GncEntry *entry)
DEPRECATED - use gncEntryGetDateGDate() instead! (Because the time-of-day is a misleading extra infor...
AccountValueList * gncEntryGetDocTaxValues(GncEntry *entry, gboolean is_cust_doc, gboolean is_cn)
Careful: the returned list is NOT owned by the entry and should be freed by the caller.
const char * gncEntryDiscountHowToString(GncDiscountHow how)
How to apply the discount and taxes.
AccountValueList * gncEntryGetBalTaxValues(GncEntry *entry, gboolean is_cust_doc)
Careful: the returned list is NOT owned by the entry and should be freed by the caller.
void gncEntryComputeValue(gnc_numeric qty, gnc_numeric price, const GncTaxTable *tax_table, gboolean tax_included, gnc_numeric discount, GncAmountType discount_type, GncDiscountHow discount_how, int SCU, gnc_numeric *value, gnc_numeric *discount_value, GList **tax_values)
Compute the Entry value, tax_value, and discount_value, based on the quantity, price,...
void gncEntrySetDateGDate(GncEntry *entry, const GDate *date)
Set the date of this entry.
gnc_numeric gncEntryGetDocQuantity(const GncEntry *entry, gboolean is_cn)
Get the quantity as on the physical document.
void gncEntrySetQuantity(GncEntry *entry, gnc_numeric quantity)
Set the internal quantity without any conversion.
gnc_numeric gncEntryGetQuantity(const GncEntry *entry)
Get the quantity as stored internally.
void gncEntrySetDate(GncEntry *entry, time64 date)
DEPRECATED - use gncEntrySetDateGDate() instead! (Because the time-of-day is a misleading extra infor...
GncAmountType
How to interpret the amount.
The type used to store guids in C.
modtime is the internal date of the last modtime See libgnucash/engine/TaxTableBillTermImmutability....