From 7d9110937c3d18055f2d9179a4cfe527c5405326 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Thu, 9 Jun 2011 15:17:16 +0000 Subject: [PATCH] Follow up on bug #650598 - Cannot Enter Nth Day of Month Scheduled Transactions git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20742 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Recurrence.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/Recurrence.c b/src/engine/Recurrence.c index d95aae8dee..542b69b0a5 100644 --- a/src/engine/Recurrence.c +++ b/src/engine/Recurrence.c @@ -273,7 +273,8 @@ recurrenceNextInstance(const Recurrence *r, const GDate *ref, GDate *next) else if ( g_date_is_last_of_month(next) || ((pt == PERIOD_MONTH || pt == PERIOD_YEAR) && g_date_get_day(next) >= g_date_get_day(start)) || - ((pt == PERIOD_NTH_WEEKDAY || pt == PERIOD_LAST_WEEKDAY)) ) + ((pt == PERIOD_NTH_WEEKDAY || pt == PERIOD_LAST_WEEKDAY) && + nth_weekday_compare(start, next, pt) <= 0) ) g_date_add_months(next, mult); else /* one fewer month fwd because of the occurrence in this month */