"Fossies" - the Fresh Open Source Software Archive

Member "gnucash-3.7/gnucash/register/ledger-core/gncEntryLedgerLoad.c" (7 Sep 2019, 19387 Bytes) of package /linux/misc/gnucash-3.7.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gncEntryLedgerLoad.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.6_vs_3.7.

    1 /*
    2  * gncEntryLedgerLoad.c -- a Ledger widget for entering GncEntry objects
    3  * Copyright (C) 2001, 2002, 2003 Derek Atkins
    4  * Author: Derek Atkins <warlord@MIT.EDU>
    5  *
    6  * This program is free software; you can redistribute it and/or
    7  * modify it under the terms of the GNU General Public License as
    8  * published by the Free Software Foundation; either version 2 of
    9  * the License, or (at your option) any later version.
   10  *
   11  * This program is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  * GNU General Public License for more details.
   15  *
   16  * You should have received a copy of the GNU General Public License
   17  * along with this program; if not, contact:
   18  *
   19  * Free Software Foundation           Voice:  +1-617-542-5942
   20  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
   21  * Boston, MA  02110-1301,  USA       gnu@gnu.org
   22  */
   23 
   24 #include <config.h>
   25 
   26 #include <glib.h>
   27 #include <glib/gi18n.h>
   28 
   29 #include "Account.h"
   30 #include "account-quickfill.h"
   31 #include "combocell.h"
   32 #include "gnc-component-manager.h"
   33 #include "gnc-prefs.h"
   34 #include "gnc-ui-util.h"
   35 #include "recncell.h"
   36 
   37 #include "gncEntry.h"
   38 #include "gncEntryLedger.h"
   39 #include "gncEntryLedgerP.h"
   40 #include "quickfillcell.h"
   41 #include "gnc-entry-quickfill.h"
   42 
   43 #define GNC_PREF_TAX_INCL "tax-included"
   44 
   45 static const QofLogModule log_module = "Business Entry Ledger";
   46 
   47 /* XXX: This should go elsewhere */
   48 const char * gnc_entry_ledger_type_string_getter (char flag)
   49 {
   50     switch (flag)
   51     {
   52     case '1':
   53         return _("$");
   54     case '2':
   55         return _("%");
   56     default:
   57         break;
   58     };
   59     return "?";
   60 }
   61 
   62 const char * gnc_entry_ledger_how_string_getter (char flag)
   63 {
   64     switch (flag)
   65     {
   66     case '1':
   67         return _("<");
   68     case '2':
   69         return _("=");
   70     case '3':
   71         return _(">");
   72     default:
   73         break;
   74     };
   75         return "?";
   76 }
   77 
   78 static void load_discount_type_cells (GncEntryLedger *ledger)
   79 {
   80     RecnCell *cell;
   81 
   82     if (!ledger) return;
   83 
   84     cell = (RecnCell *)
   85            gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DISTYPE_CELL);
   86 
   87     if (!cell) return;
   88 
   89     gnc_recn_cell_set_valid_flags (cell, "12", '2');
   90     gnc_recn_cell_set_flag_order (cell, "21");
   91     gnc_recn_cell_set_string_getter (cell, gnc_entry_ledger_type_string_getter);
   92 }
   93 
   94 static void load_discount_how_cells (GncEntryLedger *ledger)
   95 {
   96     RecnCell *cell;
   97 
   98     if (!ledger) return;
   99 
  100     cell = (RecnCell *)
  101            gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DISHOW_CELL);
  102 
  103     if (!cell) return;
  104 
  105     gnc_recn_cell_set_valid_flags (cell, "123", '1');
  106     gnc_recn_cell_set_flag_order (cell, "123");
  107     gnc_recn_cell_set_string_getter (cell, gnc_entry_ledger_how_string_getter);
  108 }
  109 
  110 static void load_payment_type_cells (GncEntryLedger *ledger)
  111 {
  112     ComboCell *cell;
  113     const GncOwner *owner;
  114     GncEmployee *employee;
  115 
  116     cell = (ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
  117             ENTRY_PAYMENT_CELL);
  118     if (!cell) return;
  119 
  120     if (!ledger->invoice) return;
  121 
  122     owner = gncOwnerGetEndOwner (gncInvoiceGetOwner (ledger->invoice));
  123     if (gncOwnerGetType (owner) != GNC_OWNER_EMPLOYEE)
  124         return;
  125 
  126     employee = gncOwnerGetEmployee (owner);
  127     g_return_if_fail (employee);
  128 
  129     gnc_combo_cell_clear_menu (cell);
  130     gnc_combo_cell_add_menu_item (cell, _("Cash"));
  131 
  132     if (gncEmployeeGetCCard (employee))
  133         gnc_combo_cell_add_menu_item (cell, _("Charge"));
  134 }
  135 
  136 /* ==================================================================== */
  137 /* Return TRUE if we don't want to add this account to the xfer menu */
  138 
  139 static gboolean
  140 skip_expense_acct_cb (Account *account, gpointer user_data)
  141 {
  142     GNCAccountType type;
  143 
  144     /* Don't add A/R, A/P, Bank, Cash, or Equity accounts */
  145     type = xaccAccountGetType (account);
  146     if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE ||
  147             type == ACCT_TYPE_CASH || type == ACCT_TYPE_BANK ||
  148             type == ACCT_TYPE_EQUITY || type == ACCT_TYPE_TRADING)
  149     {
  150         return TRUE;
  151     }
  152 
  153     /* If this is an ORDER or INVOICE, then leave out the expenses.  */
  154     if (type == ACCT_TYPE_EXPENSE) return TRUE;
  155 
  156     /* Don't add placeholder accounts */
  157     if (xaccAccountGetPlaceholder (account)) return TRUE;
  158 
  159     return FALSE;
  160 }
  161 
  162 static gboolean
  163 skip_income_acct_cb (Account *account, gpointer user_data)
  164 {
  165     GNCAccountType type;
  166 
  167     /* Don't add A/R, A/P, Bank, Cash, or Equity accounts */
  168     type = xaccAccountGetType (account);
  169     if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE ||
  170             type == ACCT_TYPE_CASH || type == ACCT_TYPE_BANK ||
  171             type == ACCT_TYPE_EQUITY || type == ACCT_TYPE_TRADING)
  172     {
  173         return TRUE;
  174     }
  175 
  176     /* If this is a BILL, then leave out the incomes */
  177     if (type == ACCT_TYPE_INCOME) return TRUE;
  178 
  179     /* Don't add placeholder accounts */
  180     if (xaccAccountGetPlaceholder (account)) return TRUE;
  181 
  182     return FALSE;
  183 }
  184 
  185 /* ===================================================================== */
  186 /* Splat the account name into the transfer cell combobox menu */
  187 
  188 #define EKEY "Expense Business entry quickfill"
  189 #define IKEY "Income Business entry quickfill"
  190 
  191 static void
  192 load_xfer_type_cells (GncEntryLedger *ledger)
  193 {
  194     Account *root;
  195     ComboCell *cell;
  196     QuickFill *qf = NULL;
  197     GtkListStore *store = NULL;
  198 
  199     root = gnc_book_get_root_account (ledger->book);
  200     if (root == NULL) return;
  201 
  202     /* Use a common, shared quickfill.  For the ORDER or INVOICE,
  203      * ledgers, we don't want expense-type accounts in the menu.
  204      * For BILL, etc. then leave out the income types.
  205      */
  206     switch (ledger->type)
  207     {
  208     case GNCENTRY_ORDER_ENTRY:
  209     case GNCENTRY_ORDER_VIEWER:
  210     case GNCENTRY_INVOICE_ENTRY:
  211     case GNCENTRY_INVOICE_VIEWER:
  212     case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
  213     case GNCENTRY_CUST_CREDIT_NOTE_VIEWER:
  214         qf = gnc_get_shared_account_name_quickfill (root, IKEY,
  215                 skip_expense_acct_cb, NULL);
  216         store = gnc_get_shared_account_name_list_store (root, IKEY,
  217                 skip_expense_acct_cb, NULL);
  218         break;
  219 
  220     case GNCENTRY_BILL_ENTRY:
  221     case GNCENTRY_BILL_VIEWER:
  222     case GNCENTRY_EXPVOUCHER_ENTRY:
  223     case GNCENTRY_EXPVOUCHER_VIEWER:
  224     case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
  225     case GNCENTRY_VEND_CREDIT_NOTE_VIEWER:
  226     case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
  227     case GNCENTRY_EMPL_CREDIT_NOTE_VIEWER:
  228     case GNCENTRY_NUM_REGISTER_TYPES:
  229         qf = gnc_get_shared_account_name_quickfill (root, EKEY,
  230                 skip_income_acct_cb, NULL);
  231         store = gnc_get_shared_account_name_list_store (root, EKEY,
  232                 skip_income_acct_cb, NULL);
  233         break;
  234     default:
  235     PWARN ("Bad GncEntryLedgerType");
  236     break;
  237     }
  238 
  239     cell = (ComboCell *)
  240            gnc_table_layout_get_cell (ledger->table->layout, ENTRY_IACCT_CELL);
  241     gnc_combo_cell_use_quickfill_cache (cell, qf);
  242     gnc_combo_cell_use_list_store_cache (cell, store);
  243 
  244     cell = (ComboCell *)
  245            gnc_table_layout_get_cell (ledger->table->layout, ENTRY_BACCT_CELL);
  246     gnc_combo_cell_use_quickfill_cache (cell, qf);
  247     gnc_combo_cell_use_list_store_cache (cell, store);
  248 }
  249 
  250 /* ===================================================================== */
  251 
  252 static void load_taxtable_type_cells (GncEntryLedger *ledger)
  253 {
  254     GList *list;
  255     ComboCell *cell;
  256 
  257     cell = (ComboCell *)
  258            gnc_table_layout_get_cell (ledger->table->layout, ENTRY_TAXTABLE_CELL);
  259     gnc_combo_cell_clear_menu (cell);
  260 
  261     list = gncTaxTableGetTables (ledger->book);
  262     for ( ; list ; list = list->next )
  263     {
  264         GncTaxTable *table = list->data;
  265         const char *name = gncTaxTableGetName (table);
  266         if (name != NULL)
  267             gnc_combo_cell_add_menu_item (cell, (char*)name);
  268     }
  269 }
  270 
  271 static void
  272 gnc_entry_ledger_show_entry (GncEntryLedger *ledger,
  273                              VirtualCellLocation start_loc)
  274 {
  275     VirtualCellLocation end_loc;
  276     int v_row;
  277 
  278     end_loc = start_loc;
  279     v_row = end_loc.virt_row + 1;
  280     end_loc.virt_row = MIN (v_row, ledger->table->num_virt_rows - 1);
  281 
  282     gnc_table_show_range (ledger->table, start_loc, end_loc);
  283 }
  284 
  285 #define DESC_QF_KEY_INVOICES "ENTRY_DESC_CELL_QF_INVOICES"
  286 #define DESC_QF_KEY_BILLS "ENTRY_DESC_CELL_QF_BILLS"
  287 
  288 static void
  289 load_description_cell (GncEntryLedger *ledger)
  290 {
  291     QuickFill *shared_quickfill;
  292     QuickFillCell *cell;
  293 
  294     switch (ledger->type)
  295     {
  296     case GNCENTRY_INVOICE_ENTRY:
  297     case GNCENTRY_INVOICE_VIEWER:
  298     case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
  299     case GNCENTRY_CUST_CREDIT_NOTE_VIEWER:
  300         shared_quickfill = gnc_get_shared_entry_desc_quickfill(ledger->book, DESC_QF_KEY_INVOICES, TRUE);
  301         break;
  302     default:
  303         shared_quickfill = gnc_get_shared_entry_desc_quickfill(ledger->book, DESC_QF_KEY_BILLS, FALSE);
  304         break;
  305     };
  306 
  307     cell = (QuickFillCell *)
  308            gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DESC_CELL);
  309     gnc_quickfill_cell_use_quickfill_cache (cell, shared_quickfill);
  310 }
  311 
  312 void gnc_entry_ledger_load_xfer_cells (GncEntryLedger *ledger)
  313 {
  314     load_xfer_type_cells (ledger);
  315     load_taxtable_type_cells (ledger);
  316     load_payment_type_cells (ledger);
  317     load_description_cell (ledger);
  318 }
  319 
  320 /* XXX (FIXME): This should be in a config file! */
  321 /* Copy GncEntry information from the list to the rows of the Ledger. */
  322 /* XXX This code is a cut-n-paste job from the SplitRegister code;
  323  * the split-register should be generalized to the point where a cut-n-paste
  324  * like this isn't required, and this should be trashed.
  325  */
  326 void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list)
  327 {
  328     GncEntry *blank_entry, *find_entry;
  329     CursorBuffer *cursor_buffer;
  330     Table *table;
  331 
  332     GList *node;
  333     CellBlock *cursor_header, *cursor;
  334     VirtualCellLocation vcell_loc;
  335     VirtualLocation save_loc;
  336     gboolean start_primary_color = TRUE;
  337 
  338     int new_entry_row = -1;
  339 
  340     if (!ledger) return;
  341 
  342     /* Load up cells */
  343     load_discount_type_cells (ledger);
  344     load_discount_how_cells (ledger);
  345     gnc_entry_ledger_load_xfer_cells (ledger);
  346 
  347     blank_entry = gnc_entry_ledger_get_blank_entry (ledger);
  348 
  349     if (blank_entry == NULL && ledger->invoice == NULL && entry_list == NULL)
  350         return;
  351 
  352     if (blank_entry == NULL && ledger->invoice)
  353     {
  354         switch (ledger->type)
  355         {
  356         case GNCENTRY_ORDER_ENTRY:
  357         case GNCENTRY_INVOICE_ENTRY:
  358         case GNCENTRY_BILL_ENTRY:
  359         case GNCENTRY_EXPVOUCHER_ENTRY:
  360         case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
  361         case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
  362         case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
  363 
  364             gnc_suspend_gui_refresh ();
  365 
  366             blank_entry = gncEntryCreate (ledger->book);
  367             gncEntrySetDateGDate (blank_entry, &ledger->last_date_entered);
  368             ledger->blank_entry_guid = *gncEntryGetGUID (blank_entry);
  369 
  370             gnc_resume_gui_refresh ();
  371 
  372             /* The rest of this does not apply to expense vouchers */
  373             if (ledger->type != GNCENTRY_EXPVOUCHER_ENTRY)
  374             {
  375                 const GncOwner *owner = gncOwnerGetEndOwner (gncInvoiceGetOwner (ledger->invoice));
  376                 GncTaxTable *table = NULL;
  377                 GncTaxIncluded taxincluded_p = GNC_TAXINCLUDED_USEGLOBAL;
  378                 gboolean taxincluded = FALSE;
  379                 gnc_numeric discount = gnc_numeric_zero ();
  380                 gnc_numeric price = gnc_numeric_zero ();
  381 
  382                 /* Determine the Price from Customer's or Vendor's Job */
  383                 switch (gncOwnerGetType (gncInvoiceGetOwner (ledger->invoice)))
  384                 {
  385                 case GNC_OWNER_JOB:
  386                     price = gncJobGetRate( gncOwnerGetJob (gncInvoiceGetOwner (ledger->invoice)));
  387                     break;
  388                 default:
  389                     break;
  390                 }
  391 
  392                 /* Determine the TaxIncluded and Discount values */
  393                 switch (gncOwnerGetType (owner))
  394                 {
  395                 case GNC_OWNER_CUSTOMER:
  396                     taxincluded_p = gncCustomerGetTaxIncluded (owner->owner.customer);
  397                     discount = gncCustomerGetDiscount (owner->owner.customer);
  398                     break;
  399                 case GNC_OWNER_VENDOR:
  400                     taxincluded_p = gncVendorGetTaxIncluded (owner->owner.vendor);
  401                     break;
  402                 default:
  403                     break;
  404                 }
  405 
  406                 /* Compute the default taxincluded */
  407                 switch (taxincluded_p)
  408                 {
  409                 case GNC_TAXINCLUDED_YES:
  410                     taxincluded = TRUE;
  411                     break;
  412                 case GNC_TAXINCLUDED_NO:
  413                     taxincluded = FALSE;
  414                     break;
  415                 case GNC_TAXINCLUDED_USEGLOBAL:
  416                     if (ledger->prefs_group)
  417                     {
  418                         taxincluded = gnc_prefs_get_bool (ledger->prefs_group, GNC_PREF_TAX_INCL);
  419                     }
  420                     else
  421                     {
  422                         taxincluded = FALSE;
  423                     }
  424                     break;
  425                 }
  426 
  427                 /* Compute the proper taxtable */
  428                 switch (gncOwnerGetType (owner))
  429                 {
  430                 case GNC_OWNER_CUSTOMER:
  431                     table = gncTaxTableGetDefault (ledger->book,
  432                                                    GNC_OWNER_CUSTOMER);
  433 
  434                     if (gncCustomerGetTaxTableOverride (owner->owner.customer))
  435                         table = gncCustomerGetTaxTable (owner->owner.customer);
  436                     break;
  437 
  438                 case GNC_OWNER_VENDOR:
  439                     table = gncTaxTableGetDefault (ledger->book,
  440                                                    GNC_OWNER_VENDOR);
  441 
  442                     if (gncVendorGetTaxTableOverride (owner->owner.vendor))
  443                         table = gncVendorGetTaxTable (owner->owner.vendor);
  444                     break;
  445 
  446                 default:
  447                     break;
  448                 }
  449 
  450                 if (ledger->is_cust_doc)
  451                 {
  452                     gncEntrySetInvTaxable (blank_entry, table != NULL);
  453                     gncEntrySetInvTaxTable (blank_entry, table);
  454                     gncEntrySetInvTaxIncluded (blank_entry, taxincluded);
  455                     gncEntrySetInvDiscount (blank_entry, discount);
  456                     gncEntrySetInvPrice (blank_entry, price);
  457                 }
  458                 else
  459                 {
  460                     gncEntrySetBillTaxable (blank_entry, table != NULL);
  461                     gncEntrySetBillTaxTable (blank_entry, table);
  462                     gncEntrySetBillTaxIncluded (blank_entry, taxincluded);
  463                     gncEntrySetBillPrice (blank_entry, price);
  464                 }
  465             }
  466 
  467             break;
  468         default:
  469             ledger->blank_entry_guid = *guid_null ();
  470             break;
  471         }
  472         ledger->blank_entry_edited = FALSE;
  473     }
  474 
  475     table = ledger->table;
  476 
  477     gnc_table_leave_update (table, table->current_cursor_loc);
  478     save_loc = table->current_cursor_loc;
  479 
  480     /* Figure out where we are going to */
  481     if (ledger->traverse_to_new)
  482     {
  483         find_entry = blank_entry;
  484     }
  485     else if (ledger->hint_entry)
  486     {
  487         find_entry = ledger->hint_entry;
  488     }
  489     else
  490     {
  491         find_entry = gnc_entry_ledger_get_current_entry(ledger);
  492         /* XXX: get current entry (cursor_hint_xxx) */
  493     }
  494 
  495     /* If the current cursor has changed we save the values for later
  496      * possible restoration. */
  497     if (gnc_table_current_cursor_changed (table, TRUE) &&
  498             (find_entry == gnc_entry_ledger_get_current_entry (ledger)))
  499     {
  500         cursor_buffer = gnc_cursor_buffer_new ();
  501         gnc_table_save_current_cursor (table, cursor_buffer);
  502     }
  503     else
  504         cursor_buffer = NULL;
  505 
  506     /* disable move callback -- we don't want the cascade of
  507      * callbacks while we are fiddling with loading the register */
  508     gnc_table_control_allow_move (table->control, FALSE);
  509 
  510     /* invalidate the cursor */
  511     {
  512         VirtualLocation virt_loc;
  513 
  514         virt_loc.vcell_loc.virt_row = -1;
  515         virt_loc.vcell_loc.virt_col = -1;
  516         virt_loc.phys_row_offset = -1;
  517         virt_loc.phys_col_offset = -1;
  518 
  519         gnc_table_move_cursor_gui (table, virt_loc);
  520     }
  521 
  522     /* make sure that the header is loaded */
  523     vcell_loc.virt_row = 0;
  524     vcell_loc.virt_col = 0;
  525     cursor_header = gnc_table_layout_get_cursor (table->layout, CURSOR_HEADER);
  526     gnc_table_set_vcell (table, cursor_header, NULL, TRUE, TRUE, vcell_loc);
  527     vcell_loc.virt_row++;
  528 
  529     /* get the current time and reset the dividing row */
  530     table->model->dividing_row_upper = -1;
  531     table->model->dividing_row = -1;
  532     table->model->dividing_row_lower = -1;
  533     cursor = gnc_table_layout_get_cursor (table->layout, "cursor");
  534 
  535     /* Populate the table */
  536     for (node = entry_list; node; node = node->next)
  537     {
  538         GncEntry *entry = node->data;
  539 
  540         /* Don't load the blank entry */
  541         if (entry == blank_entry)
  542             continue;
  543 
  544         /* If this is the first load of the ledger, fill the quickfill cells */
  545         {
  546             /* XXX */
  547         }
  548 
  549         if (entry == find_entry)
  550             new_entry_row = vcell_loc.virt_row;
  551 
  552         gnc_table_set_vcell (table, cursor, gncEntryGetGUID (entry),
  553                              TRUE, start_primary_color, vcell_loc);
  554         vcell_loc.virt_row++;
  555 
  556         /* Flip color for the next guy */
  557         start_primary_color = !start_primary_color;
  558     }
  559 
  560     /* Add the blank entry at the end. */
  561     if (blank_entry)
  562     {
  563         gnc_table_set_vcell (table, cursor, gncEntryGetGUID (blank_entry),
  564                              TRUE, start_primary_color, vcell_loc);
  565 
  566         if (find_entry == blank_entry)
  567             new_entry_row = vcell_loc.virt_row;
  568 
  569         vcell_loc.virt_row++;
  570     }
  571 
  572     /* Resize the table */
  573     gnc_table_set_size (table, vcell_loc.virt_row, 1);
  574 
  575     /* Restore the cursor to its rightful position */
  576     if (new_entry_row > 0)
  577         save_loc.vcell_loc.virt_row = new_entry_row;
  578 
  579     if (gnc_table_find_close_valid_cell (table, &save_loc, FALSE))
  580     {
  581         gnc_table_move_cursor_gui (table, save_loc);
  582 
  583         if (find_entry == gnc_entry_ledger_get_current_entry (ledger))
  584             gnc_table_restore_current_cursor (table, cursor_buffer);
  585     }
  586 
  587     gnc_cursor_buffer_destroy (cursor_buffer);
  588     cursor_buffer = NULL;
  589 
  590     /* Reset the ledger */
  591     ledger->traverse_to_new = FALSE;
  592     ledger->hint_entry = NULL;
  593 
  594     /* Set the cell fractions */
  595 
  596 
  597     gnc_table_refresh_gui (table, TRUE);
  598     gnc_entry_ledger_show_entry (ledger, table->current_cursor_loc.vcell_loc);
  599 
  600     /* Set completion character */
  601     gnc_combo_cell_set_complete_char
  602     ((ComboCell *)
  603      gnc_table_layout_get_cell (table->layout, ENTRY_IACCT_CELL),
  604      gnc_get_account_separator ());
  605 
  606     gnc_combo_cell_set_complete_char
  607     ((ComboCell *)
  608      gnc_table_layout_get_cell (table->layout, ENTRY_BACCT_CELL),
  609      gnc_get_account_separator ());
  610 
  611     /* enable callback for cursor user-driven moves */
  612     gnc_table_control_allow_move (table->control, TRUE);
  613 }
  614 
  615 /* =========================== END OF FILE ========================== */