mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add ability to show HBCI Online Account matches to 'Import Map Editor'
This commit is contained in:
parent
1fa5fd0a14
commit
6b55222ca9
@ -549,6 +549,9 @@ list_type_selected_cb (GtkToggleButton* button, ImapDialog *imap_dialog)
|
||||
else
|
||||
type = ONLINE;
|
||||
|
||||
if (type != ONLINE)
|
||||
gtk_widget_grab_focus (GTK_WIDGET(imap_dialog->filter_text_entry));
|
||||
|
||||
// Lets do this only on change of list type
|
||||
if (type != imap_dialog->type)
|
||||
{
|
||||
@ -736,24 +739,27 @@ get_account_info_online (ImapDialog *imap_dialog, GList *accts)
|
||||
/* Go through list of accounts */
|
||||
for (ptr = accts; ptr; ptr = g_list_next (ptr))
|
||||
{
|
||||
gchar *hbci_account_id = NULL;
|
||||
gchar *hbci_bank_code = NULL;
|
||||
gchar *text = NULL;
|
||||
Account *acc = ptr->data;
|
||||
|
||||
// Save source account
|
||||
imapInfo.source_account = acc;
|
||||
imapInfo.head = "online_id";
|
||||
imapInfo.category = " ";
|
||||
|
||||
text = gnc_account_get_map_entry (acc, imapInfo.head);
|
||||
// Check for online_id
|
||||
text = gnc_account_get_map_entry (acc, "online_id", NULL);
|
||||
|
||||
if (text != NULL)
|
||||
{
|
||||
// Save source account
|
||||
imapInfo.source_account = acc;
|
||||
imapInfo.head = "online_id";
|
||||
imapInfo.category = " ";
|
||||
|
||||
if (g_strcmp0 (text, "") == 0)
|
||||
imapInfo.map_account = NULL;
|
||||
else
|
||||
imapInfo.map_account = imapInfo.source_account;
|
||||
|
||||
imapInfo.match_string = text;
|
||||
imapInfo.match_string = text;
|
||||
imapInfo.count = " ";
|
||||
|
||||
// Add top level entry and pass iter to add_to_store
|
||||
@ -761,6 +767,34 @@ get_account_info_online (ImapDialog *imap_dialog, GList *accts)
|
||||
add_to_store (imap_dialog, &toplevel, _("Online Id"), &imapInfo);
|
||||
}
|
||||
g_free (text);
|
||||
|
||||
// Check for aqbanking hbci
|
||||
hbci_account_id = gnc_account_get_map_entry (acc, "hbci", "account-id");
|
||||
hbci_bank_code = gnc_account_get_map_entry (acc, "hbci", "bank-code");
|
||||
text = g_strconcat (hbci_bank_code, ",", hbci_account_id, NULL);
|
||||
|
||||
if ((hbci_account_id != NULL) || (hbci_bank_code != NULL))
|
||||
{
|
||||
// Save source account
|
||||
imapInfo.source_account = acc;
|
||||
imapInfo.head = "hbci";
|
||||
imapInfo.category = " ";
|
||||
|
||||
if (g_strcmp0 (text, "") == 0)
|
||||
imapInfo.map_account = NULL;
|
||||
else
|
||||
imapInfo.map_account = imapInfo.source_account;
|
||||
|
||||
imapInfo.match_string = text;
|
||||
imapInfo.count = " ";
|
||||
|
||||
// Add top level entry and pass iter to add_to_store
|
||||
gtk_tree_store_append (GTK_TREE_STORE(imap_dialog->model), &toplevel, NULL);
|
||||
add_to_store (imap_dialog, &toplevel, _("Online HBCI"), &imapInfo);
|
||||
}
|
||||
g_free (hbci_account_id);
|
||||
g_free (hbci_bank_code);
|
||||
g_free (text);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio-online">
|
||||
<property name="label" translatable="yes">Online ID</property>
|
||||
<property name="label" translatable="yes">Online</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
@ -288,8 +288,8 @@
|
||||
<object class="GtkLabel" id="filter-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="margin_top">3</property>
|
||||
<property name="margin_bottom">3</property>
|
||||
<property name="label" translatable="yes">Filter will be applied to 'Match String' and 'Mapped to Account Name' fields, case sensitive.</property>
|
||||
<style>
|
||||
<class name="gnc-class-highlight"/>
|
||||
@ -320,6 +320,9 @@
|
||||
<object class="GtkEntry" id="filter-text-entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="has_default">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
@ -394,8 +397,8 @@
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="margin_top">3</property>
|
||||
<property name="margin_bottom">3</property>
|
||||
<property name="label" translatable="yes">Multiple rows can be selected and then deleted by pressing the delete button.</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
@ -5802,11 +5802,13 @@ gnc_account_imap_get_info (Account *acc, const char *category)
|
||||
/*******************************************************************************/
|
||||
|
||||
gchar *
|
||||
gnc_account_get_map_entry (Account *acc, const char *full_category)
|
||||
gnc_account_get_map_entry (Account *acc, const char *head, const char *category)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
gchar *text = NULL;
|
||||
std::vector<std::string> path {full_category};
|
||||
std::vector<std::string> path {head};
|
||||
if (category)
|
||||
path.emplace_back (category);
|
||||
if (qof_instance_has_path_slot (QOF_INSTANCE (acc), path))
|
||||
{
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE (acc), &v, path);
|
||||
|
@ -1457,10 +1457,10 @@ GList *gnc_account_imap_get_info_bayes (Account *acc);
|
||||
*/
|
||||
GList *gnc_account_imap_get_info (Account *acc, const char *category);
|
||||
|
||||
/** Returns the text string pointed to by full_category for the Account, free
|
||||
/** Returns the text string pointed to by head and category for the Account, free
|
||||
* the returned text
|
||||
*/
|
||||
gchar *gnc_account_get_map_entry (Account *acc, const char *full_category);
|
||||
gchar *gnc_account_get_map_entry (Account *acc, const char *head, const char *category);
|
||||
|
||||
/** Delete the entry for Account pointed to by head,category and match_string,
|
||||
* if empty is TRUE then use delete if empty
|
||||
|
Loading…
Reference in New Issue
Block a user