29 #include <glib/gi18n.h> 34 #include "dialog-utils.h" 35 #include "gnc-component-manager.h" 39 #include "gnc-gui-query.h" 40 #include "gnc-warnings.h" 43 #include "dialog-tax-table.h" 51 gnc_entry_ledger_save (GncEntryLedger *ledger, gboolean do_commit)
53 GncEntry *blank_entry;
56 if (!ledger)
return FALSE;
61 if (entry == NULL)
return FALSE;
64 if (!gnc_table_current_cursor_changed (ledger->table, FALSE))
66 if (!do_commit)
return FALSE;
68 if (entry == blank_entry)
70 if (ledger->blank_entry_edited)
74 ledger->blank_entry_edited = FALSE;
84 gnc_suspend_gui_refresh ();
86 if (!gncEntryIsOpen (entry))
87 gncEntryBeginEdit (entry);
89 gnc_table_save_cells (ledger->table, entry);
91 if (entry == blank_entry)
94 gncEntrySetDateEntered (blank_entry, time);
98 case GNCENTRY_ORDER_ENTRY:
99 gncOrderAddEntry (ledger->order, blank_entry);
101 case GNCENTRY_INVOICE_ENTRY:
102 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
104 gncInvoiceAddEntry (ledger->invoice, blank_entry);
106 case GNCENTRY_BILL_ENTRY:
107 case GNCENTRY_EXPVOUCHER_ENTRY:
108 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
109 case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
115 g_warning (
"blank entry traversed in a viewer");
120 if (entry == blank_entry)
124 ledger->blank_entry_guid = *
guid_null ();
129 ledger->blank_entry_edited = TRUE;
133 gncEntryCommitEdit (entry);
135 gnc_table_clear_current_cursor_changes (ledger->table);
137 gnc_resume_gui_refresh ();
143 gnc_entry_ledger_verify_acc_cell_ok (GncEntryLedger *ledger,
144 const char *cell_name,
145 const char *cell_msg)
150 cell = (
ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
152 g_return_val_if_fail (cell, TRUE);
153 name = cell->cell.value;
154 if (!name || *name ==
'\0')
156 const char *format = (
"%s %s");
157 const char *gen_msg = _(
"Invalid Entry: You need to supply an account in the right currency for this position.");
159 gnc_error_dialog (GTK_WINDOW (ledger->parent), format, gen_msg, cell_msg);
169 gnc_entry_ledger_verify_can_save (GncEntryLedger *ledger)
174 gnc_entry_ledger_compute_value (ledger, &value, NULL);
179 switch (ledger->type)
181 case GNCENTRY_INVOICE_ENTRY:
182 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
183 if (!gnc_entry_ledger_verify_acc_cell_ok (ledger, ENTRY_IACCT_CELL,
184 _(
"This account should usually be of type income.")))
187 case GNCENTRY_BILL_ENTRY:
188 case GNCENTRY_EXPVOUCHER_ENTRY:
189 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
190 case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
191 if (!gnc_entry_ledger_verify_acc_cell_ok (ledger, ENTRY_BACCT_CELL,
192 _(
"This account should usually be of type expense or asset.")))
196 g_warning (
"Unhandled ledger type");
204 static void gnc_entry_ledger_move_cursor (VirtualLocation *p_new_virt_loc,
207 GncEntryLedger *ledger = user_data;
208 VirtualLocation new_virt_loc = *p_new_virt_loc;
218 gnc_suspend_gui_refresh ();
219 saved = gnc_entry_ledger_save (ledger, old_entry != new_entry);
220 gnc_resume_gui_refresh ();
225 VirtualCellLocation vcell_loc;
228 gnc_entry_ledger_display_refresh (ledger);
230 if (ledger->traverse_to_new)
235 if (gnc_entry_ledger_find_entry (ledger, new_entry, &vcell_loc))
237 new_virt_loc.vcell_loc = vcell_loc;
240 new_virt_loc.vcell_loc = ledger->table->current_cursor_loc.vcell_loc;
245 *p_new_virt_loc = new_virt_loc;
252 static QofQuery *new_query_for_entry_desc(GncEntryLedger *reg,
const char* desc, gboolean use_invoice)
255 QofQueryPredData *predData = NULL;
256 GSList *param_list = NULL;
257 GSList *primary_sort_params = NULL;
258 const char* should_be_null = (use_invoice ? ENTRY_BILL : ENTRY_INVOICE);
264 query = qof_query_create_for (GNC_ID_ENTRY);
270 qof_query_string_predicate (QOF_COMPARE_EQUAL, desc,
271 QOF_STRING_MATCH_CASEINSENSITIVE, FALSE);
274 param_list = qof_query_build_param_list (ENTRY_DESC, NULL);
281 qof_query_build_param_list (should_be_null,
282 QOF_PARAM_GUID, NULL),
283 NULL, QOF_QUERY_AND);
287 primary_sort_params = qof_query_build_param_list(ENTRY_DATE_ENTERED, NULL);
299 find_entry_in_book_by_desc(GncEntryLedger *reg,
const char* desc)
301 GncEntry *result = NULL;
302 gboolean use_invoice;
304 GList *entries = NULL;
308 case GNCENTRY_INVOICE_ENTRY:
309 case GNCENTRY_INVOICE_VIEWER:
310 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
311 case GNCENTRY_CUST_CREDIT_NOTE_VIEWER:
319 query = new_query_for_entry_desc(reg, desc, use_invoice);
326 result = (GncEntry*) entries->data;
339 gnc_find_entry_in_reg_by_desc(GncEntryLedger *reg,
const char* desc)
341 int virt_row, virt_col;
342 int num_rows, num_cols;
343 GncEntry *last_entry;
346 g_assert(reg->table);
347 if (!reg || !reg->table)
350 num_rows = reg->table->num_virt_rows;
351 num_cols = reg->table->num_virt_cols;
355 for (virt_row = num_rows - 1; virt_row >= 0; virt_row--)
356 for (virt_col = num_cols - 1; virt_col >= 0; virt_col--)
359 VirtualCellLocation vcell_loc = { virt_row, virt_col };
363 if (entry == last_entry)
366 if (g_strcmp0 (desc, gncEntryGetDescription (entry)) == 0)
376 static void set_value_combo_cell(BasicCell *cell,
const char *new_value)
378 if (!cell || !new_value)
380 if (g_strcmp0 (new_value, gnc_basic_cell_get_value (cell)) == 0)
383 gnc_combo_cell_set_value ((
ComboCell *) cell, new_value);
384 gnc_basic_cell_set_changed (cell, TRUE);
387 static void set_value_price_cell(BasicCell *cell, gnc_numeric new_value)
396 gnc_basic_cell_set_changed (cell, TRUE);
400 gnc_entry_ledger_auto_completion (GncEntryLedger *ledger,
401 gncTableTraversalDir dir,
402 VirtualLocation *p_new_virt_loc)
405 GncEntry *blank_entry;
406 GncEntry *auto_entry;
407 const char* cell_name;
409 BasicCell *cell = NULL;
410 char *account_name = NULL;
413 g_assert(ledger->table);
417 if (dir != GNC_TABLE_TRAVERSE_RIGHT)
424 cell_name = gnc_table_get_current_cell_name (ledger->table);
427 switch (ledger->type)
429 case GNCENTRY_ORDER_ENTRY:
430 case GNCENTRY_INVOICE_ENTRY:
431 case GNCENTRY_BILL_ENTRY:
432 case GNCENTRY_EXPVOUCHER_ENTRY:
433 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
434 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
435 case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
443 if (blank_entry == NULL)
447 if (entry != blank_entry)
451 if (!gnc_cell_name_equal (cell_name, ENTRY_DESC_CELL))
456 if (gnc_table_layout_get_cell_changed (ledger->table->layout,
457 ENTRY_ACTN_CELL, TRUE)
458 || gnc_table_layout_get_cell_changed (ledger->table->layout,
459 ENTRY_QTY_CELL, TRUE)
460 || gnc_table_layout_get_cell_changed (ledger->table->layout,
461 ENTRY_PRIC_CELL, TRUE)
462 || gnc_table_layout_get_cell_changed (ledger->table->layout,
463 ENTRY_DISC_CELL, TRUE)
464 || gnc_table_layout_get_cell_changed (ledger->table->layout,
465 ENTRY_DISTYPE_CELL, TRUE)
466 || gnc_table_layout_get_cell_changed (ledger->table->layout,
467 ENTRY_DISHOW_CELL, TRUE)
468 || gnc_table_layout_get_cell_changed (ledger->table->layout,
469 ENTRY_IACCT_CELL, TRUE)
470 || gnc_table_layout_get_cell_changed (ledger->table->layout,
471 ENTRY_BACCT_CELL, TRUE)
472 || gnc_table_layout_get_cell_changed (ledger->table->layout,
473 ENTRY_TAXABLE_CELL, TRUE)
474 || gnc_table_layout_get_cell_changed (ledger->table->layout,
475 ENTRY_TAXINCLUDED_CELL, TRUE)
476 || gnc_table_layout_get_cell_changed (ledger->table->layout,
477 ENTRY_TAXTABLE_CELL, TRUE)
478 || gnc_table_layout_get_cell_changed (ledger->table->layout,
479 ENTRY_VALUE_CELL, TRUE)
480 || gnc_table_layout_get_cell_changed (ledger->table->layout,
481 ENTRY_TAXVAL_CELL, TRUE)
482 || gnc_table_layout_get_cell_changed (ledger->table->layout,
483 ENTRY_BILLABLE_CELL, TRUE)
484 || gnc_table_layout_get_cell_changed (ledger->table->layout,
485 ENTRY_PAYMENT_CELL, TRUE))
489 if (!gnc_table_layout_get_cell_changed (ledger->table->layout,
490 ENTRY_DESC_CELL, TRUE))
494 desc = gnc_table_layout_get_cell_value (ledger->table->layout, ENTRY_DESC_CELL);
495 if ((desc == NULL) || (*desc ==
'\0'))
502 find_entry_in_book_by_desc(ledger, desc);
504 if (auto_entry == NULL)
508 gnc_suspend_gui_refresh ();
511 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_ACTN_CELL);
512 set_value_combo_cell (cell, gncEntryGetAction (auto_entry));
515 switch (ledger->type)
517 case GNCENTRY_INVOICE_ENTRY:
518 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
519 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_IACCT_CELL);
522 case GNCENTRY_EXPVOUCHER_ENTRY:
523 case GNCENTRY_BILL_ENTRY:
524 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
525 case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
526 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_BACCT_CELL);
529 case GNCENTRY_ORDER_ENTRY:
535 set_value_combo_cell (cell, account_name);
536 g_free (account_name);
544 switch (ledger->type)
546 case GNCENTRY_INVOICE_ENTRY:
547 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
548 orig_is_cn = gncInvoiceGetIsCreditNote (gncEntryGetInvoice (auto_entry));
551 orig_is_cn = gncInvoiceGetIsCreditNote (gncEntryGetBill (auto_entry));
554 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_QTY_CELL);
561 switch (ledger->type)
563 case GNCENTRY_INVOICE_ENTRY:
564 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
565 price = gncEntryGetInvPrice (auto_entry);
568 price = gncEntryGetBillPrice (auto_entry);
573 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_PRIC_CELL);
574 set_value_price_cell (cell, price);
581 gboolean taxable = FALSE, taxincluded = FALSE;
583 switch (ledger->type)
585 case GNCENTRY_INVOICE_ENTRY:
586 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
587 taxable = gncEntryGetInvTaxable (auto_entry);
588 taxincluded = gncEntryGetInvTaxIncluded (auto_entry);
589 taxtable = gncEntryGetInvTaxTable (auto_entry);
591 case GNCENTRY_BILL_ENTRY:
592 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
593 taxable = gncEntryGetBillTaxable (auto_entry);
594 taxincluded = gncEntryGetBillTaxIncluded (auto_entry);
595 taxtable = gncEntryGetBillTaxTable (auto_entry);
601 switch (ledger->type)
603 case GNCENTRY_INVOICE_ENTRY:
604 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
605 case GNCENTRY_BILL_ENTRY:
606 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
608 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_TAXABLE_CELL);
609 gnc_checkbox_cell_set_flag ((
CheckboxCell *) cell, taxable);
610 gnc_basic_cell_set_changed (cell, TRUE);
613 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_TAXINCLUDED_CELL);
614 gnc_checkbox_cell_set_flag ((
CheckboxCell *) cell, taxincluded);
615 gnc_basic_cell_set_changed (cell, TRUE);
618 cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_TAXTABLE_CELL);
619 set_value_combo_cell(cell, gncTaxTableGetName (taxtable));
627 gnc_resume_gui_refresh ();
631 GNC_PREF_TAB_TRANS_MEMORISED) )
633 VirtualLocation new_virt_loc;
634 const char *cell_name = ENTRY_QTY_CELL;
636 if (gnc_table_get_current_cell_location (ledger->table, cell_name,
638 *p_new_virt_loc = new_virt_loc;
644 static gboolean gnc_entry_ledger_traverse (VirtualLocation *p_new_virt_loc,
645 gncTableTraversalDir dir,
648 GncEntryLedger *ledger = user_data;
649 GncEntry *entry, *new_entry;
651 VirtualLocation virt_loc;
653 char const *cell_name;
654 gboolean exact_traversal;
656 if (!ledger)
return FALSE;
658 exact_traversal = (dir == GNC_TABLE_TRAVERSE_POINTER);
665 changed = gnc_table_current_cursor_changed (ledger->table, FALSE);
669 virt_loc = *p_new_virt_loc;
671 cell_name = gnc_table_get_current_cell_name (ledger->table);
678 char *cell_name = NULL;
680 switch (ledger->type)
682 case GNCENTRY_INVOICE_ENTRY:
683 case GNCENTRY_INVOICE_VIEWER:
684 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
685 case GNCENTRY_CUST_CREDIT_NOTE_VIEWER:
686 cell_name = ENTRY_IACCT_CELL;
688 case GNCENTRY_BILL_ENTRY:
689 case GNCENTRY_BILL_VIEWER:
690 case GNCENTRY_EXPVOUCHER_ENTRY:
691 case GNCENTRY_EXPVOUCHER_VIEWER:
692 case GNCENTRY_VEND_CREDIT_NOTE_ENTRY:
693 case GNCENTRY_VEND_CREDIT_NOTE_VIEWER:
694 case GNCENTRY_EMPL_CREDIT_NOTE_ENTRY:
695 case GNCENTRY_EMPL_CREDIT_NOTE_VIEWER:
696 cell_name = ENTRY_BACCT_CELL;
699 g_warning (
"Unhandled ledger type");
706 if (!gnc_cell_name_equal (cell_name, cell_name))
709 if (!gnc_table_layout_get_cell_changed (ledger->table->layout,
713 cell = (
ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
718 name = cell->cell.value;
719 if (!name || *name ==
'\0')
723 if (!gnc_entry_ledger_get_account_by_name (ledger, (BasicCell *) cell,
725 &ledger->full_refresh))
739 if (!gnc_cell_name_equal (cell_name, ENTRY_TAXTABLE_CELL))
742 if (!gnc_table_layout_get_cell_changed (ledger->table->layout,
743 ENTRY_TAXTABLE_CELL, FALSE))
746 cell = (
ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
747 ENTRY_TAXTABLE_CELL);
751 name = cell->cell.value;
752 if (!name || *name ==
'\0')
755 table = gncTaxTableLookupByName (ledger->book, cell->cell.value);
760 const char *format = _(
"The tax table %s does not exist. " 761 "Would you like to create it?");
762 if (!gnc_verify_dialog (GTK_WINDOW (ledger->parent), TRUE, format, name))
766 ledger->full_refresh = FALSE;
768 table = gnc_ui_tax_table_new_from_name (GTK_WINDOW (ledger->parent), ledger->book, name);
772 ledger->full_refresh = TRUE;
774 name = (
char *)gncTaxTableGetName (
table);
775 gnc_combo_cell_set_value (cell, name);
776 gnc_basic_cell_set_changed (&cell->cell, TRUE);
787 VirtualLocation virt_loc;
789 if (!changed && !ledger->blank_entry_edited)
792 if (dir != GNC_TABLE_TRAVERSE_RIGHT)
795 virt_loc = ledger->table->current_cursor_loc;
799 virt_loc = ledger->table->current_cursor_loc;
800 if (gnc_table_move_tab (ledger->table, &virt_loc, TRUE))
803 *p_new_virt_loc = ledger->table->current_cursor_loc;
811 if (!gnc_entry_ledger_verify_can_save (ledger))
816 (p_new_virt_loc->vcell_loc.virt_row)++;
817 p_new_virt_loc->phys_row_offset = 0;
818 p_new_virt_loc->phys_col_offset = 0;
820 ledger->traverse_to_new = TRUE;
833 if (gnc_entry_ledger_auto_completion (ledger, dir, p_new_virt_loc))
842 if (entry == new_entry)
844 *p_new_virt_loc = virt_loc;
855 if (!gnc_entry_ledger_verify_can_save (ledger))
857 *p_new_virt_loc = ledger->table->current_cursor_loc;
875 const char *title = _(
"Save the current entry?");
876 const char *message =
877 _(
"The current entry has been changed. However, this entry is " 878 "part of an existing order. Would you like to record the change " 879 "and effectively change your order?");
881 switch (ledger->type)
883 case GNCENTRY_INVOICE_ENTRY:
884 case GNCENTRY_CUST_CREDIT_NOTE_ENTRY:
885 if (gncEntryGetOrder (entry) != NULL)
887 dialog = gtk_message_dialog_new(GTK_WINDOW(ledger->parent),
888 GTK_DIALOG_DESTROY_WITH_PARENT,
889 GTK_MESSAGE_QUESTION,
892 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
894 gtk_dialog_add_buttons(GTK_DIALOG(dialog),
895 _(
"_Don't Record"), GTK_RESPONSE_REJECT,
896 _(
"_Cancel"), GTK_RESPONSE_CANCEL,
897 _(
"_Record"), GTK_RESPONSE_ACCEPT,
899 response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_INV_ENTRY_MOD);
900 gtk_widget_destroy(dialog);
906 response = GTK_RESPONSE_ACCEPT;
913 case GTK_RESPONSE_ACCEPT:
916 case GTK_RESPONSE_REJECT:
918 VirtualCellLocation vcell_loc;
923 gnc_entry_ledger_cancel_cursor_changes (ledger);
925 if (gnc_entry_ledger_find_entry (ledger, new_entry, &vcell_loc))
926 virt_loc.vcell_loc = vcell_loc;
931 *p_new_virt_loc = virt_loc;
936 case GTK_RESPONSE_CANCEL:
948 control = gnc_table_control_new ();
949 control->move_cursor = gnc_entry_ledger_move_cursor;
950 control->traverse = gnc_entry_ledger_traverse;
956 void gnc_entry_ledger_cancel_cursor_changes (GncEntryLedger *ledger)
958 VirtualLocation virt_loc;
963 virt_loc = ledger->table->current_cursor_loc;
965 if (!gnc_table_current_cursor_changed (ledger->table, FALSE))
969 gnc_table_clear_current_cursor_changes (ledger->table);
978 gnc_entry_ledger_check_close_internal (GtkWidget *
parent,
979 GncEntryLedger *ledger,
982 const char *message = _(
"The current entry has been changed. " 983 "Would you like to save it?");
984 VirtualLocation virt_loc;
986 virt_loc = ledger->table->current_cursor_loc;
988 if (gnc_entry_ledger_traverse (&virt_loc, GNC_TABLE_TRAVERSE_POINTER,
992 if (!gnc_entry_ledger_verify_can_save (ledger))
995 if (dontask || gnc_verify_dialog (GTK_WINDOW (
parent), TRUE,
"%s", message))
996 gnc_entry_ledger_save (ledger, TRUE);
998 gnc_entry_ledger_cancel_cursor_changes (ledger);
1006 if (!ledger)
return TRUE;
1008 return gnc_entry_ledger_check_close_internal (NULL, ledger, TRUE);
1014 if (!ledger)
return TRUE;
1016 if (gnc_entry_ledger_changed (ledger))
1018 gboolean dontask = FALSE;
1020 if (ledger->type == GNCENTRY_INVOICE_ENTRY ||
1021 ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY)
1024 gboolean only_inv_changed = FALSE;
1026 if (gnc_table_current_cursor_changed (ledger->table, FALSE) == 1 &&
1027 gnc_table_layout_get_cell_changed (ledger->table->layout,
1028 ENTRY_INV_CELL, TRUE))
1029 only_inv_changed = TRUE;
1031 inv_value = gnc_entry_ledger_get_checkmark (ledger, ENTRY_INV_CELL);
1033 if (inv_value && only_inv_changed)
1042 return gnc_entry_ledger_check_close_internal (
parent, ledger, dontask);
gboolean gnc_numeric_equal(gnc_numeric a, gnc_numeric b)
Equivalence predicate: Returns TRUE (1) if a and b represent the same number.
void qof_query_add_term(QofQuery *q, QofQueryParamList *param_list, QofQueryPredData *pred_data, QofQueryOp op)
This is the general function that adds a new Query Term to a query.
This file contains the functions to present a gui to the user for creating a new account or editing a...
utility functions for the GnuCash UI
void qof_query_set_sort_order(QofQuery *q, QofQueryParamList *params1, QofQueryParamList *params2, QofQueryParamList *params3)
When a query is run, the results are sorted before being returned.
void gnc_table_move_cursor_gui(Table *table, VirtualLocation new_virt_loc)
will move the cursor and its GUI to the indicated location.
GncEntry * gnc_entry_ledger_get_entry(GncEntryLedger *ledger, VirtualCellLocation vcell_loc)
Returns the GncEntry at the given location, or NULL if the location is not valid. ...
gboolean gnc_table_find_close_valid_cell(Table *table, VirtualLocation *virt_loc, gboolean exact_pointer)
Find a close valid cell.
gboolean gnc_numeric_zero_p(gnc_numeric a)
Returns 1 if the given gnc_numeric is 0 (zero), else returns 0.
void qof_query_set_sort_increasing(QofQuery *q, gboolean prim_inc, gboolean sec_inc, gboolean tert_inc)
When a query is run, the results are sorted before being returned.
void qof_query_set_max_results(QofQuery *q, int n)
Set the maximum number of results that should be returned.
char * gnc_get_account_name_for_register(const Account *account)
Get either the full name of the account or the simple name, depending on the configuration parameter ...
void gnc_table_refresh_gui(Table *table, gboolean do_scroll)
Refresh the whole GUI from the table.
Account handling public routines.
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.
The ComboCell object implements a cell handler with a "combination-box" pull-down menu in it...
GncEntry * gnc_entry_ledger_get_current_entry(GncEntryLedger *ledger)
Returns the Entry where the cursor is currently located.
GtkWidget * parent
A Hint for where to display.
The PriceCell object implements a cell handler that stores a single double-precision value...
void qof_query_set_book(QofQuery *query, QofBook *book)
Set the book to be searched.
void gncBillAddEntry(GncInvoice *bill, GncEntry *entry)
Call this function when adding an entry to a bill instead of an invoice.
GDate gncEntryGetDateGDate(const GncEntry *entry)
Returns the day of this entry.
gboolean gnc_entry_ledger_check_close(GtkWidget *parent, GncEntryLedger *ledger)
This will ask the user if they really want to make a change.
gboolean gnc_table_move_vertical_position(Table *table, VirtualLocation *virt_loc, int phys_row_offset)
Moves away from virtual location virt_loc by phys_row_offset physical rows.
void qof_query_add_guid_match(QofQuery *q, QofQueryParamList *param_list, const GncGUID *guid, QofQueryOp op)
DOCUMENT ME !!
Generic api to store and retrieve preferences.
GList * qof_query_run(QofQuery *query)
Perform the query, return the results.
const GncGUID * guid_null(void)
Returns a GncGUID which is guaranteed to never reference any entity.
gboolean gnc_table_virtual_cell_out_of_bounds(Table *table, VirtualCellLocation vcell_loc)
checks the given location and returns true if it is out of bounds of the table.
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
Get a boolean value from the preferences backend.
Declarations for the Table object.
gboolean gnc_price_cell_set_value(PriceCell *cell, gnc_numeric amount)
updates amount, returns TRUE if string representation actually changed
time64 gnc_time(time64 *tbuf)
get the current time
The CheckboxCell object implements a cell handler that will toggle between yes and no values when cli...
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
GncEntry * gnc_entry_ledger_get_blank_entry(GncEntryLedger *ledger)
Exported Functions.
gnc_numeric gnc_price_cell_get_value(PriceCell *cell)
return the value of a price cell
#define QOF_QUERY_FIRST_TERM
First/only term is same as 'and'.
gnc_numeric gncEntryGetDocQuantity(const GncEntry *entry, gboolean is_cn)
Get the quantity as on the physical document.
gboolean gnc_entry_ledger_commit_entry(GncEntryLedger *ledger)
This will act just like hitting 'return' to record an entry.
modtime is the internal date of the last modtime See libgnucash/engine/TaxTableBillTermImmutability.txt for an explanation of the following Code that handles refcount, parent, child, invisible and children is identical to that in ::GncBillTerm