+/* = = = = = = = = future version = = = = = = = = */
+
+static void register_panel_action_exportpdf(GtkAction *action, gpointer user_data)
+{
+struct register_panel_data *data = user_data;
+gchar *name, *filepath;
+
+
+
+ name = g_strdup_printf("%s.pdf", data->acc->name);
+ filepath = g_build_filename(PREFS->path_export, name, NULL);
+ g_free(name);
+
+ if( ui_dialog_export_pdf(GTK_WINDOW(data->window), &filepath) == GTK_RESPONSE_ACCEPT )
+ {
+ DB( g_printf(" filename is'%s'\n", filepath) );
+
+
+ hb_export_pdf_listview(GTK_TREE_VIEW(data->LV_ope), filepath, data->acc->name);
+ }
+
+ g_free(filepath);
+
+
+}
+
+
+static void register_panel_action_check_internal_xfer(GtkAction *action, gpointer user_data)
+{
+struct register_panel_data *data = user_data;
+GtkTreeModel *model;
+GtkTreeIter iter;
+GList *badxferlist;
+gboolean valid;
+gint count;
+
+ DB( g_print("check intenal xfer\n\n") );
+
+ badxferlist = NULL;
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(data->LV_ope));
+ valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter);
+ while (valid)
+ {
+ Transaction *txn;
+
+ gtk_tree_model_get (model, &iter,
+ LST_DSPOPE_DATAS, &txn,
+ -1);
+
+ if( txn->paymode == PAYMODE_INTXFER )
+ {
+ if( transaction_xfer_child_strong_get(txn) == NULL )
+ {
+ DB( g_print(" - invalid xfer: '%s'\n", txn->memo) );
+
+ //test unrecoverable (kxferacc = 0)
+ if( txn->kxferacc <= 0 )
+ {
+ DB( g_print(" - unrecoverable, revert to normal xfer\n") );
+ txn->flags |= OF_CHANGED;
+ txn->paymode = PAYMODE_XFER;
+ txn->kxfer = 0;
+ txn->kxferacc = 0;
+ }
+ else
+ {
+ badxferlist = g_list_append(badxferlist, txn);
+ }
+ }
+ }
+
+ valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter);
+ }
+
+ count = g_list_length (badxferlist);
+ DB( g_print(" - found %d invalid int xfer\n", count) );
+
+ if(count <= 0)
+ {
+ ui_dialog_msg_infoerror(GTK_WINDOW(data->window), GTK_MESSAGE_INFO,
+ _("Check internal transfert result"),
+ _("No inconsistency found !")
+ );
+ }
+ else
+ {
+ gboolean do_fix;
+
+ do_fix = ui_dialog_msg_question(
+ GTK_WINDOW(data->window),
+ _("Check internal transfert result"),
+ _("Inconsistency were found: %d\n"
+ "do you want to review and fix ?"),
+ count
+ );
+
+ if(do_fix == GTK_RESPONSE_YES)
+ {
+ GList *tmplist = g_list_first(badxferlist);
+
+ while (tmplist != NULL)
+ {
+ Transaction *stxn = tmplist->data;
+
+ // (open dialog to select date tolerance in days)
+ // ( with info message)
+ // ( with check/fix button and progress bar)
+
+ //adapt this window
+ //-display the src txn
+ //-enable to display 1 of xxx if more than 1
+
+ transaction_xfer_search_or_add_child(GTK_WINDOW(data->window), stxn, TRUE);
+
+ tmplist = g_list_next(tmplist);
+ }
+ }
+ }
+
+ g_list_free (badxferlist);
+
+}
+
+