[grisbi-cvs] grisbi/src gsb_account_property.c, 1.24, 1.25 gsb_account_property.h, 1.1, 1.2 gsb_data_account.c, 1.65, 1.66 gsb_data_account.h, 1.29, 1.30 gsb_file_load.c, 1.156, 1.157 gsb_file_save.c, 1.116, 1.117

Pierre Biava pbiava at users.sourceforge.net
Tue Mar 24 20:07:52 CET 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6529/src

Modified Files:
	gsb_account_property.c gsb_account_property.h 
	gsb_data_account.c gsb_data_account.h gsb_file_load.c 
	gsb_file_save.c 
Log Message:
feature : IBAN number test

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- gsb_file_save.c	22 Mar 2009 18:53:25 -0000	1.116
+++ gsb_file_save.c	24 Mar 2009 19:07:50 -0000	1.117
@@ -937,6 +937,7 @@
 					       "\t\tBank_branch_code=\"%s\"\n"
 					       "\t\tBank_account_number=\"%s\"\n"
 					       "\t\tKey=\"%s\"\n"
+                           "\t\tBank_account_IBAN=\"%s\"\n"
 					       "\t\tInitial_balance=\"%s\"\n"
 					       "\t\tMinimum_wanted_balance=\"%s\"\n"
 					       "\t\tMinimum_authorised_balance=\"%s\"\n"
@@ -968,6 +969,7 @@
 	    gsb_data_account_get_bank_branch_code (account_number),
 	    gsb_data_account_get_bank_account_number (account_number),
 	    gsb_data_account_get_bank_account_key (account_number),
+        gsb_data_account_get_bank_account_IBAN (account_number),
 	    init_balance,
 	    mini_wanted,
 	    mini_auto,

Index: gsb_account_property.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_account_property.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- gsb_account_property.c	5 Mar 2009 19:12:29 -0000	1.24
+++ gsb_account_property.c	24 Mar 2009 19:07:50 -0000	1.25
@@ -75,7 +75,14 @@
 						   gpointer null );
 /*END_STATIC*/
 
-
+struct iso_13616_iban iso_13616_ibans [] = {
+    { "de_DE", "DEkk BBBB BBBB CCCC CCCC CC", 22 },
+    { "en_EN", "GBkk BBBB SSSS SSCC CCCC CC", 22 },
+    { "fr_BE", "BEkk BBBC CCCC CCKK", 16 },
+    { "fr_FR", "FRkk BBBB BGGG GGCC CCCC CCCC CKK", 27 },
+    { "fr_LU", "LUkk BBBC CCCC CCCC CCCC", 20 },
+    { NULL },
+};
 
 static GtkWidget *edit_bank_button = NULL;
 static GtkWidget *detail_nom_compte = NULL;
@@ -95,6 +102,7 @@
 static GtkWidget *detail_commentaire = NULL;
 static GtkWidget *button_holder_address = NULL;
 static GtkWidget *bouton_icon = NULL;
+static GtkWidget *detail_IBAN = NULL;
 
 enum origin
 {
@@ -128,6 +136,8 @@
     GtkWidget *label, *scrolled_window_text, *paddingbox;
     GtkSizeGroup * size_group;
 	GtkWidget *align;
+    struct iso_13616_iban *iban = iso_13616_ibans;
+    const gchar *locale;
 
     devel_debug ( NULL );
 
@@ -387,6 +397,55 @@
     gtk_widget_set_size_request ( detail_cle_compte, 30, -1 );
     gtk_box_pack_start ( GTK_BOX ( hbox ), detail_cle_compte, FALSE, FALSE, 0 );
 
+    /* création de la ligne du numéro IBAN */
+    /* récupération de la locale pour le format de l'IBAN */
+    locale = g_getenv ( "LANG" );
+    while (iban -> locale )
+    {
+        if ( g_strstr_len (locale, -1, iban -> locale) )
+            break;
+        iban ++;
+    }
+
+    hbox = gtk_hbox_new ( FALSE, 6 );
+    gtk_box_pack_start ( GTK_BOX(paddingbox), hbox, FALSE, FALSE, 0 );
+
+    label = gtk_label_new ( COLON(_("IBAN number")) );
+    gtk_misc_set_alignment ( GTK_MISC(label), MISC_LEFT, MISC_VERT_CENTER );
+    gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group ), label );
+    gtk_box_pack_start ( GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+    detail_IBAN = gsb_autofunc_entry_new ( NULL,
+                        NULL, NULL,
+                        G_CALLBACK (gsb_data_account_set_bank_account_IBAN),
+                        0);
+    g_signal_connect ( G_OBJECT (detail_IBAN ), "destroy",
+		       G_CALLBACK ( gtk_widget_destroyed), &detail_IBAN );
+    if ( iban -> iban )
+        gtk_entry_set_max_length ( GTK_ENTRY (detail_IBAN), 
+                        strlen (iban -> iban) );
+    else
+        gtk_entry_set_max_length ( GTK_ENTRY (detail_IBAN), 34 );
+    gtk_widget_set_size_request ( detail_IBAN, 280, -1 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), detail_IBAN, FALSE, FALSE, 0 );
+
+    hbox = gtk_hbox_new ( FALSE, 6 );
+    gtk_box_pack_start ( GTK_BOX(paddingbox), hbox, FALSE, FALSE, 0 );
+
+    label = gtk_label_new ( COLON(_("IBAN format")) );
+    gtk_misc_set_alignment ( GTK_MISC(label), MISC_LEFT, MISC_VERT_CENTER );
+    gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group ), label );
+    gtk_box_pack_start ( GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+    gchar * tmpstr = g_strdup_printf ( _("%s\n"
+                        "B = bank code, G = agency code,\n"
+                        "C = account number, R = key RIB"),
+                        iban -> iban );
+
+    label = gtk_label_new ( tmpstr );
+    gtk_misc_set_alignment ( GTK_MISC(label), MISC_LEFT, MISC_VERT_CENTER );
+    gtk_box_pack_start ( GTK_BOX(hbox), label, FALSE, FALSE, 0);
+    g_free ( tmpstr );
 
     /* création de la ligne du solde initial */
     paddingbox = new_paddingbox_with_title ( vbox, FALSE, _("Balances"));
@@ -519,6 +578,8 @@
 				  gsb_data_account_get_bank_account_number (current_account), current_account );
     gsb_autofunc_entry_set_value (detail_cle_compte,
 				  gsb_data_account_get_bank_account_key (current_account), current_account );
