mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Incorrect default start date for General Ledger
The default for the general ledger is 30 days so use a time64 and subtract from that instead of subtracting from tm.tm_mon.
This commit is contained in:
parent
8bd7deb3dc
commit
3a562e5dbb
@ -445,7 +445,6 @@ gnc_ledger_display_gl (void)
|
|||||||
{
|
{
|
||||||
Query* query;
|
Query* query;
|
||||||
time64 start;
|
time64 start;
|
||||||
struct tm tm;
|
|
||||||
GNCLedgerDisplay* ld;
|
GNCLedgerDisplay* ld;
|
||||||
GHashTable *exclude_template_accounts_hash;
|
GHashTable *exclude_template_accounts_hash;
|
||||||
|
|
||||||
@ -464,11 +463,12 @@ gnc_ledger_display_gl (void)
|
|||||||
* See Gnome Bug 86302.
|
* See Gnome Bug 86302.
|
||||||
* -- jsled */
|
* -- jsled */
|
||||||
// Exclude any template accounts for search register and gl
|
// Exclude any template accounts for search register and gl
|
||||||
exclude_template_accounts (query, exclude_template_accounts_hash);
|
exclude_template_accounts (query, exclude_template_accounts_hash);
|
||||||
|
|
||||||
|
// the default is to show last 30 days
|
||||||
|
static const time64 secs_per_thirty_days = 2592000;
|
||||||
|
start = gnc_time64_get_today_start () - secs_per_thirty_days;
|
||||||
|
|
||||||
gnc_tm_get_today_start (&tm);
|
|
||||||
tm.tm_mon--; /* Default the register to the last month's worth of transactions. */
|
|
||||||
start = gnc_mktime (&tm);
|
|
||||||
xaccQueryAddDateMatchTT (query,
|
xaccQueryAddDateMatchTT (query,
|
||||||
TRUE, start,
|
TRUE, start,
|
||||||
FALSE, 0,
|
FALSE, 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user