36 #ifndef GNC_INVOICE_H_
37 #define GNC_INVOICE_H_
42 typedef GList GncInvoiceList;
53 #define GNC_ID_INVOICE "gncInvoice"
57 GNC_INVOICE_UNDEFINED ,
58 GNC_INVOICE_CUST_INVOICE ,
59 GNC_INVOICE_VEND_INVOICE ,
60 GNC_INVOICE_EMPL_INVOICE ,
61 GNC_INVOICE_CUST_CREDIT_NOTE ,
62 GNC_INVOICE_VEND_CREDIT_NOTE ,
63 GNC_INVOICE_EMPL_CREDIT_NOTE ,
71 #define GNC_TYPE_INVOICE (gnc_invoice_get_type ())
72 #define GNC_INVOICE(o) \
73 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_INVOICE, GncInvoice))
74 #define GNC_INVOICE_CLASS(k) \
75 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_INVOICE, GncInvoiceClass))
76 #define GNC_IS_INVOICE(o) \
77 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_INVOICE))
78 #define GNC_IS_INVOICE_CLASS(k) \
79 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_INVOICE))
80 #define GNC_INVOICE_GET_CLASS(o) \
81 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_INVOICE, GncInvoiceClass))
82 GType gnc_invoice_get_type(
void);
101 void gncInvoiceSetID (
GncInvoice *invoice,
const char *
id);
109 void gncInvoiceSetBillingID (
GncInvoice *invoice,
const char *billing_id);
110 void gncInvoiceSetNotes (
GncInvoice *invoice,
const char *notes);
112 void gncInvoiceSetActive (
GncInvoice *invoice, gboolean active);
113 void gncInvoiceSetIsCreditNote (
GncInvoice *invoice, gboolean credit_note);
138 const char * gncInvoiceGetID (
const GncInvoice *invoice);
144 const char * gncInvoiceGetBillingID (
const GncInvoice *invoice);
145 const char * gncInvoiceGetNotes (
const GncInvoice *invoice);
146 GncOwnerType gncInvoiceGetOwnerType (
const GncInvoice *invoice);
147 GList * gncInvoiceGetTypeListForOwnerType (
const GncOwnerType type);
148 GncInvoiceType gncInvoiceGetType (
const GncInvoice *invoice);
149 const char * gncInvoiceGetTypeString (
const GncInvoice *invoice);
153 gboolean gncInvoiceGetActive (
const GncInvoice *invoice);
154 gboolean gncInvoiceGetIsCreditNote (
const GncInvoice *invoice);
168 typedef GList EntryList;
169 EntryList * gncInvoiceGetEntries (
GncInvoice *invoice);
213 const char *memo, gboolean accumulatesplits,
254 const char *memo,
const char *num);
271 if (book == NULL || guid == NULL)
return NULL;
275 void gncInvoiceBeginEdit (
GncInvoice *invoice);
276 void gncInvoiceCommitEdit (
GncInvoice *invoice);
278 gboolean gncInvoiceIsPosted (
const GncInvoice *invoice);
279 gboolean gncInvoiceIsPaid (
const GncInvoice *invoice);
281 #define INVOICE_ID "id"
282 #define INVOICE_OWNER "owner"
283 #define INVOICE_OPENED "date_opened"
284 #define INVOICE_POSTED "date_posted"
285 #define INVOICE_DUE "date_due"
286 #define INVOICE_IS_POSTED "is_posted?"
287 #define INVOICE_IS_PAID "is_paid?"
288 #define INVOICE_TERMS "terms"
289 #define INVOICE_BILLINGID "billing_id"
290 #define INVOICE_NOTES "notes"
291 #define INVOICE_ACC "account"
292 #define INVOICE_POST_TXN "posted_txn"
293 #define INVOICE_POST_LOT "posted_lot"
294 #define INVOICE_IS_CN "credit_note"
295 #define INVOICE_TYPE "type"
296 #define INVOICE_TYPE_STRING "type_string"
297 #define INVOICE_BILLTO "bill-to"
298 #define INVOICE_ENTRIES "list_of_entries"
299 #define INVOICE_JOB "invoice_job"
301 #define INVOICE_FROM_LOT "invoice-from-lot"
302 #define INVOICE_FROM_TXN "invoice-from-txn"
307 #define gncInvoiceGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
308 #define gncInvoiceRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
Business Interface: Object OWNERs.
a simple price database for gnucash
Use a 64-bit unsigned int timespec.
void gncInvoiceRemoveEntries(GncInvoice *invoice)
#define QOF_BOOK_RETURN_ENTITY(book, guid, e_type, c_type)
Encapsulates all the information about a dataset manipulated by QOF. This is the top-most structure u...
GHashTable * gncInvoiceGetForeignCurrencies(const GncInvoice *invoice)
void gncInvoiceSortEntries(GncInvoice *invoice)
gnc_numeric gncInvoiceGetTotal(GncInvoice *invoice)
void gncInvoiceAutoApplyPayments(GncInvoice *invoice)
GncInvoice * gncInvoiceGetInvoiceFromTxn(const Transaction *txn)
void gncInvoiceApplyPayment(const GncInvoice *invoice, Transaction *txn, Account *xfer_acc, gnc_numeric amount, gnc_numeric exch, Timespec date, const char *memo, const char *num)
void gncBillAddEntry(GncInvoice *bill, GncEntry *entry)
Transaction * gncInvoicePostToAccount(GncInvoice *invoice, Account *acc, Timespec *posted_date, Timespec *due_date, const char *memo, gboolean accumulatesplits, gboolean autopay)
Encapsulate all the information about a dataset.
void gncInvoiceSetDateOpenedGDate(GncInvoice *invoice, const GDate *date)
GncInvoice * gncInvoiceGetInvoiceFromLot(GNCLot *lot)
gboolean gncInvoiceUnpost(GncInvoice *invoice, gboolean reset_tax_tables)
Business Entry Interface.
gboolean gncInvoiceEqual(const GncInvoice *a, const GncInvoice *b)
GncInvoice * gncInvoiceCopy(const GncInvoice *other_invoice)
gboolean gncInvoiceAmountPositive(const GncInvoice *invoice)