GnuCash
5.6-150-g038405b370+
|
Files | |
file | dialog-bi-import-gui.h |
GUI handling for bi-import plugin. | |
file | dialog-bi-import.h |
core import functions for invoice import plugin | |
file | gnc-plugin-bi-import.h |
Plugin registration of the bi-import module. | |
file | dialog-customer-import-gui.h |
GUI handling for customer import plugin. | |
file | dialog-customer-import.h |
core import functions for customer import plugin | |
file | gnc-plugin-customer-import.h |
Plugin registration of the customer_import module. | |
Data Structures | |
struct | bi_import_stats |
struct | customer_import_stats |
Typedefs | |
typedef typedefG_BEGIN_DECLS struct _bi_import_gui | BillImportGui |
typedef enum _bi_import_result | bi_import_result |
typedef typedefG_BEGIN_DECLS struct _customer_import_gui | CustomerImportGui |
typedef enum _customer_import_result | customer_import_result |
Functions | |
GncPlugin * | gnc_plugin_example_new (void) |
void | gnc_plugin_example_create_plugin (void) |
Create a new GncPluginexample object and register it. | |
BillImportGui * | gnc_plugin_bi_import_showGUI (GtkWindow *parent) |
File chooser. | |
bi_import_result | gnc_bi_import_read_file (const gchar *filename, const gchar *parser_regexp, GtkListStore *store, guint max_rows, bi_import_stats *stats) |
Imports a csv file with invoice data into a GtkListStore. More... | |
void | gnc_bi_import_fix_bis (GtkListStore *store, guint *fixed, guint *deleted, GString *info, gchar *type) |
Adjusts and validates invoice import data. More... | |
void | gnc_bi_import_create_bis (GtkListStore *store, QofBook *book, guint *n_invoices_created, guint *n_invoices_updated, guint *n_rows_ignored, gchar *type, gchar *open_mode, GString *info, GtkWindow *parent) |
Creates and updates invoices from validated import data. More... | |
GncPlugin * | gnc_plugin_bi_import_new (void) |
void | gnc_plugin_bi_import_create_plugin (void) |
Create a new GncPluginbi_import object and register it. | |
CustomerImportGui * | gnc_plugin_customer_import_showGUI (GtkWindow *parent) |
File chooser. | |
customer_import_result | gnc_customer_import_read_file (const gchar *filename, const gchar *parser_regexp, GtkListStore *store, guint max_rows, customer_import_stats *stats) |
void | gnc_customer_import_fix_customers (GtkListStore *store, guint *fixed, guint *deleted, gchar *type) |
void | gnc_customer_import_create_customers (GtkListStore *store, QofBook *book, guint *n_customers_created, guint *n_customers_updated, gchar *type) |
GncPlugin * | gnc_plugin_customer_import_new (void) |
void | gnc_plugin_customer_import_create_plugin (void) |
Create a new GncPlugincustomer_import object and register it. | |
void gnc_bi_import_create_bis | ( | GtkListStore * | store, |
QofBook * | book, | ||
guint * | n_invoices_created, | ||
guint * | n_invoices_updated, | ||
guint * | n_rows_ignored, | ||
gchar * | type, | ||
gchar * | open_mode, | ||
GString * | info, | ||
GtkWindow * | parent | ||
) |
Creates and updates invoices from validated import data.
Loops through the import data to create and update invoices. The first data row for an invoice is assumed to hold the header data.
If an invoice already exists, the user is asked, once per import, to confirm that invoices should be updated. If not confirmed, any rows for existing invoices are ignored. If confirmed, entries are added to existing invoices. Posted invoices, however, are never updated.
If the field date_posted is set, the system will attempt to also post the invoice. The system will not post the invoice if the entries of the invoice hold different currencies, or if the currency of the invoice differs from the currency of the account_posted.
As per user selection, the system displays tabs for either all affected invoices, all affected invoices not yet posted, or no invoices at all.
Definition at line 598 of file dialog-bi-import.c.
void gnc_bi_import_fix_bis | ( | GtkListStore * | store, |
guint * | n_rows_fixed, | ||
guint * | n_rows_ignored, | ||
GString * | info, | ||
gchar * | type | ||
) |
Adjusts and validates invoice import data.
Replaces missing or invalid data with defaults:
Validates the import data; any error causes all rows of the same invoice to be deleted from the import data:
Adjustment and validation for header fields is only done for the first row of an invoice, which is assumed to hold the header data for all items of the same invoice. Currency related validation is done in subsqequent processing by gnc_bi_import_create_bis.
store | Holds the rows of invoice import data |
n_rows_fixed | Increased for every data row that is adjusted in this function |
n_rows_ignored | Increased for every data row that is deleted in this function |
info | Updated with the error messages from this function |
type | The type of the import data, BILL or INVOICE |
Definition at line 269 of file dialog-bi-import.c.
bi_import_result gnc_bi_import_read_file | ( | const gchar * | filename, |
const gchar * | parser_regexp, | ||
GtkListStore * | store, | ||
guint | max_rows, | ||
bi_import_stats * | stats | ||
) |
Imports a csv file with invoice data into a GtkListStore.
Opens the csv file and attempts to match each row with the regular expression provided in parser_regexp. This is a regular expression that matches each field of the import row and the user selected field separators (, or ;), optionally with the fields enclosed in quotes.
If the match is successful, the fields of the import row are transferred to a row in the GtkListStore store. If the match is not successful, the row is ignored. Maintains information about number of rows imported, the number of rows ignored, and the actual ignored rows.
filename | The csv filename to read |
parser_regexp | The regular expression with which to match the import rows |
store | To store the matched data |
max_rows | The maximum number of rows to import; use 0 for no maximum. |
stats | Return information about matched and non-matched rows. Use NULL if the information is not required. |
Definition at line 97 of file dialog-bi-import.c.
GncPlugin* gnc_plugin_bi_import_new | ( | void | ) |
Definition at line 80 of file gnc-plugin-bi-import.c.
GncPlugin* gnc_plugin_customer_import_new | ( | void | ) |
Definition at line 78 of file gnc-plugin-customer-import.c.
GncPlugin* gnc_plugin_example_new | ( | void | ) |
Definition at line 66 of file gnc-plugin.example.c.