Skip to content

Commit

Permalink
[import-main-matcher.cpp] warn if trans_date < recn_date
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Mar 30, 2024
1 parent 354120e commit c628dd9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gnucash/import-export/import-main-matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,13 @@ get_peer_acct_names (Split *split)
return retval;
}

static inline bool
acct_recndate_warning (time64 trans_date, const Account* acc)
{
time64 recn_date;
return xaccAccountGetReconcileLastDate (acc, &recn_date) && trans_date < recn_date;
}

static void
refresh_model_row (GNCImportMainMatcher *gui,
GtkTreeModel *model,
Expand Down Expand Up @@ -2028,6 +2035,14 @@ refresh_model_row (GNCImportMainMatcher *gui,
imbalance, acct_full_name);

}
if (acct_recndate_warning (date, dest_acc))
{
static const char* recn_date_warning = N_("The import date is earlier \
than destination account reconcile date. Further reconciliation may be difficult");
auto newtext = g_strdup_printf ("%s %s", text, _(recn_date_warning));
g_free (text);
text = newtext;
}

g_free (acct_full_name);
}
Expand Down

0 comments on commit c628dd9

Please sign in to comment.