From f330ed7fbc5843eea114f1969260515091fff58c Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Wed, 24 Sep 2003 02:25:09 +0000 Subject: [PATCH] add kvp frame to customer git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9413 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-core/gncCustomer.c | 11 +++++++++++ src/business/business-core/gncCustomer.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/business/business-core/gncCustomer.c b/src/business/business-core/gncCustomer.c index f8472b98bb..cf67b6f540 100644 --- a/src/business/business-core/gncCustomer.c +++ b/src/business/business-core/gncCustomer.c @@ -16,6 +16,7 @@ #include "qofobject.h" #include "gnc-event-p.h" #include "gnc-be-utils.h" +#include "kvp_frame.h" #include "qofbook.h" #include "qofid-p.h" @@ -42,6 +43,8 @@ struct _gncCustomer { gnc_numeric discount; gnc_numeric credit; GncTaxIncluded taxincluded; + KvpFrame *kvp_data; + gboolean active; GList * jobs; @@ -94,6 +97,7 @@ GncCustomer *gncCustomerCreate (QofBook *book) cust->taxincluded = GNC_TAXINCLUDED_USEGLOBAL; cust->active = TRUE; cust->jobs = NULL; + cust->kvp_data = kvp_frame_new(); qof_entity_guid_new (qof_book_get_entity_table (book),&cust->guid); addObj (cust); @@ -122,6 +126,7 @@ static void gncCustomerFree (GncCustomer *cust) gncAddressDestroy (cust->addr); gncAddressDestroy (cust->shipaddr); g_list_free (cust->jobs); + kvp_frame_delete (cust->kvp_data); remObj (cust); @@ -420,6 +425,12 @@ GncTaxTable* gncCustomerGetTaxTable (GncCustomer *customer) return customer->taxtable; } +KvpFrame* gncCustomerGetSlots (GncCustomer *customer) +{ + if (!customer) return NULL; + return customer->kvp_data; +} + GList * gncCustomerGetJoblist (GncCustomer *cust, gboolean show_all) { if (!cust) return NULL; diff --git a/src/business/business-core/gncCustomer.h b/src/business/business-core/gncCustomer.h index 8c2c4d515d..13360c0897 100644 --- a/src/business/business-core/gncCustomer.h +++ b/src/business/business-core/gncCustomer.h @@ -16,6 +16,7 @@ typedef struct _gncCustomer GncCustomer; #include "gncJob.h" #include "gnc-numeric.h" +#include "kvp_frame.h" #define GNC_CUSTOMER_MODULE_NAME "gncCustomer" @@ -64,6 +65,7 @@ gnc_commodity * gncCustomerGetCurrency (GncCustomer *customer); gboolean gncCustomerGetTaxTableOverride (GncCustomer *customer); GncTaxTable* gncCustomerGetTaxTable (GncCustomer *customer); +KvpFrame *gncCustomerGetSlots (GncCustomer *customer); GList * gncCustomerGetJoblist (GncCustomer *customer, gboolean show_all); GUID gncCustomerRetGUID (GncCustomer *customer);