GnuCash  4.12-558-g06612b8434
Macros | Typedefs | Enumerations | Functions

Business Invoice Interface. More...

#include <glib.h>
#include "gncBillTerm.h"
#include "gncEntry.h"
#include "gncOwner.h"
#include "gnc-lot.h"
#include "qofbook.h"
#include "gnc-pricedb.h"

Go to the source code of this file.


#define GNC_ID_INVOICE   "gncInvoice"
#define GNC_TYPE_INVOICE   (gnc_invoice_get_type ())
#define INVOICE_ID   "id"
#define INVOICE_OWNER   "owner"
#define INVOICE_OPENED   "date_opened"
#define INVOICE_POSTED   "date_posted"
#define INVOICE_DUE   "date_due"
#define INVOICE_IS_POSTED   "is_posted?"
#define INVOICE_IS_PAID   "is_paid?"
#define INVOICE_TERMS   "terms"
#define INVOICE_BILLINGID   "billing_id"
#define INVOICE_NOTES   "notes"
#define INVOICE_DOCLINK   "doclink"
#define INVOICE_ACC   "account"
#define INVOICE_POST_TXN   "posted_txn"
#define INVOICE_POST_LOT   "posted_lot"
#define INVOICE_IS_CN   "credit_note"
#define INVOICE_TYPE   "type"
#define INVOICE_TYPE_STRING   "type_string"
#define INVOICE_BILLTO   "bill-to"
#define INVOICE_ENTRIES   "list_of_entries"
#define INVOICE_JOB   "invoice_job"
#define INVOICE_FROM_LOT   "invoice-from-lot"
#define INVOICE_FROM_TXN   "invoice-from-txn"
#define gncInvoiceGetGUID(x)   qof_instance_get_guid (QOF_INSTANCE(x))
 deprecated functions
#define gncInvoiceRetGUID(x)   (x ? *(qof_instance_get_guid (QOF_INSTANCE(x))) : *(guid_null()))


typedef GList GncInvoiceList
typedef GList EntryList


enum  GncInvoiceType {


GType gnc_invoice_get_type (void)
void gncInvoiceAddEntry (GncInvoice *invoice, GncEntry *entry)
void gncInvoiceRemoveEntry (GncInvoice *invoice, GncEntry *entry)
void gncInvoiceAddPrice (GncInvoice *invoice, GNCPrice *price)
void gncBillAddEntry (GncInvoice *bill, GncEntry *entry)
 Call this function when adding an entry to a bill instead of an invoice.
void gncBillRemoveEntry (GncInvoice *bill, GncEntry *entry)
void gncInvoiceSortEntries (GncInvoice *invoice)
 Call this function when an Entry is changed and you want to re-sort the list of entries.
void gncInvoiceRemoveEntries (GncInvoice *invoice)
 Remove all entries from an invoice. More...
gnc_numeric gncInvoiceGetTotal (GncInvoice *invoice)
 Return the "total" amount of the invoice as seen on the document (and shown to the user in the reports and invoice ledger). More...
gnc_numeric gncInvoiceGetTotalOf (GncInvoice *invoice, GncEntryPaymentType type)
gnc_numeric gncInvoiceGetTotalSubtotal (GncInvoice *invoice)
gnc_numeric gncInvoiceGetTotalTax (GncInvoice *invoice)
AccountValueList * gncInvoiceGetTotalTaxList (GncInvoice *invoice)
 Return a list of tax totals accumulated per tax account.
EntryList * gncInvoiceGetEntries (GncInvoice *invoice)
GNCPrice * gncInvoiceGetPrice (GncInvoice *invoice, gnc_commodity *commodity)
gboolean gncInvoiceAmountPositive (const GncInvoice *invoice)
 Depending on the invoice type, invoices have a different effect on the balance. More...
GHashTable * gncInvoiceGetForeignCurrencies (const GncInvoice *invoice)
 Return an overview of amounts on this invoice that will be posted to accounts in currencies that are different from the invoice currency. More...
Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, time64 posted_date, time64 due_date, const char *memo, gboolean accumulatesplits, gboolean autopay)
 Post this invoice to an account. More...
gboolean gncInvoiceUnpost (GncInvoice *invoice, gboolean reset_tax_tables)
 Unpost this invoice. More...
void gncInvoiceAutoApplyPayments (GncInvoice *invoice)
 Attempt to pay the invoice using open payment lots and lots for documents of the opposite sign (credit notes versus invoices).
void gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn, Account *xfer_acc, gnc_numeric amount, gnc_numeric exch, time64 date, const char *memo, const char *num)
 A convenience function to apply a payment to an invoice. More...
GncInvoice * gncInvoiceGetInvoiceFromTxn (const Transaction *txn)
 Given a transaction, find and return the Invoice.
GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot)
 Given a LOT, find and return the Invoice attached to the lot.
void gncInvoiceBeginEdit (GncInvoice *invoice)
void gncInvoiceCommitEdit (GncInvoice *invoice)
int gncInvoiceCompare (const GncInvoice *a, const GncInvoice *b)
gboolean gncInvoiceIsPosted (const GncInvoice *invoice)
gboolean gncInvoiceIsPaid (const GncInvoice *invoice)
QofBook * gncInvoiceGetBook (GncInvoice *x)
gboolean gncInvoiceEqual (const GncInvoice *a, const GncInvoice *b)
 Test support function used by test-dbi-business-stuff.c.
Create/Destroy Functions
GncInvoice * gncInvoiceCreate (QofBook *book)
void gncInvoiceDestroy (GncInvoice *invoice)
GncInvoice * gncInvoiceCopy (const GncInvoice *other_invoice)
 Create a new GncInvoice object as a deep copy of the given other invoice. More...
Set Functions
void gncInvoiceSetID (GncInvoice *invoice, const char *id)
void gncInvoiceSetOwner (GncInvoice *invoice, GncOwner *owner)
void gncInvoiceSetDateOpenedGDate (GncInvoice *invoice, const GDate *date)
 Set the DateOpened using a GDate argument. More...
void gncInvoiceSetDateOpened (GncInvoice *invoice, time64 date)
void gncInvoiceSetDatePosted (GncInvoice *invoice, time64 date)
void gncInvoiceSetTerms (GncInvoice *invoice, GncBillTerm *terms)
void gncInvoiceSetBillingID (GncInvoice *invoice, const char *billing_id)
void gncInvoiceSetNotes (GncInvoice *invoice, const char *notes)
void gncInvoiceSetDocLink (GncInvoice *invoice, const char *doclink)
void gncInvoiceSetCurrency (GncInvoice *invoice, gnc_commodity *currency)
void gncInvoiceSetActive (GncInvoice *invoice, gboolean active)
void gncInvoiceSetIsCreditNote (GncInvoice *invoice, gboolean credit_note)
void gncInvoiceSetBillTo (GncInvoice *invoice, GncOwner *billto)
void gncInvoiceSetToChargeAmount (GncInvoice *invoice, gnc_numeric amount)
Get Functions
const char * gncInvoiceGetID (const GncInvoice *invoice)
const GncOwnergncInvoiceGetOwner (const GncInvoice *invoice)
time64 gncInvoiceGetDateOpened (const GncInvoice *invoice)
time64 gncInvoiceGetDatePosted (const GncInvoice *invoice)
time64 gncInvoiceGetDateDue (const GncInvoice *invoice)
GncBillTerm * gncInvoiceGetTerms (const GncInvoice *invoice)
const char * gncInvoiceGetBillingID (const GncInvoice *invoice)
const char * gncInvoiceGetNotes (const GncInvoice *invoice)
const char * gncInvoiceGetDocLink (const GncInvoice *invoice)
GncOwnerType gncInvoiceGetOwnerType (const GncInvoice *invoice)
GList * gncInvoiceGetTypeListForOwnerType (const GncOwnerType type)
GncInvoiceType gncInvoiceGetType (const GncInvoice *invoice)
const char * gncInvoiceGetTypeString (const GncInvoice *invoice)
gnc_commodity * gncInvoiceGetCurrency (const GncInvoice *invoice)
GncOwnergncInvoiceGetBillTo (GncInvoice *invoice)
gnc_numeric gncInvoiceGetToChargeAmount (const GncInvoice *invoice)
gboolean gncInvoiceGetActive (const GncInvoice *invoice)
gboolean gncInvoiceGetIsCreditNote (const GncInvoice *invoice)
GNCLot * gncInvoiceGetPostedLot (const GncInvoice *invoice)
Transaction * gncInvoiceGetPostedTxn (const GncInvoice *invoice)
AccountgncInvoiceGetPostedAcc (const GncInvoice *invoice)

Detailed Description

Business Invoice Interface.

Copyright (C) 2001,2006 Derek Atkins warlo.nosp@m.rd@M.nosp@m.IT.ED.nosp@m.U
Copyright (c) 2005 Neil Williams

Definition in file gncInvoice.h.