GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dialog-bi-import.h
Go to the documentation of this file.
1 /*
2  * dialog-bi-import.h -- Invoice Importer core functions
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, contact:
16  *
17  * Free Software Foundation Voice: +1-617-542-5942
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
19  * Boston, MA 02110-1301, USA [email protected]
20  */
21 
31 #ifndef GNC_PLUGIN_BI_IMPORT_H
32 #define GNC_PLUGIN_BI_IMPORT_H
33 
34 #include <glib.h>
35 #include <gtk/gtk.h>
36 
37 G_BEGIN_DECLS
38 
39 // model
40 enum bi_import_model_columns
41 {
42  ID, DATE_OPENED, OWNER_ID, BILLING_ID, NOTES, // invoice settings
43  DATE, DESC, ACTION, ACCOUNT, QUANTITY, PRICE, DISC_TYPE, DISC_HOW, DISCOUNT, TAXABLE, TAXINCLUDED, TAX_TABLE, // entry settings
44  DATE_POSTED, DUE_DATE, ACCOUNT_POSTED, MEMO_POSTED, ACCU_SPLITS, // autopost settings
45  N_COLUMNS
46 };
47 
48 enum _bi_import_result
49 {
50  RESULT_OK,
51  RESULT_OPEN_FAILED,
52  RESULT_ERROR_IN_REGEXP,
53 };
54 typedef enum _bi_import_result bi_import_result;
55 
57 {
58  int n_imported, n_ignored;
59  GString *ignored_lines;
60 };
61 typedef struct _bi_import_stats bi_import_stats;
62 
63 
64 bi_import_result
65 gnc_bi_import_read_file (const gchar *filename, const gchar *parser_regexp, GtkListStore *store, guint max_rows, bi_import_stats *stats);
66 
67 void
68 gnc_bi_import_fix_bis (GtkListStore *store, guint *fixed, guint *deleted, GString *info, gchar *type);
69 
70 void
71 gnc_bi_import_create_bis (GtkListStore *store, QofBook *book, guint *n_invoices_created, guint *n_invoices_updated, gchar *type, gchar *open_mode, GString * info);
72 
73 
74 G_END_DECLS
75 
76 #endif /* GNC_PLUGIN_BI_IMPORT_H */
77 
void gnc_bi_import_fix_bis(GtkListStore *store, guint *fixed, guint *deleted, GString *info, gchar *type)
try to fix some common errors in the csv representation of invoices