/* HomeBank -- Free, easy, personal accounting for everyone.
- * Copyright (C) 1995-2016 Maxime DOYEN
+ * Copyright (C) 1995-2017 Maxime DOYEN
*
* This file is part of HomeBank.
*
DB( g_print("(repbalance) compute_full\n") );
g_list_free(data->ope_list);
- data->ope_list = hbfile_transaction_get_all(selkey);
+ data->ope_list = hbfile_transaction_get_all();
+
+ if(g_list_length(data->ope_list) == 0) return;
Transaction *omin = g_list_first(data->ope_list)->data;
Transaction *omax = g_list_last(data->ope_list)->data;
repbalance_compute_full_datas(acckey, selectall, data);
+ /* do nothing if no transaction */
+ if(g_list_length(data->ope_list) == 0) return;
+
+
/* clear and detach our model */
model = gtk_tree_view_get_model(GTK_TREE_VIEW(data->LV_report));
gtk_list_store_clear (GTK_LIST_STORE(model));
g_signal_handler_unblock(data->PO_maxdate, data->handler_id[HID_REPBALANCE_MAXDATE]);
ui_acc_comboboxentry_populate(GTK_COMBO_BOX(data->PO_acc), GLOBALS->h_acc, ACC_LST_INSERT_REPORT);
- ui_acc_comboboxentry_set_active(GTK_COMBO_BOX(data->PO_acc), accnum);
+ if( accnum )
+ ui_acc_comboboxentry_set_active(GTK_COMBO_BOX(data->PO_acc), accnum);
+ else
+ gtk_combo_box_set_active(GTK_COMBO_BOX(data->PO_acc), 0);
}
// data to action callbacks is set here (data)
gtk_action_group_add_actions (actions, entries, n_entries, data);
- gtk_action_group_add_toggle_actions (actions,
+ gtk_action_group_add_toggle_actions (actions,
toggle_entries, n_toggle_entries,
data);