GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncEntryLedger.h
1 /*
2  * gncEntryLedger.h -- a ledger widget for manipulating GncEntry's
3  * Copyright (C) 2001, 2003 Derek Atkins
4  * Author: Derek Atkins <[email protected]>
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 [email protected]
22  */
23 
24 #ifndef GNC_ENTRY_LEDGER_H
25 #define GNC_ENTRY_LEDGER_H
26 
27 #include "qof.h"
28 #include "gncEntry.h"
29 #include "gncOrder.h"
30 #include "table-allgui.h"
31 
32 typedef enum
33 {
34  GNC_ENTRY_ORDER_NONE = -1, //Force clang to use int representation of enum.
35  GNCENTRY_ORDER_ENTRY,
36  GNCENTRY_ORDER_VIEWER,
37  GNCENTRY_INVOICE_ENTRY,
38  GNCENTRY_INVOICE_VIEWER,
39  GNCENTRY_CUST_CREDIT_NOTE_ENTRY,
40  GNCENTRY_CUST_CREDIT_NOTE_VIEWER,
41  GNCENTRY_BILL_ENTRY,
42  GNCENTRY_BILL_VIEWER,
43  GNCENTRY_VEND_CREDIT_NOTE_ENTRY,
44  GNCENTRY_VEND_CREDIT_NOTE_VIEWER,
45  GNCENTRY_EXPVOUCHER_ENTRY,
46  GNCENTRY_EXPVOUCHER_VIEWER,
47  GNCENTRY_EMPL_CREDIT_NOTE_ENTRY,
48  GNCENTRY_EMPL_CREDIT_NOTE_VIEWER,
49  GNCENTRY_NUM_REGISTER_TYPES
50 } GncEntryLedgerType;
51 
52 #define ENTRY_IACCT_CELL "inv-account"
53 #define ENTRY_BACCT_CELL "bill-account"
54 #define ENTRY_ACTN_CELL "action"
55 #define ENTRY_DATE_CELL "date"
56 #define ENTRY_DESC_CELL "description"
57 #define ENTRY_DISC_CELL "discount"
58 #define ENTRY_DISTYPE_CELL "discount-type"
59 #define ENTRY_DISHOW_CELL "discount-how"
60 #define ENTRY_PRIC_CELL "price"
61 #define ENTRY_QTY_CELL "quantity"
62 #define ENTRY_TAXABLE_CELL "istaxable"
63 #define ENTRY_TAXTABLE_CELL "taxtable"
64 #define ENTRY_TAXINCLUDED_CELL "taxincluded"
65 #define ENTRY_BILLABLE_CELL "isbillable"
66 
67 #define ENTRY_INV_CELL "isinvoiced"
68 #define ENTRY_VALUE_CELL "line-value"
69 #define ENTRY_TAXVAL_CELL "line-tax-val"
70 
71 #define ENTRY_PAYMENT_CELL "payment"
72 
73 typedef struct GncEntryLedger_s GncEntryLedger;
74 
77 /* Create and return a new GncEntry Ledger */
78 GncEntryLedger * gnc_entry_ledger_new (QofBook *book, GncEntryLedgerType type);
79 
80 /* Set the default order for this ledger */
81 void gnc_entry_ledger_set_default_order (GncEntryLedger *ledger,
82  GncOrder *order);
83 
84 /* Set the default invoice for this ledger */
85 void gnc_entry_ledger_set_default_invoice (GncEntryLedger *ledger,
86  GncInvoice *invoice);
87 
88 /* Destroy the GncEntry Ledger */
89 void gnc_entry_ledger_destroy (GncEntryLedger *ledger);
90 
91 /* Returns the Entry where the cursor is currently located. */
92 GncEntry * gnc_entry_ledger_get_current_entry (GncEntryLedger *ledger);
93 
94 /* Copy GncEntry information from the list to the rows of the Ledger. */
95 void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list);
96 
97 void gnc_entry_ledger_display_refresh (GncEntryLedger *ledger);
98 
99 /* Get the Table */
100 Table * gnc_entry_ledger_get_table (GncEntryLedger *ledger);
101 
102 void gnc_entry_ledger_set_parent (GncEntryLedger *ledger, GtkWidget *parent);
103 
104 void gnc_entry_ledger_set_readonly (GncEntryLedger *ledger, gboolean readonly);
105 
106 gboolean gnc_entry_ledger_changed (GncEntryLedger *ledger);
107 
108 void gnc_entry_ledger_cancel_cursor_changes (GncEntryLedger *ledger);
109 
110 /* This will act just like hitting 'return' to record an entry */
111 gboolean gnc_entry_ledger_commit_entry (GncEntryLedger *ledger);
112 
113 /* This will ask the user if they really want to make a change */
114 gboolean gnc_entry_ledger_check_close (GtkWidget *parent, GncEntryLedger *ledger);
115 
116 void gnc_entry_ledger_reset_query (GncEntryLedger *ledger);
117 
120 GncEntry * gnc_entry_ledger_get_entry (GncEntryLedger *ledger,
121  VirtualCellLocation vcell_loc);
122 
125 GncEntry * gnc_entry_ledger_get_blank_entry (GncEntryLedger *ledger);
126 
130 gboolean gnc_entry_ledger_get_entry_virt_loc (GncEntryLedger *ledger,
131  const GncEntry *entry,
132  VirtualCellLocation *vcell_loc);
133 
134 void gnc_entry_ledger_delete_current_entry (GncEntryLedger *ledger);
135 void gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger);
136 
144 void gnc_entry_ledger_move_current_entry_updown (GncEntryLedger *ledger,
145  gboolean move_up);
146 
147 QofQuery * gnc_entry_ledger_get_query (GncEntryLedger *ledger);
148 
149 void gnc_entry_ledger_set_prefs_group (GncEntryLedger *ledger, const gchar *string);
150 
151 #endif /* GNC_ENTRY_LEDGER_H */
struct _QofQuery QofQuery
Definition: qofquery.h:90
Declarations for the Table object.
Business Entry Interface.