Skip to content

Commit

Permalink
Bug #344869 - No warning when you change a reconciled split from another
Browse files Browse the repository at this point in the history
account in basic ledger mode

This patch brings up a dialogue when any field in a transaction/split is
changed when the transaction has a reconciled split. Exceptions are the
notes, action and memo fields. Those can be changed at all times.

This patch will not be backported as it introduces new translatable
strings.

Author: Robert Fewell <14ubobit@gmail.com>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22351 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
gjanssens committed Aug 29, 2012
1 parent ebcf0f7 commit ef38df9
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/register/ledger-core/split-register-model.c
Expand Up @@ -1920,6 +1920,8 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
Transaction *trans;
Split *split;
char recn;
const char *cell_name;
gboolean change_ok;

/* This assumes we reset the flag whenever we change splits.
* This happens in gnc_split_register_move_cursor(). */
Expand All @@ -1939,14 +1941,33 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
else
recn = xaccSplitGetReconcile (split);

if (recn == YREC)
/* What Cell are we in */
cell_name = gnc_table_get_cell_name (reg->table, virt_loc);

/* These cells can be changed */
change_ok = (g_strcmp0(cell_name, "notes") == 0) || (g_strcmp0(cell_name, "memo") == 0) || (g_strcmp0(cell_name, "action") == 0);

if ((recn == YREC || xaccTransHasReconciledSplits (trans)) && !change_ok)
{
GtkWidget *dialog, *window;
gint response;
const gchar *title = _("Change reconciled split?");
const gchar *message =
_("You are about to change a reconciled split. Doing so might make "
"future reconciliation difficult! Continue with this change?");
const gchar *title;
const gchar *message;

if(recn == YREC)
{
title = _("Change reconciled split?");
message =
_("You are about to change a reconciled split. Doing so might make "
"future reconciliation difficult! Continue with this change?");
}
else
{
title = _("Change split linked to a reconciled split?");
message =
_("You are about to change a split that is linked to a reconciled split. "
"Doing so might make future reconciliation difficult! Continue with this change?");
}

/* Does the user want to be warned? */
window = gnc_split_register_get_parent(reg);
Expand Down

0 comments on commit ef38df9

Please sign in to comment.