Commit db10943b authored by Maxime Doyen's avatar Maxime Doyen

merged 4.5.1

parent 5d8b8ffe
HomeBank -- Free, easy, personal accounting for everyone.
---------------------------------------------------------
Active authors:
* Maxime Doyen
Maxime Doyen
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
......@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
......@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
......@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
......@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
......@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
......@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
......@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
......@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
......@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
This diff is collapsed.
This diff is collapsed.
......@@ -27,14 +27,21 @@ AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
AC_CHECK_LIB(m, pow)
# Usual flags
CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes "
# general usage flags
CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes"
# pre-release #1 - GLib/Gtk deprecated flags
#CFLAGS="${CFLAGS} -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
# extended flags
#CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter"
# pre-relase # 2 - error as warning for
#CFLAGS="${CFLAGS} -Werror "
#CFLAGS="${CFLAGS} -Werror"
# GLib/Gtk deprecated flags
#CFLAGS="${CFLAGS} -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
# gtk3 migration
#CFLAGS="${CFLAGS} -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
# Check for libofx
AC_CHECK_HEADER(libofx/libofx.h,,noofx=true)
......@@ -75,7 +82,7 @@ AC_C_VOLATILE
AC_CHECK_FUNCS([floor localeconv memset modf pow setlocale sqrt strcasecmp strtoul])
# International support
#ALL_LINGUAS="am ar ast be bg br bs ca cs da de el en_AU en_CA en_GB es et eu fa fi fr gl he hr ht hu id is it ja ka kk kn ko lt lv mi ml ms nb nds nl oc pl pt_BR pt pt_PT ro ru sk sl sn sr sv ta th tr uk ur uz vi zh_CN zh_HK zh_TW"
#ALL_LINGUAS="af ar ast be bg ca cs cy da de el en_AU en_CA en_GB es et eu fa fi fr ga gl he hr hu id is it ja ka ko lt lv ms nb nds nl oc pl pt_BR pt pt_PT ro ru si sk sl sr sv tr uk vi zh_CN zh_TW"
#AM_GLIB_GNU_GETTEXT
......
This diff is collapsed.
......@@ -81,7 +81,7 @@ struct account_data
};
GtkWidget *create_account_window(gint accnum, Account *acc);
GtkWidget *create_account_window(guint32 accnum, Account *acc);
void account_init_window(GtkWidget *widget, gpointer user_data);
......
This diff is collapsed.
......@@ -71,6 +71,7 @@ struct hbfile_data
GtkWidget *create_hbfile_window(GtkWidget *do_widget);
void ui_mainwindow_populate_accounts(GtkWidget *widget, gpointer user_data);
void ui_mainwindow_open_internal(GtkWidget *widget, gpointer user_data);
void ui_mainwindow_update(GtkWidget *widget, gpointer user_data);
void ui_mainwindow_action_help_welcome(void);
......
......@@ -104,7 +104,8 @@ enum
LST_DSPOPE_INCOME, /* fake column */
LST_DSPOPE_CATEGORY, /* fake column */
LST_DSPOPE_TAGS, /* fake column */
/* here we insert accoutn column, only used for detail */
LST_DSPOPE_BALANCE,
/* here we insert account column, only used for detail */
LST_DSPOPE_ACCOUNT,
NUM_LST_DSPOPE
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -269,7 +269,7 @@ da_acc_get_by_imp_name(gchar *name)
Account *
da_acc_get(guint32 key)
{
DB( g_print("da_acc_get_account\n") );
//DB( g_print("da_acc_get\n") );
return g_hash_table_lookup(GLOBALS->h_acc, &key);
}
......@@ -412,14 +412,34 @@ GList *list;
}
}
static gchar *
account_get_stripname(gchar *name)
{
gchar *stripname = g_strdup(name);
g_strstrip(stripname);
return stripname;
}
gboolean
account_rename(Account *item, gchar *newname)
account_exists(gchar *name)
{
Account *existitem;
gchar *stripname;
gchar *stripname = account_get_stripname(name);
stripname = g_strdup(newname);
g_strstrip(stripname);
existitem = da_acc_get_by_name(stripname);
g_free(stripname);
return existitem == NULL ? FALSE : TRUE;
}
gboolean
account_rename(Account *item, gchar *newname)
{
Account *existitem;
gchar *stripname = account_get_stripname(newname);
existitem = da_acc_get_by_name(stripname);
if( existitem == NULL )
......
......@@ -105,6 +105,7 @@ void da_acc_consistency(Account *item);
gboolean account_is_used(guint32 key);
void account_move(guint32 key1, guint32 key2);
gboolean account_exists(gchar *name);
gboolean account_rename(Account *item, gchar *newname);
void account_compute_balances(void);
gboolean account_balances_add(Transaction *trn);
......
......@@ -305,7 +305,7 @@ da_cat_get_key_by_name(gchar *name)
{
Category *cat;
DB( g_print("da_cat_get_id_by_name\n") );
DB( g_print("da_cat_get_key_by_name\n") );
cat = g_hash_table_find(GLOBALS->h_cat, (GHRFunc)da_cat_name_grfunc, name);
if( cat == NULL)
......@@ -526,7 +526,7 @@ guint32 *new_key;
Category *
da_cat_get(guint32 key)
{
DB( g_print("da_cat_get\n") );
//DB( g_print("da_cat_get\n") );
return g_hash_table_lookup(GLOBALS->h_cat, &key);
}
......@@ -1005,7 +1005,7 @@ gchar *category_find_preset(gchar **lang)
gchar **langs;
gchar *filename;
gboolean exists;
gint i;
guint i;
DB( g_printf("** category_find_preset **\n") );
......
......@@ -196,13 +196,20 @@ guint32 refdate, month, year, qnum;
flt->maxdate = g_date_get_julian(date);
break;
case 4: // this year
case FLT_RANGE_THISYEAR:
g_date_set_dmy(date, 1, 1, year);
flt->mindate = g_date_get_julian(date);
g_date_set_dmy(date, 31, 12, year);
flt->maxdate = g_date_get_julian(date);
break;
case FLT_RANGE_LASTYEAR:
g_date_set_dmy(date, 1, 1, year-1);
flt->mindate = g_date_get_julian(date);
g_date_set_dmy(date, 31, 12, year-1);
flt->maxdate = g_date_get_julian(date);
break;
// 5 :: separator
case 6: // last 30 days
......@@ -364,6 +371,7 @@ gint insert;
guint count, i;
Split *split;
insert = 0; //fix: 1151259
count = da_transaction_splits_count(txn);
for(i=0;i<count;i++)
{
......
......@@ -45,17 +45,19 @@ enum
FLT_RANGE_THISQUARTER = 2,
FLT_RANGE_LASTQUARTER = 3,
FLT_RANGE_THISYEAR = 4,
FLT_RANGE_LAST30DAYS = 6,
FLT_RANGE_LAST60DAYS = 7,
FLT_RANGE_LAST90DAYS = 8,
FLT_RANGE_LAST12MONTHS = 9,
FLT_RANGE_OTHER = 11,
FLT_RANGE_ALLDATE = 13
FLT_RANGE_LASTYEAR = 5, //was not existing on 4.5
// 6 separator
FLT_RANGE_LAST30DAYS = 7,
FLT_RANGE_LAST60DAYS = 8,
FLT_RANGE_LAST90DAYS = 9,
FLT_RANGE_LAST12MONTHS = 10,
// 11 separator
FLT_RANGE_OTHER = 12,
// 13 separator
FLT_RANGE_ALLDATE = 14
};
//default settings for account window
#define FLT_TYPE_ALL 3
#define FLT_STATUS_ALL 3
......
......@@ -322,6 +322,11 @@ guint cnt, i;
Account *item = list->data;
g_free(item->name);
item->name = g_strdup_printf("account %d", item->key);
g_free(item->number);
item->number = NULL;
g_free(item->bankname);
item->bankname = NULL;
GLOBALS->changes_count++;
list = g_list_next(list);
}
......
......@@ -572,7 +572,7 @@ hb_strdup_nobrackets (const gchar *str)
static gboolean
hb_date_parser_get_dmy(gchar *string, gint *d, gint *m, gint *y)
hb_date_parser_get_nums(gchar *string, gint *n1, gint *n2, gint *n3)
{
gboolean retval;
gchar **str_array;
......@@ -596,32 +596,77 @@ gchar **str_array;
if( g_strv_length( str_array ) == 3 )
{
*d = atoi(str_array[0]);
*m = atoi(str_array[1]);
*y = atoi(str_array[2]);
*n1 = atoi(str_array[0]);
*n2 = atoi(str_array[1]);
*n3 = atoi(str_array[2]);
retval = TRUE;
}
g_strfreev (str_array);
return retval;
}
guint32 hb_date_get_julian(gchar *string, gint datefmt)
{
GDate *date;
gint n1, n2, n3, d, m, y;
guint32 julian = 0;
DB( g_print("hb_date_get_julian: %s, %d\n", string, datefmt) );
if( hb_date_parser_get_nums(string, &n1, &n2, &n3) )
{
DB( g_print("-> %d %d %d\n", n1, n2, n3) );
date = g_date_new();
switch(datefmt)
{
case PRF_DATEFMT_MDY:
d = n2;
m = n1;
y = n3;
break;
case PRF_DATEFMT_DMY:
d = n1;
m = n2;
y = n3;
break;
default:
case PRF_DATEFMT_YMD:
d = n3;
m = n2;
y = n1;
break;
}
//correct for 2 digits year
if(*y < 1970)
if(y < 1970)
{
if(*y < 60)
*y += 2000;
if(y < 60)
y += 2000;
else
*y += 1900;
y += 1900;
}
retval = TRUE;
}
DB( g_print("-> %d %d %d\n", d, m, y) );
g_strfreev (str_array);
g_date_set_dmy(date, d, m, y);
if( g_date_valid (date) )
julian = g_date_get_julian (date);
g_date_free(date);
}
return retval;
return julian;
}
static gboolean hb_string_isdate(gchar *str)
{
gint d, m, y;
return(hb_date_parser_get_dmy(str, &d, &m, &y));
return(hb_date_parser_get_nums(str, &d, &m, &y));
}
......@@ -665,7 +710,7 @@ gunichar c;
}
gboolean hb_string_csv_valid(gchar *str, gint nbcolumns, gint *csvtype)
gboolean hb_string_csv_valid(gchar *str, guint nbcolumns, gint *csvtype)
{
gchar **str_array;
gboolean valid = TRUE;
......@@ -735,39 +780,6 @@ csvend:
return valid;
}
guint32 hb_date_get_julian(gchar *string, gint datefmt)
{
GDate *date;
gint d, m, y;
guint32 julian = 0;
if( hb_date_parser_get_dmy(string, &d, &m, &y) )
{
date = g_date_new();
switch(datefmt)
{
case PRF_DATEFMT_MDY:
if(g_date_valid_dmy(m, d, y))
g_date_set_dmy(date, m, d, y);
break;
case PRF_DATEFMT_DMY:
if(g_date_valid_dmy(d, m, y))
g_date_set_dmy(date, d, m, y);
break;
case PRF_DATEFMT_YMD:
if(g_date_valid_dmy(y, m, d))
g_date_set_dmy(date, y, m, d);
break;
}
if( g_date_valid (date) )
julian = g_date_get_julian (date);
g_date_free(date);
}
return julian;
}
/*
......
......@@ -46,7 +46,7 @@ void hb_label_set_colvaluecurr(GtkLabel *label, gdouble value, guint32 currkey);
void hb_string_strip_crlf(gchar *str);
gchar* hb_strdup_nobrackets (const gchar *str);
gboolean hb_string_csv_valid(gchar *str, gint nbcolumns, gint *csvtype);
gboolean hb_string_csv_valid(gchar *str, guint nbcolumns, gint *csvtype);
guint32 hb_date_get_julian(gchar *string, gint datefmt);
......
......@@ -261,7 +261,7 @@ da_pay_get_by_name(gchar *name)
Payee *
da_pay_get(guint32 key)
{
DB( g_print("da_pay_get_payee\n") );
//DB( g_print("da_pay_get\n") );
return g_hash_table_lookup(GLOBALS->h_pay, &key);
}
......
This diff is collapsed.
......@@ -55,7 +55,7 @@ struct CurrencyFmt
struct WinGeometry
{
gint l, t, w, h;
gint l, t, w, h, s;
};
......
......@@ -104,14 +104,16 @@ guint i, count = 0;
}
void da_transaction_splits_free(Transaction *txn)
{
guint count, i=0;
DB( g_print("= = da_transaction_splits_free = =\n") );
count = da_transaction_splits_count(txn);
if(count == 0)
return;
DB( g_print("da_transaction_splits_free\n") );
for(;i<=count;i++)
{
DB( g_print("- freeing %d :: %p\n", i, txn->splits[i]) );
......@@ -253,11 +255,8 @@ GList *da_transaction_sort(GList *list)
return( g_list_sort(list, (GCompareFunc)da_transaction_compare_func));
}
gboolean da_transaction_append(Transaction *item)
static void da_transaction_insert_memo(Transaction *item)
{
GLOBALS->ope_list = g_list_append(GLOBALS->ope_list, item);
// append the memo if new
if( item->wording != NULL )
{
......@@ -266,7 +265,21 @@ gboolean da_transaction_append(Transaction *item)
g_hash_table_insert(GLOBALS->h_memo, g_strdup(item->wording), NULL);
}
}
}
gboolean da_transaction_insert_sorted(Transaction *item)
{
GLOBALS->ope_list = g_list_insert_sorted(GLOBALS->ope_list, item, (GCompareFunc)da_transaction_compare_func);
da_transaction_insert_memo(item);
return TRUE;
}
gboolean da_transaction_append(Transaction *item)
{
GLOBALS->ope_list = g_list_append(GLOBALS->ope_list, item);
da_transaction_insert_memo(item);
return TRUE;
}
......@@ -362,7 +375,7 @@ Transaction *transaction_strong_get_child_transfer(Transaction *src)
{
GList *list;
DB( g_print("(transaction) transaction_strong_get_child_transfer\n") );
DB( g_print("\n[transaction] transaction_strong_get_child_transfer\n") );
//DB( g_print(" - search: %d %s %f %d=>%d\n", src->date, src->wording, src->amount, src->account, src->kxferacc) );
......@@ -390,7 +403,7 @@ GList *transaction_match_get_child_transfer(Transaction *src)
GList *list;
GList *match = NULL;
DB( g_print("(transaction) transaction_match_get_child_transfer\n") );
DB( g_print("\n[transaction] transaction_match_get_child_transfer\n") );
//DB( g_print(" - search : %d %s %f %d=>%d\n", src->date, src->wording, src->amount, src->account, src->kxferacc) );
......@@ -423,7 +436,7 @@ GList *matchlist = transaction_match_get_child_transfer(ope);
guint count = g_list_length(matchlist);
DB( g_print("(transaction) transaction_xfer_search_or_add_child\n") );
DB( g_print("\n[transaction] transaction_xfer_search_or_add_child\n") );
DB( g_printf(" - found result is %d, switching\n", count) );
......@@ -472,7 +485,7 @@ Transaction *child;
Account *acc;
gchar swap;
DB( g_printf("(transaction) transaction_xfer_create_child\n") );
DB( g_printf("\n[transaction] transaction_xfer_create_child\n") );
if( ope->kxferacc > 0 )
{
......@@ -522,7 +535,7 @@ void transaction_xfer_change_to_child(Transaction *ope, Transaction *child)
{
Account *acc;
DB( g_printf("(transaction) transaction_xfer_change_to_child\n") );
DB( g_printf("\n[transaction] transaction_xfer_change_to_child\n") );
child->paymode = PAYMODE_INTXFER;
......@@ -545,7 +558,7 @@ Account *acc;
void transaction_xfer_sync_child(Transaction *ope, Transaction *child)
{
DB( g_printf("(transaction) transaction_xfer_sync_child\n") );
DB( g_printf("\n[transaction] transaction_xfer_sync_child\n") );
account_balances_sub (child);
......@@ -571,7 +584,7 @@ void transaction_xfer_delete_child(Transaction *src)
{
Transaction *dst;
DB( g_printf("(transaction) transaction_xfer_delete_child\n") );
DB( g_printf("\n[transaction] transaction_xfer_delete_child\n") );
dst = transaction_strong_get_child_transfer( src );
......@@ -591,7 +604,7 @@ Transaction *transaction_old_get_child_transfer(Transaction *src)
GList *list;
Transaction *item;
DB( g_print("(transaction) transaction_get_child_transfer\n") );
DB( g_print("\n[transaction] transaction_get_child_transfer\n") );
//DB( g_print(" search: %d %s %f %d=>%d\n", src->date, src->wording, src->amount, src->account, src->kxferacc) );
......@@ -625,12 +638,12 @@ Transaction *item;
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
void transaction_add(Transaction *ope, GtkWidget *treeview, gint accnum)
void transaction_add(Transaction *ope, GtkWidget *treeview, guint32 accnum)
{
Transaction *newope;
Account *acc;
DB( g_printf("(transaction) transaction add\n") );
DB( g_printf("\n[transaction] transaction add\n") );
//controls accounts valid (archive scheduled maybe bad)
acc = da_acc_get(ope->kacc);
......@@ -684,7 +697,8 @@ Account *acc;
acc->flags |= AF_ADDED;
DB( g_printf(" + add normal %p\n", newope) );
da_transaction_append(newope);
//da_transaction_append(newope);
da_transaction_insert_sorted(newope);
if(treeview != NULL)
transaction_add_treeview(newope, treeview, accnum);
......@@ -701,14 +715,14 @@ Account *acc;
void transaction_add_treeview(Transaction *ope, GtkWidget *treeview, gint accnum)
void transaction_add_treeview(Transaction *ope, GtkWidget *treeview, guint32 accnum)
{
GtkTreeModel *model;
GtkTreeIter iter;
//GtkTreePath *path;
//GtkTreeSelection *sel;
DB( g_printf("(transaction) transaction add treeview\n") );
DB( g_printf("\n[transaction] transaction add treeview\n") );
if(ope->kacc == accnum)
{
......@@ -734,12 +748,15 @@ GtkTreeIter iter;
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
gint transaction_auto_assign(GList *ope_list, guint key)
gint transaction_auto_assign(GList *ope_list, guint32 key)
{
GList *l_ope;
GList *l_rul, *c_rul;
gint changes = 0;
DB( g_printf("\n[transaction] transaction_auto_assign\n") );
l_ope = g_list_first(ope_list);
l_rul = g_hash_table_get_values(GLOBALS->h_rul);
......@@ -749,35 +766,26 @@ gint changes = 0;
//DB( g_print("ope '%s' %d, %d\n", ope->wording, ope->payee, ope->category) );
if( (key == -1 || key == ope->kacc) && !(ope->flags & OF_SPLIT) )
if( (key == ope->kacc) && !(ope->flags & OF_SPLIT) )
{
if( ope->kpay == 0 || ope->kcat == 0 )
{
gboolean txn_changed = FALSE;
c_rul = g_list_first(l_rul);
while (c_rul != NULL)
{
Assign *rul = c_rul->data;
DB( g_print("search %s in %s\n", rul->name, ope->wording) );
if( rul->name != NULL)
//DB( g_print("search %s in %s\n", rul->name, ope->wording) );
if( rul->name != NULL )
{
if( rul->exact )
{
if( g_strrstr(ope->wording, rul->name) != NULL )
{
DB( g_print(" found case\n") );
if( ope->kpay == 0 )
{
ope->kpay = rul->kpay;
ope->flags |= OF_CHANGED;
changes++;
}
if( ope->kcat == 0 )
{
ope->kcat = rul->kcat;
ope->flags |= OF_CHANGED;
changes++;
}