2001-11-16 19:17:06 -06:00
|
|
|
/*
|
|
|
|
* gncCustomer.h -- the Core Customer Interface
|
2002-02-03 14:01:08 -06:00
|
|
|
* Copyright (C) 2001,2002 Derek Atkins
|
2001-11-16 19:17:06 -06:00
|
|
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GNC_CUSTOMER_H_
|
|
|
|
#define GNC_CUSTOMER_H_
|
|
|
|
|
|
|
|
typedef struct _gncCustomer GncCustomer;
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
#include "gnc-book.h"
|
2001-11-16 19:17:06 -06:00
|
|
|
#include "gncAddress.h"
|
2002-06-21 21:38:13 -05:00
|
|
|
#include "gncBillTerm.h"
|
2002-06-23 23:59:04 -05:00
|
|
|
#include "gncTaxTable.h"
|
2001-11-16 19:17:06 -06:00
|
|
|
#include "gncJob.h"
|
|
|
|
|
|
|
|
#include "gnc-numeric.h"
|
|
|
|
|
|
|
|
#define GNC_CUSTOMER_MODULE_NAME "gncCustomer"
|
|
|
|
|
|
|
|
/* Create/Destroy Functions */
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
GncCustomer *gncCustomerCreate (GNCBook *book);
|
2001-11-16 19:17:06 -06:00
|
|
|
void gncCustomerDestroy (GncCustomer *customer);
|
|
|
|
|
|
|
|
/* Set Functions */
|
|
|
|
|
|
|
|
void gncCustomerSetID (GncCustomer *customer, const char *id);
|
|
|
|
void gncCustomerSetName (GncCustomer *customer, const char *name);
|
|
|
|
void gncCustomerSetNotes (GncCustomer *customer, const char *notes);
|
2002-06-21 21:38:13 -05:00
|
|
|
void gncCustomerSetTerms (GncCustomer *customer, GncBillTerm *term);
|
2002-06-23 23:59:04 -05:00
|
|
|
void gncCustomerSetTaxIncluded (GncCustomer *customer, GncTaxIncluded taxincl);
|
2001-11-16 19:17:06 -06:00
|
|
|
void gncCustomerSetActive (GncCustomer *customer, gboolean active);
|
|
|
|
void gncCustomerSetDiscount (GncCustomer *customer, gnc_numeric discount);
|
|
|
|
void gncCustomerSetCredit (GncCustomer *customer, gnc_numeric credit);
|
2003-01-12 16:53:02 -06:00
|
|
|
void gncCustomerSetCurrency (GncCustomer *customer, gnc_commodity *currency);
|
2001-11-16 19:17:06 -06:00
|
|
|
|
2002-09-16 23:19:57 -05:00
|
|
|
void gncCustomerSetTaxTableOverride (GncCustomer *customer, gboolean override);
|
|
|
|
void gncCustomerSetTaxTable (GncCustomer *customer, GncTaxTable *table);
|
|
|
|
|
2001-11-16 19:17:06 -06:00
|
|
|
void gncCustomerAddJob (GncCustomer *customer, GncJob *job);
|
|
|
|
void gncCustomerRemoveJob (GncCustomer *customer, GncJob *job);
|
|
|
|
|
2002-11-03 14:21:42 -06:00
|
|
|
void gncCustomerBeginEdit (GncCustomer *customer);
|
2001-11-16 19:17:06 -06:00
|
|
|
void gncCustomerCommitEdit (GncCustomer *customer);
|
|
|
|
|
|
|
|
/* Get Functions */
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
GNCBook * gncCustomerGetBook (GncCustomer *customer);
|
2001-11-16 19:17:06 -06:00
|
|
|
const GUID * gncCustomerGetGUID (GncCustomer *customer);
|
|
|
|
const char * gncCustomerGetID (GncCustomer *customer);
|
|
|
|
const char * gncCustomerGetName (GncCustomer *customer);
|
|
|
|
GncAddress * gncCustomerGetAddr (GncCustomer *customer);
|
|
|
|
GncAddress * gncCustomerGetShipAddr (GncCustomer *customer);
|
|
|
|
const char * gncCustomerGetNotes (GncCustomer *customer);
|
2002-06-21 21:38:13 -05:00
|
|
|
GncBillTerm * gncCustomerGetTerms (GncCustomer *customer);
|
2002-06-23 23:59:04 -05:00
|
|
|
GncTaxIncluded gncCustomerGetTaxIncluded (GncCustomer *customer);
|
2001-11-16 19:17:06 -06:00
|
|
|
gboolean gncCustomerGetActive (GncCustomer *customer);
|
|
|
|
gnc_numeric gncCustomerGetDiscount (GncCustomer *customer);
|
|
|
|
gnc_numeric gncCustomerGetCredit (GncCustomer *customer);
|
2003-01-12 16:53:02 -06:00
|
|
|
gnc_commodity * gncCustomerGetCurrency (GncCustomer *customer);
|
2001-11-16 19:17:06 -06:00
|
|
|
|
2002-09-16 23:19:57 -05:00
|
|
|
gboolean gncCustomerGetTaxTableOverride (GncCustomer *customer);
|
|
|
|
GncTaxTable* gncCustomerGetTaxTable (GncCustomer *customer);
|
|
|
|
|
2001-11-16 19:17:06 -06:00
|
|
|
GList * gncCustomerGetJoblist (GncCustomer *customer, gboolean show_all);
|
|
|
|
|
2002-05-27 13:17:31 -05:00
|
|
|
GUID gncCustomerRetGUID (GncCustomer *customer);
|
|
|
|
GncCustomer * gncCustomerLookupDirect (GUID guid, GNCBook *book);
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
GncCustomer * gncCustomerLookup (GNCBook *book, const GUID *guid);
|
|
|
|
|
2001-11-16 19:17:06 -06:00
|
|
|
gboolean gncCustomerIsDirty (GncCustomer *customer);
|
2002-02-03 14:01:08 -06:00
|
|
|
int gncCustomerCompare (GncCustomer *a, GncCustomer *b);
|
|
|
|
|
|
|
|
#define CUSTOMER_ID "id"
|
|
|
|
#define CUSTOMER_NAME "name"
|
2002-02-04 12:54:06 -06:00
|
|
|
#define CUSTOMER_ADDR "addr"
|
|
|
|
#define CUSTOMER_SHIPADDR "shipaddr"
|
2001-11-16 19:17:06 -06:00
|
|
|
|
|
|
|
#endif /* GNC_CUSTOMER_H_ */
|