[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-124-g7c2adfb
Pierre Biava
nobody at users.sourceforge.net
Mon Apr 4 22:45:37 CEST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, master has been updated
via 7c2adfb561aae5f7c6ca07669c03d62436377a7f (commit)
from 58c8a40befbcdd0a9070b2e2d8deb3ead7361029 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7c2adfb561aae5f7c6ca07669c03d62436377a7f
Author: pbiava <pierre.biava at nerim.net>
Date: Mon Apr 4 22:29:39 2011 +0200
fixed a bug in creation of payees and creation of a sub-budgetary line
(cherry picked from commit 7b3223e25116920826a0bee72ae9398dc06c9caa)
-----------------------------------------------------------------------
Changes:
diff --git a/src/gsb_data_budget.c b/src/gsb_data_budget.c
index e71e7a9..ef37e6d 100644
--- a/src/gsb_data_budget.c
+++ b/src/gsb_data_budget.c
@@ -722,16 +722,18 @@ gint gsb_data_budget_get_sub_budget_number_by_name ( gint budget_number,
if ( list_tmp )
{
- struct_sub_budget *sub_budget;
+ struct_sub_budget *sub_budget;
- sub_budget = list_tmp -> data;
- sub_budget_number = sub_budget -> sub_budget_number;
+ sub_budget = list_tmp -> data;
+ sub_budget_number = sub_budget -> sub_budget_number;
}
else
{
- if (create)
- sub_budget_number = gsb_data_budget_new_sub_budget ( budget_number,
- name);
+ if ( create )
+ {
+ sub_budget_number = gsb_data_budget_new_sub_budget ( budget_number, name );
+ gsb_budget_update_combofix ( FALSE );
+ }
}
return sub_budget_number;
}
@@ -1529,53 +1531,51 @@ void gsb_data_budget_set_budget_from_string ( gint transaction_number,
* but the 2 parts are exactly the same, exept the call to the functions */
if (is_transaction)
{
- if (!string || strlen ( string ) == 0 )
- {
- gsb_data_transaction_set_budgetary_number ( transaction_number, 0 );
- gsb_data_transaction_set_sub_budgetary_number ( transaction_number, 0 );
- return;
- }
+ if (!string || strlen ( string ) == 0 )
+ {
+ gsb_data_transaction_set_budgetary_number ( transaction_number, 0 );
+ gsb_data_transaction_set_sub_budgetary_number ( transaction_number, 0 );
+ return;
+ }
+
+ tab_char = g_strsplit ( string, " : ", 2 );
- tab_char = g_strsplit ( string,
- " : ",
- 2 );
-
- /* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
- budget_number = gsb_data_budget_get_number_by_name ( g_strstrip (tab_char[0]),
- TRUE,
- gsb_data_transaction_get_amount (transaction_number).mantissa <0 );
- gsb_data_transaction_set_budgetary_number ( transaction_number,
- budget_number );
- if ( tab_char[1] )
- gsb_data_transaction_set_sub_budgetary_number ( transaction_number,
- gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
- g_strstrip (tab_char[1]),
- TRUE ));
+ /* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
+ budget_number = gsb_data_budget_get_number_by_name ( g_strstrip ( tab_char[0] ),
+ TRUE,
+ gsb_data_transaction_get_amount ( transaction_number ).mantissa < 0 );
+ gsb_data_transaction_set_budgetary_number ( transaction_number, budget_number );
+
+ if ( tab_char[1] )
+ gsb_data_transaction_set_sub_budgetary_number ( transaction_number,
+ gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
+ g_strstrip (tab_char[1]),
+ TRUE ));
}
else
{
- if (!string)
- {
- gsb_data_scheduled_set_budgetary_number ( transaction_number, 0 );
- gsb_data_scheduled_set_sub_budgetary_number ( transaction_number, 0 );
- return;
- }
+ if (!string)
+ {
+ gsb_data_scheduled_set_budgetary_number ( transaction_number, 0 );
+ gsb_data_scheduled_set_sub_budgetary_number ( transaction_number, 0 );
+ return;
+ }
- tab_char = g_strsplit ( string,
- " : ",
- 2 );
-
- /* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
- budget_number = gsb_data_budget_get_number_by_name ( tab_char[0],
- TRUE,
- gsb_data_scheduled_get_amount (transaction_number).mantissa <0 );
- gsb_data_scheduled_set_budgetary_number ( transaction_number,
- budget_number );
- if ( tab_char[1] )
- gsb_data_scheduled_set_sub_budgetary_number ( transaction_number,
- gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
- tab_char[1],
- TRUE ));
+ tab_char = g_strsplit ( string,
+ " : ",
+ 2 );
+
+ /* we don't mind if tab_char exists and others, all the checks will be done in ...get_number_by_name */
+ budget_number = gsb_data_budget_get_number_by_name ( tab_char[0],
+ TRUE,
+ gsb_data_scheduled_get_amount (transaction_number).mantissa <0 );
+ gsb_data_scheduled_set_budgetary_number ( transaction_number,
+ budget_number );
+ if ( tab_char[1] )
+ gsb_data_scheduled_set_sub_budgetary_number ( transaction_number,
+ gsb_data_budget_get_sub_budget_number_by_name ( budget_number,
+ tab_char[1],
+ TRUE ));
}
g_strfreev (tab_char);
}
diff --git a/src/gsb_data_payee.c b/src/gsb_data_payee.c
index 525e394..f76c5e9 100644
--- a/src/gsb_data_payee.c
+++ b/src/gsb_data_payee.c
@@ -355,31 +355,28 @@ gint gsb_data_payee_set_new_number ( gint no_payee,
* \return the number of the payee or 0 if problem
* */
gint gsb_data_payee_get_number_by_name ( const gchar *name,
- gboolean create )
+ gboolean create )
{
GSList *list_tmp;
gint payee_number = 0;
list_tmp = g_slist_find_custom ( payee_list,
- name,
- (GCompareFunc) gsb_data_payee_get_pointer_from_name_in_glist );
+ name,
+ (GCompareFunc) gsb_data_payee_get_pointer_from_name_in_glist );
if ( list_tmp )
{
- struct_payee *payee;
-
- payee = list_tmp -> data;
- payee_number = payee -> payee_number;
+ struct_payee *payee;
+
+ payee = list_tmp -> data;
+ payee_number = payee -> payee_number;
}
else
{
- if (create)
- {
- payee_number = gsb_data_payee_new (name);
- gtk_combofix_append_text ( GTK_COMBOFIX (
- gsb_form_widget_get_widget ( TRANSACTION_FORM_PARTY ) ), name );
-;
- }
+ if (create)
+ {
+ payee_number = gsb_data_payee_new ( name );
+ }
}
return payee_number;
}
hooks/post-receive
--
grisbi
More information about the cvs
mailing list