+    gsb_autofunc_entry_set_value (detail_IBAN,
+				  gsb_data_account_get_bank_account_IBAN (current_account), current_account );
 
     gsb_autofunc_real_set ( detail_solde_init,
 			    gsb_data_account_get_init_balance (current_account,

Index: gsb_data_account.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_account.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- gsb_data_account.c	5 Mar 2009 19:12:29 -0000	1.65
+++ gsb_data_account.c	24 Mar 2009 19:07:50 -0000	1.66
@@ -91,6 +91,7 @@
     gchar 	*bank_branch_code;
     gchar 	*bank_account_number;
     gchar 	*bank_account_key;
+    gchar   *bank_account_IBAN;
 
     /** @name reconcile sort */
     gint 	reconcile_sort_type;			/**< 1 : sort by method of payment ; 0 : let the user sort by himself */
@@ -2637,3 +2638,37 @@
 
     return account -> holder_name;
 }
+
+
+gchar *gsb_data_account_get_bank_account_IBAN (gint account_number)
+{
+    struct_account *account;
+
+    account = gsb_data_account_get_structure ( account_number );
+
+    if (!account )
+        return NULL;
+
+    return account -> bank_account_IBAN;
+}
+
+
+gboolean gsb_data_account_set_bank_account_IBAN ( gint account_number, const gchar *IBAN )
+{
+    struct_account *account;
+
+    account = gsb_data_account_get_structure ( account_number );
+
+    if (!account )
+        return FALSE;
+
+    if ( account -> bank_account_IBAN )
+        g_free ( account -> bank_account_IBAN );
+
+    if (!IBAN || !strlen (IBAN))
+        account -> bank_account_IBAN = NULL;
+    else
+        account -> bank_account_IBAN = my_strdup (IBAN);
+
+    return TRUE;
+}

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- gsb_file_load.c	23 Mar 2009 05:22:55 -0000	1.156
+++ gsb_file_load.c	24 Mar 2009 19:07:50 -0000	1.157
@@ -1363,6 +1363,15 @@
 	    continue;
 	}
 
+    if ( !strcmp ( attribute_names[i],
+		       "Bank_account_IBAN" ))
+	{
+	    gsb_data_account_set_bank_account_IBAN ( account_number,
+						       attribute_values[i]);
+	    i++;
+	    continue;
+	}
+
 	if ( !strcmp ( attribute_names[i],
 		       "Initial_balance" ))
 	{

Index: gsb_account_property.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_account_property.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gsb_account_property.h	9 Jun 2008 22:00:35 -0000	1.1
+++ gsb_account_property.h	24 Mar 2009 19:07:50 -0000	1.2
@@ -3,6 +3,12 @@
 /* START_INCLUDE_H */
 /* END_INCLUDE_H */
 
+struct iso_13616_iban
+{
+    gchar *locale;
+    gchar *iban;
+    gint nbre_char;
+};
 
 /* START_DECLARATION */
 GSList *gsb_account_property_create_combobox_list ( void );

Index: gsb_data_account.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_account.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- gsb_data_account.h	31 Jan 2009 20:11:04 -0000	1.29
+++ gsb_data_account.h	24 Mar 2009 19:07:50 -0000	1.30
@@ -153,6 +153,9 @@
 gboolean gsb_data_account_sort_list_free ( gint account_number );
 gboolean gsb_data_account_sort_list_remove ( gint account_number,
 					     gint payment_number );
+gboolean gsb_data_account_set_bank_account_IBAN ( gint account_number,
+					       const gchar *IBAN );
+gchar *gsb_data_account_get_bank_account_IBAN (gint account_number);
 /* END_DECLARATION */
 
 



More information about the cvs mailing list