GnuCash c935c2f+
Loading...
Searching...
No Matches
gncVendor.h
Go to the documentation of this file.
1/********************************************************************\
2 * gncVendor.h -- the Core Vendor Interface *
3 * *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation; either version 2 of *
7 * the License, or (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License*
15 * along with this program; if not, contact: *
16 * *
17 * Free Software Foundation Voice: +1-617-542-5942 *
18 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19 * Boston, MA 02110-1301, USA gnu@gnu.org *
20 * *
21\********************************************************************/
31#ifndef GNC_VENDOR_H_
32#define GNC_VENDOR_H_
33
34typedef struct _gncVendor GncVendor;
35typedef struct _gncVendorClass GncVendorClass;
36
37#include "gncAddress.h"
38#include "gncBillTerm.h"
39#include "gncTaxTable.h"
40#include "gncJob.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46#define GNC_ID_VENDOR "gncVendor"
47
48/* --- type macros --- */
49#define GNC_TYPE_VENDOR (gnc_vendor_get_type ())
50#define GNC_VENDOR(o) \
51 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_VENDOR, GncVendor))
52#define GNC_VENDOR_CLASS(k) \
53 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_VENDOR, GncVendorClass))
54#define GNC_IS_VENDOR(o) \
55 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_VENDOR))
56#define GNC_IS_VENDOR_CLASS(k) \
57 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_VENDOR))
58#define GNC_VENDOR_GET_CLASS(o) \
59 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_VENDOR, GncVendorClass))
60GType gnc_vendor_get_type(void);
61
62/* Create/Destroy Functions */
63
64GncVendor *gncVendorCreate (QofBook *book);
65void gncVendorDestroy (GncVendor *vendor);
66
71void gncVendorSetID (GncVendor *vendor, const char *id);
72void gncVendorSetName (GncVendor *vendor, const char *name);
73void gncVendorSetNotes (GncVendor *vendor, const char *notes);
74void gncVendorSetTerms (GncVendor *vendor, GncBillTerm *terms);
75void gncVendorSetTaxIncluded (GncVendor *vendor, GncTaxIncluded taxincl);
76void gncVendorSetCurrency (GncVendor *vendor, gnc_commodity *currency);
77void gncVendorSetActive (GncVendor *vendor, gboolean active);
78void gncVendorSetTaxTableOverride (GncVendor *vendor, gboolean override);
79void gncVendorSetTaxTable (GncVendor *vendor, GncTaxTable *table);
80
83void gncVendorAddJob (GncVendor *vendor, GncJob *job);
84void gncVendorRemoveJob (GncVendor *vendor, GncJob *job);
85
86void gncVendorBeginEdit (GncVendor *vendor);
87void gncVendorCommitEdit (GncVendor *vendor);
88
93const char * gncVendorGetID (const GncVendor *vendor);
94const char * gncVendorGetName (const GncVendor *vendor);
95GncAddress * gncVendorGetAddr (const GncVendor *vendor);
96const char * gncVendorGetNotes (const GncVendor *vendor);
97GncBillTerm * gncVendorGetTerms (const GncVendor *vendor);
98GncTaxIncluded gncVendorGetTaxIncluded (const GncVendor *vendor);
99gnc_commodity * gncVendorGetCurrency (const GncVendor *vendor);
100gboolean gncVendorGetActive (const GncVendor *vendor);
101
102gboolean gncVendorGetTaxTableOverride (const GncVendor *vendor);
103GncTaxTable* gncVendorGetTaxTable (const GncVendor *vendor);
104
110int gncVendorCompare (const GncVendor *a, const GncVendor *b);
111
116static inline GncVendor * gncVendorLookup (const QofBook *book, const GncGUID *guid)
117{
118 QOF_BOOK_RETURN_ENTITY(book, guid, GNC_ID_VENDOR, GncVendor);
119}
120
121#define VENDOR_ID "id"
122#define VENDOR_NAME "name"
123#define VENDOR_ADDR "addr"
124#define VENDOR_NOTES "vendor_notes"
125#define VENDOR_TERMS "vendor_terms"
126#define VENDOR_TAX_INC "vendor_tax_included"
127#define VENDOR_ACTIVE "vendor_is_active"
128#define VENDOR_TAX_OVERRIDE "override_tax_table"
129#define VENDOR_TAX_TABLE "vendor_tax_table"
130
132#define gncVendorGetBook(X) qof_instance_get_book (QOF_INSTANCE(X))
133#define gncVendorGetGUID(X) qof_instance_get_guid (QOF_INSTANCE(X))
134#define gncVendorRetGUID(X) (X ? *(qof_instance_get_guid (QOF_INSTANCE(X))) : *(guid_null()))
135#define gncVendorLookupDirect(G,B) gncVendorLookup((B),&(G))
137gboolean gncVendorEqual(const GncVendor *a, const GncVendor *b);
138gboolean gncVendorIsDirty (const GncVendor *vendor);
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* GNC_VENDOR_H_ */
an Address object
Billing Term interface.
Job Interface.
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.
Definition qofbook.h:101
GncTaxIncluded
How to interpret the TaxIncluded.
Definition gncTaxTable.h:86
gboolean gncVendorEqual(const GncVendor *a, const GncVendor *b)
Test support function, used by test-dbi-business-stuff.c.
Definition gncVendor.c:804
int gncVendorCompare(const GncVendor *a, const GncVendor *b)
XXX should be renamed to RetJobList to be consistent with other usage, since caller must free the cop...
Definition gncVendor.c:795
The type used to store guids in C.
Definition guid.h:75
modtime is the internal date of the last modtime See libgnucash/engine/TaxTableBillTermImmutability....
QofBook reference.
Definition qofbook-p.hpp:47