Пример #1
0
static void
test_bool_fcn (QofBook *book, const char *message,
               void (*set) (GncEmployee *, gboolean),
               gboolean (*get) (const GncEmployee *))
{
    GncEmployee *employee = gncEmployeeCreate (book);
    gboolean num = get_random_boolean ();

    do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
    gncEmployeeBeginEdit (employee);
    set (employee, FALSE);
    set (employee, TRUE);
    set (employee, num);
    /* Employee record should be dirty */
    do_test (gncEmployeeIsDirty (employee), "test dirty later");
    gncEmployeeCommitEdit (employee);
    /* Employee record should be not dirty */
    /* Skip, because will always fail without a backend.
     * It's not possible to load a backend in the engine code
     * without having circular dependencies.
     */
    // do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
    do_test (get (employee) == num, message);
    gncEmployeeSetActive (employee, FALSE);
    count++;
}
Пример #2
0
static void
test_gint_fcn (QofBook *book, const char *message,
               void (*set) (GncEmployee *, gint),
               gint (*get) (GncEmployee *))
{
    GncEmployee *employee = gncEmployeeCreate (book);
    gint num = 17;

    do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
    gncEmployeeBeginEdit (employee);
    set (employee, num);
    do_test (gncEmployeeIsDirty (employee), "test dirty later");
    gncEmployeeCommitEdit (employee);
    do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
    do_test (get (employee) == num, message);
    gncEmployeeSetActive (employee, FALSE);
    count++;
}
Пример #3
0
static void
test_numeric_fcn (QofBook *book, const char *message,
                  void (*set) (GncEmployee *, gnc_numeric),
                  gnc_numeric (*get)(const GncEmployee *))
{
    GncEmployee *employee = gncEmployeeCreate (book);
    gnc_numeric num = gnc_numeric_create (17, 1);

    do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
    gncEmployeeBeginEdit (employee);
    set (employee, num);
    do_test (gncEmployeeIsDirty (employee), "test dirty later");
    gncEmployeeCommitEdit (employee);
    do_test (gncEmployeeIsDirty (employee), "test dirty after commit");
    do_test (gnc_numeric_equal (get (employee), num), message);
    gncEmployeeSetActive (employee, FALSE);
    count++;
}
Пример #4
0
static void
test_string_fcn (QofBook *book, const char *message,
                 void (*set) (GncEmployee *, const char *str),
                 const char * (*get)(const GncEmployee *))
{
    GncEmployee *employee = gncEmployeeCreate (book);
    char const *str = get_random_string ();

    do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
    gncEmployeeBeginEdit (employee);
    set (employee, str);
    do_test (gncEmployeeIsDirty (employee), "test dirty later");
    gncEmployeeCommitEdit (employee);
    do_test (gncEmployeeIsDirty (employee), "test dirty after commit");
    do_test (safe_strcmp (get (employee), str) == 0, message);
    gncEmployeeSetActive (employee, FALSE);
    count++;
}
Пример #5
0
static GncEmployee*
load_single_employee (GncSqlBackend* sql_be, GncSqlRow& row)
{
    const GncGUID* guid;
    GncEmployee* pEmployee;

    g_return_val_if_fail (sql_be != NULL, NULL);

    guid = gnc_sql_load_guid (sql_be, row);
    pEmployee = gncEmployeeLookup (sql_be->book(), guid);
    if (pEmployee == NULL)
    {
        pEmployee = gncEmployeeCreate (sql_be->book());
    }
    gnc_sql_load_object (sql_be, row, GNC_ID_EMPLOYEE, pEmployee, col_table);
    qof_instance_mark_clean (QOF_INSTANCE (pEmployee));

    return pEmployee;
}
Пример #6
0
static void
test_bool_fcn (QofBook *book, const char *message,
               void (*set) (GncEmployee *, gboolean),
               gboolean (*get) (const GncEmployee *))
{
    GncEmployee *employee = gncEmployeeCreate (book);
    gboolean num = get_random_boolean ();

    do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
    gncEmployeeBeginEdit (employee);
    set (employee, FALSE);
    set (employee, TRUE);
    set (employee, num);
    do_test (gncEmployeeIsDirty (employee), "test dirty later");
    gncEmployeeCommitEdit (employee);
    do_test (gncEmployeeIsDirty (employee), "test dirty after commit");
    do_test (get (employee) == num, message);
    gncEmployeeSetActive (employee, FALSE);
    count++;
}
Пример #7
0
static GncEmployee*
dom_tree_to_employee (xmlNodePtr node, QofBook *book)
{
    struct employee_pdata employee_pdata;
    gboolean successful;

    employee_pdata.employee = gncEmployeeCreate(book);
    employee_pdata.book = book;
    gncEmployeeBeginEdit (employee_pdata.employee);

    successful = dom_tree_generic_parse (node, employee_handlers_v2,
                                         &employee_pdata);
    if (successful)
        gncEmployeeCommitEdit (employee_pdata.employee);
    else
    {
        PERR ("failed to parse employee tree");
        gncEmployeeDestroy (employee_pdata.employee);
        employee_pdata.employee = NULL;
    }

    return employee_pdata.employee;
}
Пример #8
0
static void
test_employee (void)
{
    QofBackend *be;
    QofBook *book;
    QofSession *session;
    GncEmployee *employee;

    session = qof_session_new();
    qof_session_begin(session, QOF_STDOUT, FALSE, FALSE);
    book = qof_session_get_book(session);
    /* The book *must* have a backend to pass the test of the 'dirty' flag */
    /* See the README file for details */

    be = qof_book_get_backend (book);

    /* Test creation/destruction */
    {
        do_test (gncEmployeeCreate (NULL) == NULL, "employee create NULL");
        employee = gncEmployeeCreate (book);
        do_test (employee != NULL, "employee create");
        do_test (qof_instance_get_book(QOF_INSTANCE(employee)) == book,
                 "getbook");

        gncEmployeeBeginEdit (employee);
        gncEmployeeDestroy (employee);
        success ("create/destroy");
    }

    /* Test setting/getting routines; does the active flag get set right? */
    {
        GncGUID guid;

        test_string_fcn (book, "Id", gncEmployeeSetID, gncEmployeeGetID);
        test_string_fcn (book, "Username", gncEmployeeSetUsername, gncEmployeeGetUsername);
        test_string_fcn (book, "Language", gncEmployeeSetLanguage, gncEmployeeGetLanguage);
        test_string_fcn (book, "Acl", gncEmployeeSetAcl, gncEmployeeGetAcl);

        test_numeric_fcn (book, "Workday", gncEmployeeSetWorkday, gncEmployeeGetWorkday);
        test_numeric_fcn (book, "Rate", gncEmployeeSetRate, gncEmployeeGetRate);

        test_bool_fcn (book, "Active", gncEmployeeSetActive, gncEmployeeGetActive);

        do_test (gncEmployeeGetAddr (employee) != NULL, "Addr");

        guid_new (&guid);
        employee = gncEmployeeCreate (book);
        count++;
        gncEmployeeSetGUID (employee, &guid);
        do_test (guid_equal (&guid, qof_instance_get_guid(QOF_INSTANCE(employee))), "guid compare");
    }
#if 0
    {
        GList *list;

        list = gncBusinessGetList (book, GNC_EMPLOYEE_MODULE_NAME, TRUE);
        do_test (list != NULL, "getList all");
        do_test (g_list_length (list) == count, "correct length: all");
        g_list_free (list);

        list = gncBusinessGetList (book, GNC_EMPLOYEE_MODULE_NAME, FALSE);
        do_test (list != NULL, "getList active");
        do_test (g_list_length (list) == 1, "correct length: active");
        g_list_free (list);
    }
#endif
    {
        const char *str = get_random_string();
        const char *res;
        GncAddress *addr;

        addr = gncEmployeeGetAddr (employee);
        gncAddressSetName (addr, str);
        res = qof_object_printable (GNC_ID_EMPLOYEE, employee);
        do_test (res != NULL, "Printable NULL?");
        do_test (safe_strcmp (str, res) == 0, "Printable equals");
    }
}
Пример #9
0
static void
load_owner( const GncSqlBackend* be, GncSqlRow* row,
            QofSetterFunc setter, gpointer pObject,
            const GncSqlColumnTableEntry* table_row )
{
    const GValue* val;
    gchar* buf;
    GncOwnerType type;
    GncGUID guid;
    QofBook* book;
    GncOwner owner;
    GncGUID* pGuid = NULL;

    g_return_if_fail( be != NULL );
    g_return_if_fail( row != NULL );
    g_return_if_fail( pObject != NULL );
    g_return_if_fail( table_row != NULL );

    book = be->primary_book;
    buf = g_strdup_printf( "%s_type", table_row->col_name );
    val = gnc_sql_row_get_value_at_col_name( row, buf );
    type = (GncOwnerType)gnc_sql_get_integer_value( val );
    g_free( buf );
    buf = g_strdup_printf( "%s_guid", table_row->col_name );
    val = gnc_sql_row_get_value_at_col_name( row, buf );
    g_free( buf );

    if ( val != NULL && G_VALUE_HOLDS_STRING( val ) && g_value_get_string( val ) != NULL )
    {
        string_to_guid( g_value_get_string( val ), &guid );
        pGuid = &guid;
    }

    switch ( type )
    {
    case GNC_OWNER_CUSTOMER:
    {
        GncCustomer *cust = NULL;

        if ( pGuid != NULL )
        {
            cust = gncCustomerLookup( book, pGuid );
            if ( cust == NULL )
            {
                cust = gncCustomerCreate( book );
                gncCustomerSetGUID( cust, &guid );
            }
        }
        gncOwnerInitCustomer( &owner, cust );
        break;
    }

    case GNC_OWNER_JOB:
    {
        GncJob *job = NULL;

        if ( pGuid != NULL )
        {
            job = gncJobLookup( book, pGuid );
            if ( job == NULL )
            {
                job = gncJobCreate( book );
                gncJobSetGUID( job, &guid );
            }
        }
        gncOwnerInitJob( &owner, job );
        break;
    }

    case GNC_OWNER_VENDOR:
    {
        GncVendor *vendor = NULL;

        if ( pGuid != NULL )
        {
            vendor = gncVendorLookup( book, pGuid );
            if ( vendor == NULL )
            {
                vendor = gncVendorCreate( book );
                gncVendorSetGUID( vendor, &guid );
            }
        }
        gncOwnerInitVendor( &owner, vendor );
        break;
    }

    case GNC_OWNER_EMPLOYEE:
    {
        GncEmployee *employee = NULL;

        if ( pGuid != NULL )
        {
            employee = gncEmployeeLookup( book, pGuid );
            if ( employee == NULL )
            {
                employee = gncEmployeeCreate( book );
                gncEmployeeSetGUID( employee, &guid );
            }
        }
        gncOwnerInitEmployee( &owner, employee );
        break;
    }

    default:
        PWARN("Invalid owner type: %d\n", type );
    }

    if ( table_row->gobj_param_name != NULL )
    {
        g_object_set( pObject, table_row->gobj_param_name, &owner, NULL );
    }
    else
    {
        (*setter)( pObject, &owner );
    }
}
Пример #10
0
static gboolean
owner_id_handler (xmlNodePtr node, gpointer owner_pdata)
{
    struct owner_pdata* pdata = static_cast<decltype (pdata)> (owner_pdata);
    GncGUID* guid;

    guid = dom_tree_to_guid (node);
    g_return_val_if_fail (guid, FALSE);

    switch (gncOwnerGetType (pdata->owner))
    {
    case GNC_OWNER_CUSTOMER:
    {
        GncCustomer* cust = gncCustomerLookup (pdata->book, guid);
        if (!cust)
        {
            cust = gncCustomerCreate (pdata->book);
            gncCustomerSetGUID (cust, guid);
        }
        gncOwnerInitCustomer (pdata->owner, cust);
        break;
    }
    case GNC_OWNER_JOB:
    {
        GncJob* job = gncJobLookup (pdata->book, guid);
        if (!job)
        {
            job = gncJobCreate (pdata->book);
            gncJobSetGUID (job, guid);
        }
        gncOwnerInitJob (pdata->owner, job);
        break;
    }
    case GNC_OWNER_VENDOR:
    {
        GncVendor* vendor = gncVendorLookup (pdata->book, guid);
        if (!vendor)
        {
            vendor = gncVendorCreate (pdata->book);
            gncVendorSetGUID (vendor, guid);
        }
        gncOwnerInitVendor (pdata->owner, vendor);
        break;
    }
    case GNC_OWNER_EMPLOYEE:
    {
        GncEmployee* employee = gncEmployeeLookup (pdata->book, guid);
        if (!employee)
        {
            employee = gncEmployeeCreate (pdata->book);
            gncEmployeeSetGUID (employee, guid);
        }
        gncOwnerInitEmployee (pdata->owner, employee);
        break;
    }
    default:
        PWARN ("Invalid owner type: %d\n", gncOwnerGetType (pdata->owner));
        g_free (guid);
        return FALSE;
    }

    g_free (guid);
    return TRUE;
}
Пример #11
0
static void
test_employee (void)
{
    QofBook *book;
    GncEmployee *employee;

    book = qof_book_new();

    /* Test creation/destruction */
    {
        do_test (gncEmployeeCreate (NULL) == NULL, "employee create NULL");
        employee = gncEmployeeCreate (book);
        do_test (employee != NULL, "employee create");
        do_test (qof_instance_get_book(QOF_INSTANCE(employee)) == book,
                 "getbook");

        gncEmployeeBeginEdit (employee);
        gncEmployeeDestroy (employee);
        success ("create/destroy");
    }

    /* Test setting/getting routines; does the active flag get set right? */
    {
        GncGUID guid;

        test_string_fcn (book, "Id", gncEmployeeSetID, gncEmployeeGetID);
        test_string_fcn (book, "Username", gncEmployeeSetUsername, gncEmployeeGetUsername);
        test_string_fcn (book, "Language", gncEmployeeSetLanguage, gncEmployeeGetLanguage);
        test_string_fcn (book, "Acl", gncEmployeeSetAcl, gncEmployeeGetAcl);

        test_numeric_fcn (book, "Workday", gncEmployeeSetWorkday, gncEmployeeGetWorkday);
        test_numeric_fcn (book, "Rate", gncEmployeeSetRate, gncEmployeeGetRate);

        test_bool_fcn (book, "Active", gncEmployeeSetActive, gncEmployeeGetActive);

        do_test (gncEmployeeGetAddr (employee) != NULL, "Addr");

        guid_replace (&guid);
        employee = gncEmployeeCreate (book);
        count++;
        gncEmployeeSetGUID (employee, &guid);
        do_test (guid_equal (&guid, qof_instance_get_guid(QOF_INSTANCE(employee))), "guid compare");
    }
    {
        GList *list;

        list = gncBusinessGetList (book, GNC_EMPLOYEE_MODULE_NAME, TRUE);
        do_test (list != NULL, "getList all");
        do_test (g_list_length (list) == count, "correct length: all");
        g_list_free (list);

        list = gncBusinessGetList (book, GNC_EMPLOYEE_MODULE_NAME, FALSE);
        do_test (list != NULL, "getList active");
        do_test (g_list_length (list) == 1, "correct length: active");
        g_list_free (list);
    }
    {
        const char *str = get_random_string();
        const char *res;
        GncAddress *addr;

        addr = gncEmployeeGetAddr (employee);
        gncAddressSetName (addr, str);
        res = qof_object_printable (GNC_ID_EMPLOYEE, employee);
        do_test (res != NULL, "Printable NULL?");
        do_test (g_strcmp0 (str, res) == 0, "Printable equals");
    }

    qof_book_destroy (book);
}
Пример #12
0
static EmployeeWindow *
gnc_employee_new_window (QofBook *bookp,
                         GncEmployee *employee)
{
    EmployeeWindow *ew;
    GtkBuilder *builder;
    GtkWidget *hbox, *edit;
    gnc_commodity *currency;
    GNCPrintAmountInfo print_info;
    GList *acct_types;
    Account *ccard_acct;

    /*
     * Find an existing window for this employee.  If found, bring it to
     * the front.
     */
    if (employee)
    {
        GncGUID employee_guid;

        employee_guid = *gncEmployeeGetGUID (employee);
        ew = gnc_find_first_gui_component (DIALOG_EDIT_EMPLOYEE_CM_CLASS,
                                           find_handler, &employee_guid);
        if (ew)
        {
            gtk_window_present (GTK_WINDOW(ew->dialog));
            return(ew);
        }
    }

    /* Find the default currency */
    if (employee)
        currency = gncEmployeeGetCurrency (employee);
    else
        currency = gnc_default_currency ();

    /*
     * No existing employee window found.  Build a new one.
     */
    ew = g_new0 (EmployeeWindow, 1);

    ew->book = bookp;

    /* Find the dialog */
    builder = gtk_builder_new();
    gnc_builder_add_from_file (builder, "dialog-employee.glade", "Employee Dialog");
    ew->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Employee Dialog"));

    g_object_set_data (G_OBJECT (ew->dialog), "dialog_info", ew);

    /* Get entry points */
    ew->id_entry = GTK_WIDGET(gtk_builder_get_object (builder, "id_entry"));
    ew->username_entry = GTK_WIDGET(gtk_builder_get_object (builder, "username_entry"));

    ew->name_entry = GTK_WIDGET(gtk_builder_get_object (builder, "name_entry"));
    ew->addr1_entry = GTK_WIDGET(gtk_builder_get_object (builder, "addr1_entry"));
    ew->addr2_entry = GTK_WIDGET(gtk_builder_get_object (builder, "addr2_entry"));
    ew->addr3_entry = GTK_WIDGET(gtk_builder_get_object (builder, "addr3_entry"));
    ew->addr4_entry = GTK_WIDGET(gtk_builder_get_object (builder, "addr4_entry"));
    ew->phone_entry = GTK_WIDGET(gtk_builder_get_object (builder, "phone_entry"));
    ew->fax_entry = GTK_WIDGET(gtk_builder_get_object (builder, "fax_entry"));
    ew->email_entry = GTK_WIDGET(gtk_builder_get_object (builder, "email_entry"));

    ew->language_entry = GTK_WIDGET(gtk_builder_get_object (builder, "language_entry"));
    ew->active_check = GTK_WIDGET(gtk_builder_get_object (builder, "active_check"));

    /* Currency */
    edit = gnc_currency_edit_new();
    gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT(edit), currency);
    ew->currency_edit = edit;

    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "currency_box"));
    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);

    /* WORKDAY: Value */
    edit = gnc_amount_edit_new();
    gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (edit), TRUE);
    print_info = gnc_integral_print_info ();
    print_info.max_decimal_places = 5;
    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (edit), print_info);
    gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (edit), 100000);
    ew->workday_amount = edit;
    gtk_widget_show (edit);

    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "hours_hbox"));
    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);

    /* RATE: Monetary Value */
    edit = gnc_amount_edit_new();
    print_info = gnc_commodity_print_info (currency, FALSE);
    gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (edit), TRUE);
    gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (edit), print_info);
    gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (edit),
                                  gnc_commodity_get_fraction (currency));
    ew->rate_amount = edit;
    gtk_widget_show (edit);

    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "rate_hbox"));
    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);

    /* CCard Account Selection */
    ew->ccard_acct_check = GTK_WIDGET(gtk_builder_get_object (builder, "ccard_check"));

    edit = gnc_account_sel_new();
    acct_types = g_list_prepend(NULL, (gpointer)ACCT_TYPE_CREDIT);
    gnc_account_sel_set_acct_filters (GNC_ACCOUNT_SEL(edit), acct_types, NULL);
    g_list_free (acct_types);

    ew->ccard_acct_sel = edit;
    gtk_widget_show (edit);

    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "ccard_acct_hbox"));
    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);

    /* Setup signals */
    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, ew);

    /* Setup initial values */
    if (employee != NULL)
    {
        GncAddress *addr;

        ew->dialog_type = EDIT_EMPLOYEE;
        ew->employee_guid = *gncEmployeeGetGUID (employee);

        addr = gncEmployeeGetAddr (employee);

        gtk_entry_set_text (GTK_ENTRY (ew->id_entry), gncEmployeeGetID (employee));
        gtk_entry_set_text (GTK_ENTRY (ew->username_entry), gncEmployeeGetUsername (employee));

        /* Setup Address */
        gtk_entry_set_text (GTK_ENTRY (ew->name_entry), gncAddressGetName (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->addr1_entry), gncAddressGetAddr1 (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->addr2_entry), gncAddressGetAddr2 (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->addr3_entry), gncAddressGetAddr3 (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->addr4_entry), gncAddressGetAddr4 (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->phone_entry), gncAddressGetPhone (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->fax_entry), gncAddressGetFax (addr));
        gtk_entry_set_text (GTK_ENTRY (ew->email_entry), gncAddressGetEmail (addr));

        gtk_entry_set_text (GTK_ENTRY (ew->language_entry),
                            gncEmployeeGetLanguage (employee));

        /* Set toggle buttons */
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ew->active_check),
                                      gncEmployeeGetActive (employee));

        ew->component_id =
            gnc_register_gui_component (DIALOG_EDIT_EMPLOYEE_CM_CLASS,
                                        gnc_employee_window_refresh_handler,
                                        gnc_employee_window_close_handler,
                                        ew);
    }
    else
    {
        employee = gncEmployeeCreate (bookp);
        ew->employee_guid = *gncEmployeeGetGUID (employee);

        ew->dialog_type = NEW_EMPLOYEE;
        ew->component_id =
            gnc_register_gui_component (DIALOG_NEW_EMPLOYEE_CM_CLASS,
                                        gnc_employee_window_refresh_handler,
                                        gnc_employee_window_close_handler,
                                        ew);
    }


    /* I know that employee exists here -- either passed in or just created */
    /* Set the workday and rate values */
    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (ew->workday_amount),
                                gncEmployeeGetWorkday (employee));
    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (ew->rate_amount),
                                gncEmployeeGetRate (employee));


    ccard_acct = gncEmployeeGetCCard (employee);
    if (ccard_acct == NULL)
    {
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ew->ccard_acct_check), FALSE);
        gtk_widget_set_sensitive (ew->ccard_acct_sel, FALSE);
    }
    else
    {
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ew->ccard_acct_check), TRUE);
        gnc_account_sel_set_account (GNC_ACCOUNT_SEL (ew->ccard_acct_sel), ccard_acct, FALSE);
    }

    /* XXX: Set the ACL */

    gnc_gui_component_watch_entity_type (ew->component_id,
                                         GNC_EMPLOYEE_MODULE_NAME,
                                         QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);

    gtk_widget_show_all (ew->dialog);

    if (ccard_acct == NULL)
        gtk_widget_hide (ew->ccard_acct_sel);

    g_object_unref(G_OBJECT(builder));

    return ew;
}