GnuCash 2.3.0
Files | Defines | Typedefs | Functions
Employee
Business

Files

file  gncEmployee.h
 

Employee Interface.


Defines

#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_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 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)
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)

Define Documentation

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

deprecated routines

Definition at line 118 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 656 of file gncEmployee.c.

{
    if (a == NULL && b == NULL) return TRUE;
    if (a == NULL || b == NULL ) return FALSE;

    g_return_val_if_fail(GNC_IS_EMPLOYEE(a), FALSE);
    g_return_val_if_fail(GNC_IS_EMPLOYEE(b), FALSE);

    if (safe_strcmp(a->id, b->id) != 0)
    {
        PWARN("IDs differ: %s vs %s", a->id, b->id);
        return FALSE;
    }

    if (safe_strcmp(a->username, b->username) != 0)
    {
        PWARN("Usernames differ: %s vs %s", a->username, b->username);
        return FALSE;
    }

    if (!gncAddressEqual(a->addr, b->addr))
    {
        PWARN("Addresses differ");
        return FALSE;
    }

    if (!gnc_commodity_equal(a->currency, b->currency))
    {
        PWARN("Currencies differ");
        return FALSE;
    }

    if (a->active != b->active)
    {
        PWARN("Active flags differ");
        return FALSE;
    }

    if (safe_strcmp(a->language, b->language) != 0)
    {
        PWARN("Languages differ: %s vs %s", a->language, b->language);
        return FALSE;
    }

    if (safe_strcmp(a->acl, b->acl) != 0)
    {
        PWARN("ACLs differ: %s vs %s", a->acl, b->acl);
        return FALSE;
    }

    if (!xaccAccountEqual(a->ccard_acc, b->ccard_acc, TRUE))
    {
        PWARN("Accounts differ");
        return FALSE;
    }

    if (!gnc_numeric_equal(a->workday, b->workday))
    {
        PWARN("Workdays differ");
        return FALSE;
    }

    if (!gnc_numeric_equal(a->rate, b->rate))
    {
        PWARN("Rates differ");
        return FALSE;
    }

    return TRUE;
}
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines