GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Files | Macros | Typedefs | Functions
Employee

Files

file  gncEmployee.h
 Employee Interface.
 

Macros

#define GNC_ID_EMPLOYEE   "gncEmployee"
 
#define GNC_TYPE_EMPLOYEE   (gnc_employee_get_type ())
 
#define GNC_EMPLOYEE(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_EMPLOYEE, GncEmployee))
 
#define GNC_EMPLOYEE_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_EMPLOYEE, GncEmployeeClass))
 
#define GNC_IS_EMPLOYEE(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_EMPLOYEE))
 
#define GNC_IS_EMPLOYEE_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_EMPLOYEE))
 
#define GNC_EMPLOYEE_GET_CLASS(o)   (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_EMPLOYEE, GncEmployeeClass))
 
#define EMPLOYEE_ID   "id"
 
#define EMPLOYEE_USERNAME   "username"
 
#define EMPLOYEE_NAME   "name"
 
#define EMPLOYEE_ADDR   "addr"
 
#define EMPLOYEE_LANGUAGE   "native language"
 
#define EMPLOYEE_ACL   "acl"
 
#define EMPLOYEE_WORKDAY   "workday"
 
#define EMPLOYEE_RATE   "rate"
 
#define EMPLOYEE_CC   "credit_card_account"
 
#define gncEmployeeGetGUID(E)   qof_entity_get_guid(QOF_INSTANCE(E))
 
#define gncEmployeeGetBook(E)   qof_instance_get_book(QOF_INSTANCE(E))
 
#define gncEmployeeRetGUID(E)   (E ? *(qof_entity_get_guid(QOF_INSTANCE(E))) : *(guid_null()))
 
#define gncEmployeeLookupDirect(G, B)   gncEmployeeLookup((B),&(G))
 

Typedefs

typedef struct _gncEmployee GncEmployee
 
typedef struct _gncEmployeeClass GncEmployeeClass
 

Functions

GType gnc_employee_get_type (void)
 
gboolean gncEmployeeEqual (const GncEmployee *e1, const GncEmployee *e2)
 
gboolean gncEmployeeIsDirty (const GncEmployee *employee)
 

Create/Destroy Functions

GncEmployeegncEmployeeCreate (QofBook *book)
 
void gncEmployeeDestroy (GncEmployee *employee)
 
void gncEmployeeBeginEdit (GncEmployee *employee)
 
void gncEmployeeCommitEdit (GncEmployee *employee)
 
int gncEmployeeCompare (const GncEmployee *a, const GncEmployee *b)
 

Set Functions

void gncEmployeeSetID (GncEmployee *employee, const char *id)
 
void gncEmployeeSetUsername (GncEmployee *employee, const char *username)
 
void gncEmployeeSetName (GncEmployee *employee, const char *name)
 
void gncEmployeeSetLanguage (GncEmployee *employee, const char *language)
 
void gncEmployeeSetAcl (GncEmployee *employee, const char *acl)
 
void gncEmployeeSetWorkday (GncEmployee *employee, gnc_numeric workday)
 
void gncEmployeeSetRate (GncEmployee *employee, gnc_numeric rate)
 
void gncEmployeeSetCurrency (GncEmployee *employee, gnc_commodity *currency)
 
void gncEmployeeSetActive (GncEmployee *employee, gboolean active)
 
void gncEmployeeSetCCard (GncEmployee *employee, Account *ccard_acc)
 
void qofEmployeeSetAddr (GncEmployee *employee, QofInstance *addr_ent)
 

Get Functions

QofBookgncEmployeeGetBook (GncEmployee *employee)
 
const char * gncEmployeeGetID (const GncEmployee *employee)
 
const char * gncEmployeeGetUsername (const GncEmployee *employee)
 
const char * gncEmployeeGetName (const GncEmployee *employee)
 
GncAddressgncEmployeeGetAddr (const GncEmployee *employee)
 
const char * gncEmployeeGetLanguage (const GncEmployee *employee)
 
const char * gncEmployeeGetAcl (const GncEmployee *employee)
 
gnc_numeric gncEmployeeGetWorkday (const GncEmployee *employee)
 
gnc_numeric gncEmployeeGetRate (const GncEmployee *employee)
 
gnc_commoditygncEmployeeGetCurrency (const GncEmployee *employee)
 
gboolean gncEmployeeGetActive (const GncEmployee *employee)
 
AccountgncEmployeeGetCCard (const GncEmployee *employee)
 

Detailed Description

Macro Definition Documentation

#define gncEmployeeGetGUID (   E)    qof_entity_get_guid(QOF_INSTANCE(E))

deprecated routines

Definition at line 131 of file gncEmployee.h.

Function Documentation

gboolean gncEmployeeEqual ( const GncEmployee e1,
const GncEmployee e2 
)

Test support function, used by test-dbi-business-stuff.c

Definition at line 751 of file gncEmployee.c.

752 {
753  if (a == NULL && b == NULL) return TRUE;
754  if (a == NULL || b == NULL ) return FALSE;
755 
756  g_return_val_if_fail(GNC_IS_EMPLOYEE(a), FALSE);
757  g_return_val_if_fail(GNC_IS_EMPLOYEE(b), FALSE);
758 
759  if (g_strcmp0(a->id, b->id) != 0)
760  {
761  PWARN("IDs differ: %s vs %s", a->id, b->id);
762  return FALSE;
763  }
764 
765  if (g_strcmp0(a->username, b->username) != 0)
766  {
767  PWARN("Usernames differ: %s vs %s", a->username, b->username);
768  return FALSE;
769  }
770 
771  if (!gncAddressEqual(a->addr, b->addr))
772  {
773  PWARN("Addresses differ");
774  return FALSE;
775  }
776 
777  if (!gnc_commodity_equal(a->currency, b->currency))
778  {
779  PWARN("Currencies differ");
780  return FALSE;
781  }
782 
783  if (a->active != b->active)
784  {
785  PWARN("Active flags differ");
786  return FALSE;
787  }
788 
789  if (g_strcmp0(a->language, b->language) != 0)
790  {
791  PWARN("Languages differ: %s vs %s", a->language, b->language);
792  return FALSE;
793  }
794 
795  if (g_strcmp0(a->acl, b->acl) != 0)
796  {
797  PWARN("ACLs differ: %s vs %s", a->acl, b->acl);
798  return FALSE;
799  }
800 
801  if (!xaccAccountEqual(a->ccard_acc, b->ccard_acc, TRUE))
802  {
803  PWARN("Accounts differ");
804  return FALSE;
805  }
806 
807  if (!gnc_numeric_equal(a->workday, b->workday))
808  {
809  PWARN("Workdays differ");
810  return FALSE;
811  }
812 
813  if (!gnc_numeric_equal(a->rate, b->rate))
814  {
815  PWARN("Rates differ");
816  return FALSE;
817  }
818 
819  return TRUE;
820 }
gboolean gnc_numeric_equal(gnc_numeric a, gnc_numeric b)
gboolean gnc_commodity_equal(const gnc_commodity *a, const gnc_commodity *b)
#define PWARN(format, args...)
Definition: qoflog.h:243
gboolean xaccAccountEqual(const Account *aa, const Account *ab, gboolean check_guids)
Definition: Account.c:1475
gboolean gncAddressEqual(const GncAddress *a, const GncAddress *b)
Deeply compare two addresses.
Definition: gncAddress.c:579