|
GnuCash
2.6.99
|
Files | |
| file | gncInvoice.h |
| Business Invoice Interface. | |
Macros | |
| #define | GNC_ID_INVOICE "gncInvoice" |
| #define | GNC_TYPE_INVOICE (gnc_invoice_get_type ()) |
| #define | GNC_INVOICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_INVOICE, GncInvoice)) |
| #define | GNC_INVOICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_INVOICE, GncInvoiceClass)) |
| #define | GNC_IS_INVOICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_INVOICE)) |
| #define | GNC_IS_INVOICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_INVOICE)) |
| #define | GNC_INVOICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_INVOICE, GncInvoiceClass)) |
| #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_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)) |
| #define | gncInvoiceRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())) |
Typedefs | |
| typedef struct _gncInvoice | GncInvoice |
| typedef struct _gncInvoiceClass | GncInvoiceClass |
| typedef GList | GncInvoiceList |
| typedef GList | EntryList |
Functions | |
| 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) |
| void | gncBillRemoveEntry (GncInvoice *bill, GncEntry *entry) |
| void | gncInvoiceSortEntries (GncInvoice *invoice) |
| void | gncInvoiceRemoveEntries (GncInvoice *invoice) |
| gnc_numeric | gncInvoiceGetTotal (GncInvoice *invoice) |
| gnc_numeric | gncInvoiceGetTotalOf (GncInvoice *invoice, GncEntryPaymentType type) |
| gnc_numeric | gncInvoiceGetTotalSubtotal (GncInvoice *invoice) |
| gnc_numeric | gncInvoiceGetTotalTax (GncInvoice *invoice) |
| EntryList * | gncInvoiceGetEntries (GncInvoice *invoice) |
| GNCPrice * | gncInvoiceGetPrice (GncInvoice *invoice, gnc_commodity *commodity) |
| gboolean | gncInvoiceAmountPositive (const GncInvoice *invoice) |
| GHashTable * | gncInvoiceGetForeignCurrencies (const GncInvoice *invoice) |
| Transaction * | gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, Timespec *posted_date, Timespec *due_date, const char *memo, gboolean accumulatesplits, gboolean autopay) |
| gboolean | gncInvoiceUnpost (GncInvoice *invoice, gboolean reset_tax_tables) |
| void | gncInvoiceAutoApplyPayments (GncInvoice *invoice) |
| void | gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn, Account *xfer_acc, gnc_numeric amount, gnc_numeric exch, Timespec date, const char *memo, const char *num) |
| GncInvoice * | gncInvoiceGetInvoiceFromTxn (const Transaction *txn) |
| GncInvoice * | gncInvoiceGetInvoiceFromLot (GNCLot *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) |
Create/Destroy Functions | |
| GncInvoice * | gncInvoiceCreate (QofBook *book) |
| void | gncInvoiceDestroy (GncInvoice *invoice) |
| GncInvoice * | gncInvoiceCopy (const GncInvoice *other_invoice) |
Set Functions | |
| void | gncInvoiceSetID (GncInvoice *invoice, const char *id) |
| void | gncInvoiceSetOwner (GncInvoice *invoice, GncOwner *owner) |
| void | gncInvoiceSetDateOpenedGDate (GncInvoice *invoice, const GDate *date) |
| void | gncInvoiceSetDateOpened (GncInvoice *invoice, Timespec date) |
| void | gncInvoiceSetDatePosted (GncInvoice *invoice, Timespec date) |
| void | gncInvoiceSetTerms (GncInvoice *invoice, GncBillTerm *terms) |
| void | gncInvoiceSetBillingID (GncInvoice *invoice, const char *billing_id) |
| void | gncInvoiceSetNotes (GncInvoice *invoice, const char *notes) |
| 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 GncOwner * | gncInvoiceGetOwner (const GncInvoice *invoice) |
| Timespec | gncInvoiceGetDateOpened (const GncInvoice *invoice) |
| Timespec | gncInvoiceGetDatePosted (const GncInvoice *invoice) |
| Timespec | gncInvoiceGetDateDue (const GncInvoice *invoice) |
| GncBillTerm * | gncInvoiceGetTerms (const GncInvoice *invoice) |
| const char * | gncInvoiceGetBillingID (const GncInvoice *invoice) |
| const char * | gncInvoiceGetNotes (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) |
| GncOwner * | gncInvoiceGetBillTo (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) |
| Account * | gncInvoiceGetPostedAcc (const GncInvoice *invoice) |
An invoice holds a list of entries, a pointer to the customer, and the job, the dates entered and posted, as well as the account, transaction and lot for the posted invoice.
| #define gncInvoiceGetGUID | ( | x | ) | qof_instance_get_guid(QOF_INSTANCE(x)) |
deprecated functions
Definition at line 307 of file gncInvoice.h.
| void gncBillAddEntry | ( | GncInvoice * | bill, |
| GncEntry * | entry | ||
| ) |
Call this function when adding an entry to a bill instead of an invoice
Definition at line 686 of file gncInvoice.c.
| gboolean gncInvoiceAmountPositive | ( | const GncInvoice * | invoice | ) |
Depending on the invoice type, invoices have a different effect on the balance. Customer invoices increase the balance, while vendor bills decrease the balance. Credit notes have the opposite effect.
Returns TRUE if the invoice will increase the balance or FALSE otherwise.
Definition at line 1215 of file gncInvoice.c.
| void gncInvoiceApplyPayment | ( | const GncInvoice * | invoice, |
| Transaction * | txn, | ||
| Account * | xfer_acc, | ||
| gnc_numeric | amount, | ||
| gnc_numeric | exch, | ||
| Timespec | date, | ||
| const char * | memo, | ||
| const char * | num | ||
| ) |
A convenience function to apply a payment to an invoice. It creates a lot for a payment optionally based on an existing transaction and then tries to balance it with the given invoice. Contrary to gncOwnerApplyPayment, no other open documents or payments for the owner will be considered to balance the payment.
This code is actually a convenience wrapper around gncOwnerCreatePaymentLot and gncOwnerAutoApplyPaymentsWithLots. See their descriptions for more details on what happens exactly.
Definition at line 1830 of file gncInvoice.c.
| 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).
Definition at line 1786 of file gncInvoice.c.
| GncInvoice* gncInvoiceCopy | ( | const GncInvoice * | other_invoice | ) |
Create a new GncInvoice object as a deep copy of the given other invoice.
The returned new invoice has everything copied from the other invoice, including the ID string field. All GncEntries are newly allocated copies of the original invoice's entries.
Definition at line 336 of file gncInvoice.c.
| gboolean gncInvoiceEqual | ( | const GncInvoice * | a, |
| const GncInvoice * | b | ||
| ) |
Test support function used by test-dbi-business-stuff.c
Definition at line 1926 of file gncInvoice.c.
| 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. These accounts can be the accounts referred to in invoice entries or tax tables. This information is returned in the from of a hash table. The keys in the hash table are the foreign currencies, the values are the accumulated amounts in that currency. Drop the reference to the hash table with g_hash_table_unref when no longer needed.
Definition at line 1236 of file gncInvoice.c.
| GncInvoice* gncInvoiceGetInvoiceFromLot | ( | GNCLot * | lot | ) |
Given a LOT, find and return the Invoice attached to the lot
Definition at line 1174 of file gncInvoice.c.
| GncInvoice* gncInvoiceGetInvoiceFromTxn | ( | const Transaction * | txn | ) |
Given a transaction, find and return the Invoice
Definition at line 1203 of file gncInvoice.c.
| 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).
Definition at line 908 of file gncInvoice.c.
| Transaction* gncInvoicePostToAccount | ( | GncInvoice * | invoice, |
| Account * | acc, | ||
| Timespec * | posted_date, | ||
| Timespec * | due_date, | ||
| const char * | memo, | ||
| gboolean | accumulatesplits, | ||
| gboolean | autopay | ||
| ) |
Post this invoice to an account. Returns the new Transaction that is tied to this invoice. The transaction is set with the supplied posted date, due date, and memo. The Transaction description is set to the name of the company.
If accumulate splits is TRUE, entries in the same account will be merged into one single split in that account. Otherwise each entry will be posted as a separate split, possibly resulting in multiple splits in one account.
If autopay is TRUE, the code will try to find pre-payments, invoices or credit notes that can reduce the amount due for this invoice, marking the invoice as fully or partially paid, depending on the amounts on all documents involved. If autopay is FALSE, it's the user's responsibility to explicitly pay the invoice.
Definition at line 1363 of file gncInvoice.c.
| void gncInvoiceRemoveEntries | ( | GncInvoice * | invoice | ) |
Remove all entries from an invoice. To be called before destroying an invoice.
Definition at line 727 of file gncInvoice.c.
| void gncInvoiceSetDateOpenedGDate | ( | GncInvoice * | invoice, |
| const GDate * | date | ||
| ) |
Set the DateOpened using a GDate argument. (Note: Internally this stores the date in a Timespec as created through timespecCanonicalDayTime()).
Definition at line 480 of file gncInvoice.c.
| void gncInvoiceSortEntries | ( | GncInvoice * | invoice | ) |
Call this function when an Entry is changed and you want to re-sort the list of entries
Definition at line 717 of file gncInvoice.c.
| gboolean gncInvoiceUnpost | ( | GncInvoice * | invoice, |
| gboolean | reset_tax_tables | ||
| ) |
Unpost this invoice. This will destroy the posted transaction and return the invoice to its unposted state. It may leave empty lots out there. If reset_tax_tables is TRUE, then it will also revert all the Tax Tables to the parent, which will potentially change the total value of the invoice. It may also leave some orphaned Tax Table children.
Returns TRUE if successful, FALSE if there is a problem.
Definition at line 1621 of file gncInvoice.c.
1.8.6