[grisbi-cvs] grisbi/src balance_estimate_hist.c, 1.12, 1.13 balance_estimate_tab.c, 1.48, 1.49 balance_estimate_tab.h, 1.10, 1.11 classement_echeances.c, 1.14, 1.15 classement_echeances.h, 1.8, 1.9 gsb_data_transaction.c, 1.81, 1.82 gsb_data_transaction.h, 1.37, 1.38 import.c, 1.323, 1.324
Pierre Biava
pbiava at users.sourceforge.net
Fri Mar 5 23:18:57 CET 2010
- Previous message: [grisbi-cvs] grisbi/src gsb_reconcile.c,1.46,1.47
- Next message: [grisbi-cvs] grisbi/po cs.po, 1.95, 1.96 da.po, 1.101, 1.102 de.po, 1.175, 1.176 el.po, 1.65, 1.66 eo.po, 1.58, 1.59 es.po, 1.170, 1.171 fa.po, 1.88, 1.89 fr.po, 1.234, 1.235 grisbi.pot, 1.136, 1.137 he.po, 1.94, 1.95 it.po, 1.94, 1.95 nl.po, 1.93, 1.94 pl.po, 1.99, 1.100 pt_BR.po, 1.96, 1.97 ro.po, 1.95, 1.96 ru.po, 1.93, 1.94 zh_CN.po, 1.89, 1.90
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6432/src
Modified Files:
balance_estimate_hist.c balance_estimate_tab.c
balance_estimate_tab.h classement_echeances.c
classement_echeances.h gsb_data_transaction.c
gsb_data_transaction.h import.c
Log Message:
Minor corrections for the budget estimate
Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- gsb_data_transaction.c 30 Jan 2010 17:04:12 -0000 1.81
+++ gsb_data_transaction.c 5 Mar 2010 22:18:55 -0000 1.82
@@ -2631,6 +2631,54 @@
}
+/**
+ *
+ *
+ *
+ *
+ * */
+gsb_real gsb_data_transaction_get_last_transaction_with_div_sub_div (
+ gint account_number,
+ gint div_number,
+ gint sub_div_nb,
+ gint type_div )
+{
+ GSList *tmp_list;
+
+ tmp_list = g_slist_copy ( transactions_list );
+
+ tmp_list = g_slist_sort (tmp_list,
+ (GCompareFunc) classement_sliste_transactions_par_date_decroissante );
+
+ while ( tmp_list )
+ {
+ struct_transaction *transaction;
+
+ transaction = tmp_list -> data;
+
+ if ( type_div == 0
+ && transaction -> account_number == account_number
+ && transaction -> category_number == div_number
+ && transaction -> sub_category_number == sub_div_nb )
+ return transaction -> transaction_amount;
+ else if ( type_div == 1
+ && transaction -> account_number == account_number
+ && transaction -> budgetary_number == div_number
+ && transaction -> sub_budgetary_number == sub_div_nb )
+ return transaction -> transaction_amount;
+
+ tmp_list = tmp_list -> next;
+ }
+ return null_real;
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: gsb_data_transaction.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- gsb_data_transaction.h 30 Jan 2010 17:04:12 -0000 1.37
+++ gsb_data_transaction.h 5 Mar 2010 22:18:55 -0000 1.38
@@ -51,6 +51,11 @@
gint gsb_data_transaction_get_financial_year_number ( gint transaction_number );
const gchar *gsb_data_transaction_get_id ( gint transaction_number );
gint gsb_data_transaction_get_last_number (void);
+gsb_real gsb_data_transaction_get_last_transaction_with_div_sub_div (
+ gint account_number,
+ gint div_number,
+ gint sub_div_nb,
+ gint type_div );
gint gsb_data_transaction_get_marked_transaction ( gint transaction_number );
const gchar *gsb_data_transaction_get_method_of_payment_content ( gint transaction_number );
gint gsb_data_transaction_get_method_of_payment_number ( gint transaction_number );
Index: balance_estimate_tab.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- balance_estimate_tab.h 3 Mar 2010 22:21:49 -0000 1.10
+++ balance_estimate_tab.h 5 Mar 2010 22:18:55 -0000 1.11
@@ -27,7 +27,6 @@
/* START_DECLARATION */
GtkWidget * bet_array_create_page ( void );
-//~ GtkWidget *bet_array_create_estimate_page ( void );
void bet_array_list_add_new_line ( GtkTreeModel *tab_model,
GtkTreeModel *model,
GtkTreeIter *iter,
Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.323
retrieving revision 1.324
diff -u -d -r1.323 -r1.324
--- import.c 21 Feb 2010 16:14:52 -0000 1.323
+++ import.c 5 Mar 2010 22:18:55 -0000 1.324
@@ -127,10 +127,8 @@
gint account_number, gchar * origine );
static gboolean gsb_import_define_action ( struct struct_compte_importation *imported_account,
gint account_number,
- GDate *first_date_import,
- GDate *last_date_import );
+ GDate *first_date_import );
static GDate *gsb_import_get_first_date ( GSList *import_list );
-static GDate *gsb_import_get_last_date ( GSList *import_list );
static gboolean gsb_import_gunzip_file ( gchar *filename );
static gboolean gsb_import_set_id_compte ( gint account_nb, gchar *imported_id );
static gboolean gsb_import_set_tmp_file ( gchar *filename,
@@ -1890,7 +1888,6 @@
{
GSList *list_tmp;
GDate *first_date_import = NULL;
- GDate *last_date_import = NULL;
gint demande_confirmation;
/* check the imported account id, and set it in the grisbi account if it doesn't
@@ -1910,17 +1907,15 @@
* a pu le changer), et on demande à l'utilisateur quoi faire, sinon on enregistre l'opé
*/
- /* pour gagner en rapidité, on va récupérer les dates de la première et de la dernière
- * opération qui sont dans le fichier importé */
+ /* pour gagner en rapidité, on va récupérer la date de la première
+ * opération qui est dans le fichier importé */
first_date_import = gsb_import_get_first_date ( imported_account -> operations_importees );
- last_date_import = gsb_import_get_last_date ( imported_account -> operations_importees );
/* ok, now first_date_import contains the firt transaction date used in that account,
* can check the imported transactions */
demande_confirmation = gsb_import_define_action ( imported_account,
account_number,
- first_date_import,
- last_date_import );
+ first_date_import );
/* if we are not sure about some transactions, ask now */
if ( demande_confirmation )
@@ -1994,8 +1989,7 @@
*/
gboolean gsb_import_define_action ( struct struct_compte_importation *imported_account,
gint account_number,
- GDate *first_date_import,
- GDate *last_date_import )
+ GDate *first_date_import )
{
GSList *list_tmp;
gint demande_confirmation = FALSE;
@@ -2060,11 +2054,29 @@
g_date_compare ( gsb_data_transaction_get_date ( transaction_number ),
first_date_import ) > 0 )
{
+ GDate *date_debut_comparaison;
+ GDate *date_fin_comparaison;
+
+ date_debut_comparaison = g_date_new_dmy ( g_date_get_day ( imported_transaction -> date ),
+ g_date_get_month ( imported_transaction -> date ),
+ g_date_get_year ( imported_transaction -> date ));
+ g_date_subtract_days ( date_debut_comparaison,
+ valeur_echelle_recherche_date_import );
+
+ date_fin_comparaison = g_date_new_dmy ( g_date_get_day ( imported_transaction -> date ),
+ g_date_get_month ( imported_transaction -> date ),
+ g_date_get_year ( imported_transaction -> date ));
+ g_date_add_days ( date_fin_comparaison,
+ valeur_echelle_recherche_date_import );
+
if ( !gsb_real_cmp ( gsb_data_transaction_get_amount (
transaction_number), imported_transaction -> montant )
&&
- g_date_compare ( gsb_data_transaction_get_date (
- transaction_number), last_date_import ) <= 0
+ ( g_date_compare ( gsb_data_transaction_get_date (
+ transaction_number), date_debut_comparaison ) >= 0 )
+ &&
+ ( g_date_compare ( gsb_data_transaction_get_date (
+ transaction_number ), date_fin_comparaison ) <= 0 )
&&
!imported_transaction -> ope_de_ventilation
&&
@@ -2078,6 +2090,8 @@
imported_transaction -> ope_correspondante = transaction_number;
demande_confirmation = TRUE;
}
+ g_date_free ( date_debut_comparaison );
+ g_date_free ( date_fin_comparaison );
}
list_tmp_transactions = list_tmp_transactions -> next;
}
@@ -3264,42 +3278,6 @@
}
-/**
- * get last date of the imported file
- *
- *
- * \param
- *
- * return
- */
-GDate *gsb_import_get_last_date ( GSList *import_list )
-{
- GSList *list_tmp;
- GDate *last_date = NULL;
-
- list_tmp = import_list;
-
- while ( list_tmp )
- {
- struct struct_ope_importation *imported_transaction;
-
- imported_transaction = list_tmp -> data;
-
- if ( !last_date
- ||
- g_date_compare ( imported_transaction -> date, last_date ) > 0 )
- last_date = imported_transaction -> date;
-
- list_tmp = list_tmp -> next;
- }
-
- last_date = gsb_date_copy ( last_date );
- g_date_add_days ( last_date, valeur_echelle_recherche_date_import );
-
- return last_date;
-}
-
-
/* *******************************************************************************/
Index: classement_echeances.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/classement_echeances.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- classement_echeances.h 25 Feb 2010 21:38:17 -0000 1.8
+++ classement_echeances.h 5 Mar 2010 22:18:55 -0000 1.9
@@ -10,5 +10,7 @@
gpointer manual );
gint classement_sliste_transactions_par_date ( gpointer transaction_pointer_1,
gpointer transaction_pointer_2 );
+gint classement_sliste_transactions_par_date_decroissante ( gpointer transaction_pointer_1,
+ gpointer transaction_pointer_2 );
/* END_DECLARATION */
#endif
Index: classement_echeances.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/classement_echeances.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- classement_echeances.c 25 Feb 2010 21:38:17 -0000 1.14
+++ classement_echeances.c 5 Mar 2010 22:18:55 -0000 1.15
@@ -74,7 +74,7 @@
/* ************************************************************************* */
-/* Classement de deux opérations par date */
+/* Classement de deux opérations par date croissante */
/* ************************************************************************* */
gint classement_sliste_transactions_par_date ( gpointer transaction_pointer_1,
gpointer transaction_pointer_2 )
@@ -95,6 +95,34 @@
return -1;
}
+
+/**
+ * Classement de deux opérations par date décroissante
+ *
+ *
+ *
+ * */
+gint classement_sliste_transactions_par_date_decroissante ( gpointer transaction_pointer_1,
+ gpointer transaction_pointer_2 )
+{
+ const GDate *date;
+ gint transaction_number_1;
+ gint transaction_number_2;
+
+ transaction_number_1 = gsb_data_transaction_get_transaction_number (
+ transaction_pointer_1 );
+ transaction_number_2 = gsb_data_transaction_get_transaction_number (
+ transaction_pointer_2 );
+
+ date = gsb_data_transaction_get_date ( transaction_number_1 );
+ if ( date )
+ return - ( g_date_compare ( date,
+ gsb_data_transaction_get_date ( transaction_number_2 ) ) );
+ else
+ return -1;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- balance_estimate_tab.c 3 Mar 2010 22:21:48 -0000 1.48
+++ balance_estimate_tab.c 5 Mar 2010 22:18:55 -0000 1.49
@@ -81,7 +81,7 @@
static gboolean bet_array_list_button_press ( GtkWidget *tree_view,
GdkEventButton *ev );
static void bet_array_list_context_menu ( GtkWidget *tree_view );
-static void bet_array_list_delete_menu ( GtkWidget *menu_item,
+static void bet_array_list_redo_menu ( GtkWidget *menu_item,
GtkTreeSelection *tree_selection );
static void bet_array_list_update_balance ( GtkTreeModel *model );
static void bet_array_refresh_scheduled_data ( GtkTreeModel *tab_model,
@@ -134,8 +134,8 @@
*/
void bet_array_update_estimate_tab ( void )
{
- bet_historical_populate_data ( );
- bet_array_refresh_estimate_tab ( );
+ bet_historical_populate_data ( );
+ bet_array_refresh_estimate_tab ( );
}
@@ -260,6 +260,7 @@
GtkWidget *tree_view;
GtkTreeIter iter;
GtkTreeModel *tree_model;
+ gchar *color_str = NULL;
gchar *str_date_init;
gchar *str_date_min;
gchar *str_date_max;
@@ -321,6 +322,12 @@
str_current_balance = gsb_real_get_string_with_currency ( current_balance,
gsb_data_account_get_currency ( selected_account ), TRUE );
+ if ( current_balance.mantissa < 0 )
+ color_str = "red";
+ else
+ color_str = NULL;
+
+
/* set the titles of tabs module budget */
title = g_strdup_printf (
_("Balance estimate of the account \"%s\" from %s to %s"),
@@ -355,7 +362,8 @@
SPP_ESTIMATE_TREE_DESC_COLUMN, tmp_str,
SPP_ESTIMATE_TREE_BALANCE_COLUMN, str_current_balance,
SPP_ESTIMATE_TREE_AMOUNT_COLUMN, str_amount,
- -1);
+ SPP_ESTIMATE_TREE_BALANCE_COLOR, color_str,
+ -1);
g_value_unset ( &date_value );
g_free ( str_date_init );
@@ -1033,13 +1041,13 @@
gtk_widget_show ( menu_item );
/* Delete item */
- menu_item = gtk_image_menu_item_new_with_label ( _("Delete selection") );
+ menu_item = gtk_image_menu_item_new_with_label ( _("Reset data") );
gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
- gtk_image_new_from_stock ( GTK_STOCK_DELETE,
+ gtk_image_new_from_stock ( GTK_STOCK_REFRESH,
GTK_ICON_SIZE_MENU ) );
g_signal_connect ( G_OBJECT ( menu_item ),
"activate",
- G_CALLBACK ( bet_array_list_delete_menu ),
+ G_CALLBACK ( bet_array_list_redo_menu ),
tree_selection );
gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
@@ -1082,7 +1090,7 @@
* /param row selected
*
* */
-void bet_array_list_delete_menu ( GtkWidget *menu_item,
+void bet_array_list_redo_menu ( GtkWidget *menu_item,
GtkTreeSelection *tree_selection )
{
GtkTreeModel *model;
@@ -1092,8 +1100,7 @@
&model, &iter ) )
return;
- gtk_tree_store_remove ( GTK_TREE_STORE ( model ), &iter );
- bet_array_list_update_balance ( model );
+ bet_array_update_estimate_tab ( );
}
Index: balance_estimate_hist.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_hist.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- balance_estimate_hist.c 3 Mar 2010 22:21:48 -0000 1.12
+++ balance_estimate_hist.c 5 Mar 2010 22:18:55 -0000 1.13
@@ -65,8 +65,15 @@
/*END_INCLUDE*/
/*START_STATIC*/
+static void bet_historical_add_average_amount ( GtkWidget *menu_item,
+ GtkTreeSelection *tree_selection );
+static void bet_historical_add_last_amount ( GtkWidget *menu_item,
+ GtkTreeSelection *tree_selection );
static gboolean bet_historical_amount_differ_average ( GtkTreeModel *model,
GtkTreeIter *iter );
+static gboolean bet_historical_button_press ( GtkWidget *tree_view,
+ GdkEventButton *ev );
+static void bet_historical_context_menu ( GtkWidget *tree_view );
static void bet_historical_div_cell_edited (GtkCellRendererText *cell,
const gchar *path_string,
const gchar *new_text,
@@ -531,6 +538,12 @@
SPP_HISTORICAL_RETAINED_AMOUNT, new_text,
-1 );
+ if ( is_parent )
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ &parent,
+ SPP_HISTORICAL_EDITED_COLUMN, FALSE,
+ -1);
+
if ( is_parent && bet_historical_get_full_div ( model, &parent ) )
{
number = bet_historical_get_children_amount ( model, &parent );
@@ -719,6 +732,11 @@
G_CALLBACK ( bet_historical_row_expanded_event ),
tree_model );
+ g_signal_connect ( G_OBJECT ( tree_view ),
+ "button-press-event",
+ G_CALLBACK ( bet_historical_button_press ),
+ NULL );
+
gtk_widget_show_all ( scrolled_window );
return tree_view;
@@ -978,17 +996,27 @@
if ( bet_data_search_div_hist ( account_nb, div_number, sub_sh -> div ) )
{
- //~ printf ("account_nb = %d div_number = %d sub_sh -> div = %d\n", account_nb, div_number, sub_sh -> div );
- retained = bet_data_get_div_amount ( account_nb, div_number, sub_sh -> div );
- if ( str_amount )
- g_free ( str_amount );
- str_amount = gsb_real_save_real_to_string ( retained, 2 );
- str_retained = gsb_real_get_string_with_currency ( retained,
- gsb_data_account_get_currency ( sh -> account_nb ), TRUE );
-
if ( bet_data_get_div_edited ( account_nb, div_number, sub_sh -> div ) )
{
+ //~ printf ("account_nb = %d div_number = %d sub_sh -> div = %d\n", account_nb, div_number, sub_sh -> div );
+ retained = bet_data_get_div_amount ( account_nb, div_number, sub_sh -> div );
+ if ( str_amount )
+ g_free ( str_amount );
+ str_amount = gsb_real_save_real_to_string ( retained, 2 );
+ str_retained = gsb_real_get_string_with_currency ( retained,
+ gsb_data_account_get_currency ( sh -> account_nb ), TRUE );
+
edited = FALSE;
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ &parent,
+ SPP_HISTORICAL_EDITED_COLUMN, edited,
+ -1);
+ }
+ else
+ {
+ bet_data_set_div_amount ( account_nb, div_number, sub_sh -> div, average );
+ str_retained = g_strdup ( str_average );
+ edited = TRUE;
}
gtk_tree_store_set ( GTK_TREE_STORE ( model ),
&fils,
@@ -1399,6 +1427,217 @@
/**
+ * called when we press a button on the list
+ *
+ * \param tree_view
+ * \param ev
+ *
+ * \return FALSE
+ * */
+gboolean bet_historical_button_press ( GtkWidget *tree_view,
+ GdkEventButton *ev )
+{
+ /* show the popup */
+ if ( ev -> button == RIGHT_BUTTON )
+ bet_historical_context_menu ( tree_view );
+
+ return FALSE;
+}
+
+
+/**
+ * Pop up a menu with several actions to apply to historical list.
+ *
+ * \param
+ *
+ */
+void bet_historical_context_menu ( GtkWidget *tree_view )
+{
+ GtkWidget *menu, *menu_item;
+ GtkTreeModel *model;
+ GtkTreeSelection *tree_selection;
+ GtkTreeIter iter;
+
+ tree_selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+
+ if ( !gtk_tree_selection_get_selected ( GTK_TREE_SELECTION ( tree_selection ),
+ &model, &iter ) )
+ return;
+
+ menu = gtk_menu_new ();
+
+ /* Add last amount menu */
+ menu_item = gtk_image_menu_item_new_with_label ( _("Assign the amount of the last operation") );
+ gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
+ gtk_image_new_from_stock ( GTK_STOCK_ADD,
+ GTK_ICON_SIZE_MENU ) );
+
+ g_signal_connect ( G_OBJECT ( menu_item ),
+ "activate",
+ G_CALLBACK ( bet_historical_add_last_amount ),
+ tree_selection );
+
+ if ( gtk_tree_model_iter_n_children ( model, &iter ) > 0 )
+ gtk_widget_set_sensitive ( menu_item, FALSE );
+ else
+ gtk_widget_set_sensitive ( menu_item, TRUE );
+
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+
+ /* Separator */
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new ( ) );
+ gtk_widget_show ( menu_item );
+
+
+ /* Add average amount menu */
+ menu_item = gtk_image_menu_item_new_with_label ( _("Copy the average amount") );
+ gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
+ gtk_image_new_from_stock ( GTK_STOCK_COPY,
+ GTK_ICON_SIZE_MENU ) );
+
+ g_signal_connect ( G_OBJECT ( menu_item ),
+ "activate",
+ G_CALLBACK ( bet_historical_add_average_amount ),
+ tree_selection );
+
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+
+ /* Finish all. */
+ gtk_widget_show_all ( menu );
+ gtk_menu_popup ( GTK_MENU( menu ), NULL, NULL, NULL, NULL,
+ 3, gtk_get_current_event_time ( ) );
+}
+
+
+/**
+ * add the amount of the last transaction with the same division and sub-division
+ *
+ * /param menu item
+ * /param row selected
+ *
+ * */
+void bet_historical_add_last_amount ( GtkWidget *menu_item,
+ GtkTreeSelection *tree_selection )
+{
+ GtkTreeModel *model;
+ GtkTreeIter parent;
+ GtkTreeIter iter;
+ gint account_nb;
+ gint div_number;
+ gint sub_div_nb;
+ gint currency_number;
+ gchar *tmp_str;
+ gchar *str_amount;
+ gsb_real amount;
+
+ if ( !gtk_tree_selection_get_selected ( GTK_TREE_SELECTION ( tree_selection ),
+ &model, &iter ) )
+ return;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter,
+ SPP_HISTORICAL_ACCOUNT_NUMBER, &account_nb,
+ SPP_HISTORICAL_DIV_NUMBER, &div_number,
+ SPP_HISTORICAL_SUB_DIV_NUMBER, &sub_div_nb,
+ -1 );
+
+ amount = gsb_data_transaction_get_last_transaction_with_div_sub_div (
+ account_nb,
+ div_number,
+ sub_div_nb,
+ etat.bet_hist_data );
+ str_amount = gsb_real_save_real_to_string ( amount, 2 );
+
+ currency_number = gsb_data_account_get_currency ( account_nb );
+ tmp_str = gsb_real_get_string_with_currency ( amount, currency_number, TRUE );
+ //~ printf ("div = %d sub_div_nb = %d tmp_str = %s\n", div_number, sub_div_nb, tmp_str);
+ if ( bet_data_search_div_hist ( account_nb, div_number, sub_div_nb ) == FALSE )
+ bet_data_add_div_hist ( account_nb, div_number, sub_div_nb );
+
+ bet_data_set_div_edited ( account_nb, div_number, sub_div_nb, TRUE );
+ bet_data_set_div_amount ( account_nb, div_number, sub_div_nb, amount );
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ), &iter,
+ SPP_HISTORICAL_SELECT_COLUMN, TRUE,
+ SPP_HISTORICAL_RETAINED_COLUMN, tmp_str,
+ SPP_HISTORICAL_RETAINED_AMOUNT, str_amount,
+ SPP_HISTORICAL_ACCOUNT_NUMBER, account_nb,
+ SPP_HISTORICAL_DIV_NUMBER, div_number,
+ SPP_HISTORICAL_SUB_DIV_NUMBER, sub_div_nb,
+ -1 );
+
+ if ( gtk_tree_model_iter_parent ( GTK_TREE_MODEL ( model ), &parent, &iter ) )
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ &parent,
+ SPP_HISTORICAL_EDITED_COLUMN, FALSE,
+ -1);
+
+ bet_array_refresh_estimate_tab ( );
+
+ if ( etat.modification_fichier == 0 )
+ modification_fichier ( TRUE );
+}
+
+
+/**
+ * add the average amount of the item
+ *
+ * /param menu item
+ * /param row selected
+ *
+ * */
+void bet_historical_add_average_amount ( GtkWidget *menu_item,
+ GtkTreeSelection *tree_selection )
+{
+ GtkTreeModel *model;
+ //~ GtkTreeIter parent;
+ GtkTreeIter iter;
+ gint account_nb;
+ gint div_number;
+ gint sub_div_nb;
+ gchar *str_average;
+ gchar *str_amount;
+ gsb_real amount;
+
+ if ( !gtk_tree_selection_get_selected ( GTK_TREE_SELECTION ( tree_selection ),
+ &model, &iter ) )
+ return;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter,
+ SPP_HISTORICAL_AVERAGE_COLUMN, &str_average,
+ SPP_HISTORICAL_AVERAGE_AMOUNT, &str_amount,
+ SPP_HISTORICAL_ACCOUNT_NUMBER, &account_nb,
+ SPP_HISTORICAL_DIV_NUMBER, &div_number,
+ SPP_HISTORICAL_SUB_DIV_NUMBER, &sub_div_nb,
+ -1 );
+
+ amount = gsb_real_import_from_string ( str_amount );
+ if ( bet_data_search_div_hist ( account_nb, div_number, sub_div_nb ) == FALSE )
+ bet_data_add_div_hist ( account_nb, div_number, sub_div_nb );
+
+ bet_data_set_div_edited ( account_nb, div_number, sub_div_nb, FALSE );
+ bet_data_set_div_amount ( account_nb, div_number, sub_div_nb, amount );
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ), &iter,
+ SPP_HISTORICAL_SELECT_COLUMN, TRUE,
+ SPP_HISTORICAL_RETAINED_COLUMN, str_average,
+ SPP_HISTORICAL_RETAINED_AMOUNT, str_amount,
+ SPP_HISTORICAL_ACCOUNT_NUMBER, account_nb,
+ SPP_HISTORICAL_DIV_NUMBER, div_number,
+ SPP_HISTORICAL_SUB_DIV_NUMBER, sub_div_nb,
+ -1 );
+
+ //~ if ( gtk_tree_model_iter_parent ( GTK_TREE_MODEL ( model ), &parent, &iter ) )
+ //~ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ //~ &parent,
+ //~ SPP_HISTORICAL_EDITED_COLUMN, TRUE,
+ //~ -1);
+
+ bet_array_refresh_estimate_tab ( );
+
+ if ( etat.modification_fichier == 0 )
+ modification_fichier ( TRUE );
+}
+
+
+/**
*
*
*
- Previous message: [grisbi-cvs] grisbi/src gsb_reconcile.c,1.46,1.47
- Next message: [grisbi-cvs] grisbi/po cs.po, 1.95, 1.96 da.po, 1.101, 1.102 de.po, 1.175, 1.176 el.po, 1.65, 1.66 eo.po, 1.58, 1.59 es.po, 1.170, 1.171 fa.po, 1.88, 1.89 fr.po, 1.234, 1.235 grisbi.pot, 1.136, 1.137 he.po, 1.94, 1.95 it.po, 1.94, 1.95 nl.po, 1.93, 1.94 pl.po, 1.99, 1.100 pt_BR.po, 1.96, 1.97 ro.po, 1.95, 1.96 ru.po, 1.93, 1.94 zh_CN.po, 1.89, 1.90
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cvs
mailing list