gnucash stable: Add a Postponed column to the Scheduled Transactions list.
John Ralls
jralls at code.gnucash.org
Sat Dec 6 20:56:15 EST 2025
Updated via https://github.com/Gnucash/gnucash/commit/b397a344 (commit)
from https://github.com/Gnucash/gnucash/commit/a57cd653 (commit)
commit b397a34424ea5887d6cc37da697f3a649eef853a
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Dec 2 11:34:02 2025 -0800
Add a Postponed column to the Scheduled Transactions list.
As requested by Bug 799664.
The column is hidden by default since it's not useful to people who don't
postpone scheduled transaction instances.
diff --git a/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.c b/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.c
index a242d63540..6a99c0c518 100644
--- a/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.c
+++ b/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.c
@@ -443,7 +443,7 @@ _enabled_comparator (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpoint
static void
gnc_sx_list_tree_model_adapter_init (GncSxListTreeModelAdapter *adapter)
{
- adapter->orig = gtk_tree_store_new (5, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+ adapter->orig = gtk_tree_store_new (6, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING);
adapter->real = GTK_TREE_MODEL_SORT(gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL(adapter->orig)));
// setup sorting
@@ -494,13 +494,15 @@ gsltma_populate_tree_store (GncSxListTreeModelAdapter *model)
{
GncSxInstances *instances = (GncSxInstances*)list->data;
gchar *frequency_str;
- char last_occur_date_buf[MAX_DATE_LENGTH+1];
+ char last_occur_date_buf[MAX_DATE_LENGTH + 1];
+ unsigned postponed_count;
char next_occur_date_buf[MAX_DATE_LENGTH+1];
frequency_str = recurrenceListToCompactString (gnc_sx_get_schedule (instances->sx));
_format_conditional_date (xaccSchedXactionGetLastOccurDate (instances->sx),
last_occur_date_buf, MAX_DATE_LENGTH);
+ postponed_count = g_list_length(gnc_sx_get_defer_instances (instances->sx));
_format_conditional_date (&instances->next_instance_date,
next_occur_date_buf, MAX_DATE_LENGTH);
@@ -509,6 +511,7 @@ gsltma_populate_tree_store (GncSxListTreeModelAdapter *model)
SXLTMA_COL_NAME, xaccSchedXactionGetName (instances->sx),
SXLTMA_COL_ENABLED, xaccSchedXactionGetEnabled (instances->sx),
SXLTMA_COL_FREQUENCY, frequency_str,
+ SXLTMA_COL_NUM_POSTPONED, postponed_count,
SXLTMA_COL_LAST_OCCUR, last_occur_date_buf,
SXLTMA_COL_NEXT_OCCUR, next_occur_date_buf,
-1);
diff --git a/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.h b/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.h
index 3132424d82..5556cd29dd 100644
--- a/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.h
+++ b/gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.h
@@ -53,6 +53,7 @@ enum
SXLTMA_COL_NAME = 0,
SXLTMA_COL_ENABLED,
SXLTMA_COL_FREQUENCY,
+ SXLTMA_COL_NUM_POSTPONED,
SXLTMA_COL_LAST_OCCUR,
SXLTMA_COL_NEXT_OCCUR
};
diff --git a/gnucash/gnome-utils/gnc-tree-view-sx-list.c b/gnucash/gnome-utils/gnc-tree-view-sx-list.c
index 32d17adb35..1c82624bbb 100644
--- a/gnucash/gnome-utils/gnc-tree-view-sx-list.c
+++ b/gnucash/gnome-utils/gnc-tree-view-sx-list.c
@@ -131,6 +131,13 @@ gnc_tree_view_sx_list_new (GncSxInstanceModel *sx_instances)
SXLTMA_COL_FREQUENCY, -1, NULL);
g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
+ col = gnc_tree_view_add_numeric_column (GNC_TREE_VIEW(view), _("Postponed"),
+ "postponed", " Postponed",
+ SXLTMA_COL_NUM_POSTPONED,
+ GNC_TREE_VIEW_COLUMN_COLOR_NONE,
+ GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, NULL);
+ g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(0));
+
col = gnc_tree_view_add_text_column (GNC_TREE_VIEW(view), _("Last Occur"), "last-occur", NULL,
"2007-01-02",
SXLTMA_COL_LAST_OCCUR, -1, NULL);
Summary of changes:
gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.c | 7 +++++--
gnucash/gnome-utils/gnc-sx-list-tree-model-adapter.h | 1 +
gnucash/gnome-utils/gnc-tree-view-sx-list.c | 7 +++++++
3 files changed, 13 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list