mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Convert all time_t to time64: engine
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22621 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6716e3ac5b
commit
7694f858d1
@ -3038,14 +3038,14 @@ xaccAccountGetProjectedMinimumBalance (const Account *acc)
|
|||||||
{
|
{
|
||||||
AccountPrivate *priv;
|
AccountPrivate *priv;
|
||||||
GList *node;
|
GList *node;
|
||||||
time_t today;
|
time64 today;
|
||||||
gnc_numeric lowest = gnc_numeric_zero ();
|
gnc_numeric lowest = gnc_numeric_zero ();
|
||||||
int seen_a_transaction = 0;
|
int seen_a_transaction = 0;
|
||||||
|
|
||||||
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), gnc_numeric_zero());
|
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), gnc_numeric_zero());
|
||||||
|
|
||||||
priv = GET_PRIVATE(acc);
|
priv = GET_PRIVATE(acc);
|
||||||
today = gnc_timet_get_today_end();
|
today = gnc_time64_get_today_end();
|
||||||
for (node = g_list_last(priv->splits); node; node = node->prev)
|
for (node = g_list_last(priv->splits); node; node = node->prev)
|
||||||
{
|
{
|
||||||
Split *split = node->data;
|
Split *split = node->data;
|
||||||
@ -3072,7 +3072,7 @@ xaccAccountGetProjectedMinimumBalance (const Account *acc)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccAccountGetBalanceAsOfDate (Account *acc, time_t date)
|
xaccAccountGetBalanceAsOfDate (Account *acc, time64 date)
|
||||||
{
|
{
|
||||||
/* Ideally this could use xaccAccountForEachSplit, but
|
/* Ideally this could use xaccAccountForEachSplit, but
|
||||||
* it doesn't exist yet and I'm uncertain of exactly how
|
* it doesn't exist yet and I'm uncertain of exactly how
|
||||||
@ -3096,11 +3096,11 @@ xaccAccountGetBalanceAsOfDate (Account *acc, time_t date)
|
|||||||
|
|
||||||
/* Since transaction post times are stored as a Timespec,
|
/* Since transaction post times are stored as a Timespec,
|
||||||
* convert date into a Timespec as well rather than converting
|
* convert date into a Timespec as well rather than converting
|
||||||
* each transaction's Timespec into a time_t.
|
* each transaction's Timespec into a time64.
|
||||||
*
|
*
|
||||||
* FIXME: CAS: I think this comment is a bogus justification for
|
* FIXME: CAS: I think this comment is a bogus justification for
|
||||||
* using xaccTransGetDatePostedTS. There's no benefit to using
|
* using xaccTransGetDatePostedTS. There's no benefit to using
|
||||||
* Timespec when the input argument is time_t, and it's hard to
|
* Timespec when the input argument is time64, and it's hard to
|
||||||
* imagine that casting long long to long and comparing two longs is
|
* imagine that casting long long to long and comparing two longs is
|
||||||
* worse than comparing two long longs every time. IMO,
|
* worse than comparing two long longs every time. IMO,
|
||||||
* xaccAccountGetPresentBalance gets this right, and its algorithm
|
* xaccAccountGetPresentBalance gets this right, and its algorithm
|
||||||
@ -3156,12 +3156,12 @@ xaccAccountGetPresentBalance (const Account *acc)
|
|||||||
{
|
{
|
||||||
AccountPrivate *priv;
|
AccountPrivate *priv;
|
||||||
GList *node;
|
GList *node;
|
||||||
time_t today;
|
time64 today;
|
||||||
|
|
||||||
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), gnc_numeric_zero());
|
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), gnc_numeric_zero());
|
||||||
|
|
||||||
priv = GET_PRIVATE(acc);
|
priv = GET_PRIVATE(acc);
|
||||||
today = gnc_timet_get_today_end();
|
today = gnc_time64_get_today_end();
|
||||||
for (node = g_list_last(priv->splits); node; node = node->prev)
|
for (node = g_list_last(priv->splits); node; node = node->prev)
|
||||||
{
|
{
|
||||||
Split *split = node->data;
|
Split *split = node->data;
|
||||||
@ -3214,7 +3214,7 @@ xaccAccountConvertBalanceToCurrencyAsOfDate(const Account *acc, /* for book */
|
|||||||
gnc_numeric balance,
|
gnc_numeric balance,
|
||||||
gnc_commodity *balance_currency,
|
gnc_commodity *balance_currency,
|
||||||
gnc_commodity *new_currency,
|
gnc_commodity *new_currency,
|
||||||
time_t date)
|
time64 date)
|
||||||
{
|
{
|
||||||
QofBook *book;
|
QofBook *book;
|
||||||
GNCPriceDB *pdb;
|
GNCPriceDB *pdb;
|
||||||
@ -3262,7 +3262,7 @@ xaccAccountGetXxxBalanceInCurrency (const Account *acc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gnc_numeric
|
static gnc_numeric
|
||||||
xaccAccountGetXxxBalanceAsOfDateInCurrency(Account *acc, time_t date,
|
xaccAccountGetXxxBalanceAsOfDateInCurrency(Account *acc, time64 date,
|
||||||
xaccGetBalanceAsOfDateFn fn,
|
xaccGetBalanceAsOfDateFn fn,
|
||||||
const gnc_commodity *report_commodity)
|
const gnc_commodity *report_commodity)
|
||||||
{
|
{
|
||||||
@ -3286,7 +3286,7 @@ typedef struct
|
|||||||
gnc_numeric balance;
|
gnc_numeric balance;
|
||||||
xaccGetBalanceFn fn;
|
xaccGetBalanceFn fn;
|
||||||
xaccGetBalanceAsOfDateFn asOfDateFn;
|
xaccGetBalanceAsOfDateFn asOfDateFn;
|
||||||
time_t date;
|
time64 date;
|
||||||
} CurrencyBalance;
|
} CurrencyBalance;
|
||||||
|
|
||||||
|
|
||||||
@ -3375,7 +3375,7 @@ xaccAccountGetXxxBalanceInCurrencyRecursive (const Account *acc,
|
|||||||
|
|
||||||
static gnc_numeric
|
static gnc_numeric
|
||||||
xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
||||||
Account *acc, time_t date, xaccGetBalanceAsOfDateFn fn,
|
Account *acc, time64 date, xaccGetBalanceAsOfDateFn fn,
|
||||||
gnc_commodity *report_commodity, gboolean include_children)
|
gnc_commodity *report_commodity, gboolean include_children)
|
||||||
{
|
{
|
||||||
gnc_numeric balance;
|
gnc_numeric balance;
|
||||||
@ -3466,7 +3466,7 @@ xaccAccountGetProjectedMinimumBalanceInCurrency (
|
|||||||
|
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccAccountGetBalanceAsOfDateInCurrency(
|
xaccAccountGetBalanceAsOfDateInCurrency(
|
||||||
Account *acc, time_t date, gnc_commodity *report_commodity,
|
Account *acc, time64 date, gnc_commodity *report_commodity,
|
||||||
gboolean include_children)
|
gboolean include_children)
|
||||||
{
|
{
|
||||||
return xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
return xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
||||||
@ -3475,7 +3475,8 @@ xaccAccountGetBalanceAsOfDateInCurrency(
|
|||||||
}
|
}
|
||||||
|
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccAccountGetBalanceChangeForPeriod (Account *acc, time_t t1, time_t t2, gboolean recurse)
|
xaccAccountGetBalanceChangeForPeriod (Account *acc, time64 t1, time64 t2,
|
||||||
|
gboolean recurse)
|
||||||
{
|
{
|
||||||
gnc_numeric b1, b2;
|
gnc_numeric b1, b2;
|
||||||
|
|
||||||
@ -3992,7 +3993,7 @@ xaccAccountIsPriced(const Account *acc)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
xaccAccountGetReconcileLastDate (const Account *acc, time_t *last_date)
|
xaccAccountGetReconcileLastDate (const Account *acc, time64 *last_date)
|
||||||
{
|
{
|
||||||
KvpValue *v;
|
KvpValue *v;
|
||||||
|
|
||||||
@ -4013,7 +4014,7 @@ xaccAccountGetReconcileLastDate (const Account *acc, time_t *last_date)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccAccountSetReconcileLastDate (Account *acc, time_t last_date)
|
xaccAccountSetReconcileLastDate (Account *acc, time64 last_date)
|
||||||
{
|
{
|
||||||
if (!acc) return;
|
if (!acc) return;
|
||||||
|
|
||||||
@ -4076,7 +4077,7 @@ xaccAccountSetReconcileLastInterval (Account *acc, int months, int days)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
xaccAccountGetReconcilePostponeDate (const Account *acc, time_t *postpone_date)
|
xaccAccountGetReconcilePostponeDate (const Account *acc, time64 *postpone_date)
|
||||||
{
|
{
|
||||||
KvpValue *v;
|
KvpValue *v;
|
||||||
|
|
||||||
@ -4096,7 +4097,7 @@ xaccAccountGetReconcilePostponeDate (const Account *acc, time_t *postpone_date)
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccAccountSetReconcilePostponeDate (Account *acc, time_t postpone_date)
|
xaccAccountSetReconcilePostponeDate (Account *acc, time64 postpone_date)
|
||||||
{
|
{
|
||||||
if (!acc) return;
|
if (!acc) return;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ typedef gnc_numeric (*xaccGetBalanceInCurrencyFn) (
|
|||||||
gboolean include_children);
|
gboolean include_children);
|
||||||
|
|
||||||
typedef gnc_numeric (*xaccGetBalanceAsOfDateFn) (
|
typedef gnc_numeric (*xaccGetBalanceAsOfDateFn) (
|
||||||
Account *account, time_t date);
|
Account *account, time64 date);
|
||||||
|
|
||||||
typedef void (*AccountCb)(Account *a, gpointer data);
|
typedef void (*AccountCb)(Account *a, gpointer data);
|
||||||
typedef gpointer (*AccountCb2)(Account *a, gpointer data);
|
typedef gpointer (*AccountCb2)(Account *a, gpointer data);
|
||||||
@ -524,7 +524,7 @@ gnc_numeric xaccAccountGetPresentBalance (const Account *account);
|
|||||||
gnc_numeric xaccAccountGetProjectedMinimumBalance (const Account *account);
|
gnc_numeric xaccAccountGetProjectedMinimumBalance (const Account *account);
|
||||||
/** Get the balance of the account as of the date specified */
|
/** Get the balance of the account as of the date specified */
|
||||||
gnc_numeric xaccAccountGetBalanceAsOfDate (Account *account,
|
gnc_numeric xaccAccountGetBalanceAsOfDate (Account *account,
|
||||||
time_t date);
|
time64 date);
|
||||||
|
|
||||||
/* These two functions convert a given balance from one commodity to
|
/* These two functions convert a given balance from one commodity to
|
||||||
another. The account argument is only used to get the Book, and
|
another. The account argument is only used to get the Book, and
|
||||||
@ -543,7 +543,7 @@ gnc_numeric xaccAccountConvertBalanceToCurrency(
|
|||||||
gnc_numeric xaccAccountConvertBalanceToCurrencyAsOfDate(
|
gnc_numeric xaccAccountConvertBalanceToCurrencyAsOfDate(
|
||||||
const Account *account, /* for book */
|
const Account *account, /* for book */
|
||||||
gnc_numeric balance, gnc_commodity *balance_currency,
|
gnc_numeric balance, gnc_commodity *balance_currency,
|
||||||
gnc_commodity *new_currency, time_t date);
|
gnc_commodity *new_currency, time64 date);
|
||||||
|
|
||||||
/* These functions get some type of balance in the desired commodity.
|
/* These functions get some type of balance in the desired commodity.
|
||||||
'report_commodity' may be NULL to use the account's commodity. */
|
'report_commodity' may be NULL to use the account's commodity. */
|
||||||
@ -566,11 +566,11 @@ gnc_numeric xaccAccountGetProjectedMinimumBalanceInCurrency (
|
|||||||
/* This function gets the balance as of the given date in the desired
|
/* This function gets the balance as of the given date in the desired
|
||||||
commodity. */
|
commodity. */
|
||||||
gnc_numeric xaccAccountGetBalanceAsOfDateInCurrency(
|
gnc_numeric xaccAccountGetBalanceAsOfDateInCurrency(
|
||||||
Account *account, time_t date, gnc_commodity *report_commodity,
|
Account *account, time64 date, gnc_commodity *report_commodity,
|
||||||
gboolean include_children);
|
gboolean include_children);
|
||||||
|
|
||||||
gnc_numeric xaccAccountGetBalanceChangeForPeriod (
|
gnc_numeric xaccAccountGetBalanceChangeForPeriod (
|
||||||
Account *acc, time_t date1, time_t date2, gboolean recurse);
|
Account *acc, time64 date1, time64 date2, gboolean recurse);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
@ -1054,9 +1054,9 @@ LotList * xaccAccountFindOpenLots (const Account *acc,
|
|||||||
*/
|
*/
|
||||||
/** DOCUMENT ME! */
|
/** DOCUMENT ME! */
|
||||||
gboolean xaccAccountGetReconcileLastDate (const Account *account,
|
gboolean xaccAccountGetReconcileLastDate (const Account *account,
|
||||||
time_t *last_date);
|
time64 *last_date);
|
||||||
/** DOCUMENT ME! */
|
/** DOCUMENT ME! */
|
||||||
void xaccAccountSetReconcileLastDate (Account *account, time_t last_date);
|
void xaccAccountSetReconcileLastDate (Account *account, time64 last_date);
|
||||||
|
|
||||||
/** DOCUMENT ME! */
|
/** DOCUMENT ME! */
|
||||||
gboolean xaccAccountGetReconcileLastInterval (const Account *account,
|
gboolean xaccAccountGetReconcileLastInterval (const Account *account,
|
||||||
@ -1066,10 +1066,10 @@ void xaccAccountSetReconcileLastInterval (Account *account,
|
|||||||
int months, int days);
|
int months, int days);
|
||||||
/** DOCUMENT ME! */
|
/** DOCUMENT ME! */
|
||||||
gboolean xaccAccountGetReconcilePostponeDate (const Account *account,
|
gboolean xaccAccountGetReconcilePostponeDate (const Account *account,
|
||||||
time_t *postpone_date);
|
time64 *postpone_date);
|
||||||
/** DOCUMENT ME! */
|
/** DOCUMENT ME! */
|
||||||
void xaccAccountSetReconcilePostponeDate (Account *account,
|
void xaccAccountSetReconcilePostponeDate (Account *account,
|
||||||
time_t postpone_date);
|
time64 postpone_date);
|
||||||
|
|
||||||
/** DOCUMENT ME! */
|
/** DOCUMENT ME! */
|
||||||
gboolean xaccAccountGetReconcilePostponeBalance (const Account *account,
|
gboolean xaccAccountGetReconcilePostponeBalance (const Account *account,
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
|
||||||
# include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@ -476,18 +473,18 @@ xaccQueryAddDateMatch(QofQuery * q,
|
|||||||
void
|
void
|
||||||
xaccQueryAddDateMatchTT(QofQuery * q,
|
xaccQueryAddDateMatchTT(QofQuery * q,
|
||||||
gboolean use_start,
|
gboolean use_start,
|
||||||
time_t stt,
|
time64 stt,
|
||||||
gboolean use_end,
|
gboolean use_end,
|
||||||
time_t ett,
|
time64 ett,
|
||||||
QofQueryOp op)
|
QofQueryOp op)
|
||||||
{
|
{
|
||||||
Timespec sts;
|
Timespec sts;
|
||||||
Timespec ets;
|
Timespec ets;
|
||||||
|
|
||||||
sts.tv_sec = (long long)stt;
|
sts.tv_sec = stt;
|
||||||
sts.tv_nsec = 0;
|
sts.tv_nsec = 0;
|
||||||
|
|
||||||
ets.tv_sec = (long long)ett;
|
ets.tv_sec = ett;
|
||||||
ets.tv_nsec = 0;
|
ets.tv_nsec = 0;
|
||||||
|
|
||||||
/* gcc -O3 will auto-inline this function, avoiding a call overhead */
|
/* gcc -O3 will auto-inline this function, avoiding a call overhead */
|
||||||
@ -498,8 +495,8 @@ xaccQueryAddDateMatchTT(QofQuery * q,
|
|||||||
|
|
||||||
void
|
void
|
||||||
xaccQueryGetDateMatchTT (QofQuery * q,
|
xaccQueryGetDateMatchTT (QofQuery * q,
|
||||||
time_t * stt,
|
time64 * stt,
|
||||||
time_t * ett)
|
time64 * ett)
|
||||||
{
|
{
|
||||||
Timespec sts;
|
Timespec sts;
|
||||||
Timespec ets;
|
Timespec ets;
|
||||||
@ -594,26 +591,26 @@ xaccQueryAddKVPMatch(QofQuery *q, GSList *path, const KvpValue *value,
|
|||||||
* xaccQueryGetEarliestDateFound
|
* xaccQueryGetEarliestDateFound
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
time_t
|
time64
|
||||||
xaccQueryGetEarliestDateFound(QofQuery * q)
|
xaccQueryGetEarliestDateFound(QofQuery * q)
|
||||||
{
|
{
|
||||||
GList * spl;
|
GList * spl;
|
||||||
Split * sp;
|
Split * sp;
|
||||||
time_t earliest;
|
time64 earliest;
|
||||||
|
|
||||||
if (!q) return 0;
|
if (!q) return 0;
|
||||||
spl = qof_query_last_run (q);
|
spl = qof_query_last_run (q);
|
||||||
if (!spl) return 0;
|
if (!spl) return 0;
|
||||||
|
|
||||||
/* Safe until 2038 on archs where time_t is 32bit */
|
/* Safe until 2038 on archs where time64 is 32bit */
|
||||||
sp = spl->data;
|
sp = spl->data;
|
||||||
earliest = (time_t) sp->parent->date_posted.tv_sec;
|
earliest = sp->parent->date_posted.tv_sec;
|
||||||
for (; spl; spl = spl->next)
|
for (; spl; spl = spl->next)
|
||||||
{
|
{
|
||||||
sp = spl->data;
|
sp = spl->data;
|
||||||
if (sp->parent->date_posted.tv_sec < earliest)
|
if (sp->parent->date_posted.tv_sec < earliest)
|
||||||
{
|
{
|
||||||
earliest = (time_t) sp->parent->date_posted.tv_sec;
|
earliest = sp->parent->date_posted.tv_sec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return earliest;
|
return earliest;
|
||||||
@ -623,12 +620,12 @@ xaccQueryGetEarliestDateFound(QofQuery * q)
|
|||||||
* xaccQueryGetLatestDateFound
|
* xaccQueryGetLatestDateFound
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
time_t
|
time64
|
||||||
xaccQueryGetLatestDateFound(QofQuery * q)
|
xaccQueryGetLatestDateFound(QofQuery * q)
|
||||||
{
|
{
|
||||||
Split * sp;
|
Split * sp;
|
||||||
GList * spl;
|
GList * spl;
|
||||||
time_t latest = 0;
|
time64 latest = 0;
|
||||||
|
|
||||||
if (!q) return 0;
|
if (!q) return 0;
|
||||||
spl = qof_query_last_run (q);
|
spl = qof_query_last_run (q);
|
||||||
@ -639,7 +636,7 @@ xaccQueryGetLatestDateFound(QofQuery * q)
|
|||||||
sp = spl->data;
|
sp = spl->data;
|
||||||
if (sp->parent->date_posted.tv_sec > latest)
|
if (sp->parent->date_posted.tv_sec > latest)
|
||||||
{
|
{
|
||||||
latest = (time_t) sp->parent->date_posted.tv_sec;
|
latest = sp->parent->date_posted.tv_sec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return latest;
|
return latest;
|
||||||
|
@ -156,15 +156,15 @@ void xaccQueryAddDateMatchTS(QofQuery * q,
|
|||||||
gboolean use_end, Timespec ets,
|
gboolean use_end, Timespec ets,
|
||||||
QofQueryOp op);
|
QofQueryOp op);
|
||||||
void xaccQueryAddDateMatchTT(QofQuery * q,
|
void xaccQueryAddDateMatchTT(QofQuery * q,
|
||||||
gboolean use_start, time_t stt,
|
gboolean use_start, time64 stt,
|
||||||
gboolean use_end, time_t ett,
|
gboolean use_end, time64 ett,
|
||||||
QofQueryOp op);
|
QofQueryOp op);
|
||||||
void xaccQueryGetDateMatchTS (QofQuery * q,
|
void xaccQueryGetDateMatchTS (QofQuery * q,
|
||||||
Timespec * sts,
|
Timespec * sts,
|
||||||
Timespec * ets);
|
Timespec * ets);
|
||||||
void xaccQueryGetDateMatchTT (QofQuery * q,
|
void xaccQueryGetDateMatchTT (QofQuery * q,
|
||||||
time_t * stt,
|
time64 * stt,
|
||||||
time_t * ett);
|
time64 * ett);
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ void xaccQueryAddKVPMatch(QofQuery *q, GSList *path, const KvpValue *value,
|
|||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* compatibility interface with old QofQuery API
|
* compatibility interface with old QofQuery API
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
time_t xaccQueryGetEarliestDateFound(QofQuery * q);
|
time64 xaccQueryGetEarliestDateFound(QofQuery * q);
|
||||||
time_t xaccQueryGetLatestDateFound(QofQuery * q);
|
time64 xaccQueryGetLatestDateFound(QofQuery * q);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,7 +87,7 @@ recurrenceSet(Recurrence *r, guint16 mult, PeriodType pt, const GDate *_start, W
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_date_set_time_t(&r->start, time(NULL));
|
gnc_gdate_set_today (&r->start);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Some of the unusual period types also specify phase. For those
|
/* Some of the unusual period types also specify phase. For those
|
||||||
@ -377,7 +377,7 @@ recurrenceNthInstance(const Recurrence *r, guint n, GDate *date)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t
|
time64
|
||||||
recurrenceGetPeriodTime(const Recurrence *r, guint period_num, gboolean end)
|
recurrenceGetPeriodTime(const Recurrence *r, guint period_num, gboolean end)
|
||||||
{
|
{
|
||||||
GDate date;
|
GDate date;
|
||||||
@ -385,18 +385,18 @@ recurrenceGetPeriodTime(const Recurrence *r, guint period_num, gboolean end)
|
|||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
g_date_subtract_days(&date, 1);
|
g_date_subtract_days(&date, 1);
|
||||||
return gnc_timet_get_day_end_gdate(&date);
|
return gnc_time64_get_day_end_gdate(&date);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return gnc_timet_get_day_start_gdate(&date);
|
return gnc_time64_get_day_start_gdate(&date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
recurrenceGetAccountPeriodValue(const Recurrence *r, Account *acc, guint n)
|
recurrenceGetAccountPeriodValue(const Recurrence *r, Account *acc, guint n)
|
||||||
{
|
{
|
||||||
time_t t1, t2;
|
time64 t1, t2;
|
||||||
|
|
||||||
// FIXME: maybe zero is not best error return val.
|
// FIXME: maybe zero is not best error return val.
|
||||||
g_return_val_if_fail(r && acc, gnc_numeric_zero());
|
g_return_val_if_fail(r && acc, gnc_numeric_zero());
|
||||||
|
@ -135,7 +135,7 @@ void recurrenceNthInstance(const Recurrence *r, guint n, GDate *date);
|
|||||||
|
|
||||||
/* Get a time coresponding to the beginning (or end if 'end' is true)
|
/* Get a time coresponding to the beginning (or end if 'end' is true)
|
||||||
of the nth instance of the recurrence. Also zero-based. */
|
of the nth instance of the recurrence. Also zero-based. */
|
||||||
time_t recurrenceGetPeriodTime(const Recurrence *r, guint n, gboolean end);
|
time64 recurrenceGetPeriodTime(const Recurrence *r, guint n, gboolean end);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the amount that an Account's value changed between the beginning
|
* @return the amount that an Account's value changed between the beginning
|
||||||
|
@ -1111,7 +1111,7 @@ xaccSchedXactionSetTemplateTrans(SchedXaction *sx, GList *t_t_list,
|
|||||||
xaccTransSetDescription(new_trans,
|
xaccTransSetDescription(new_trans,
|
||||||
gnc_ttinfo_get_description(tti));
|
gnc_ttinfo_get_description(tti));
|
||||||
|
|
||||||
xaccTransSetDatePostedSecs(new_trans, time(NULL));
|
xaccTransSetDatePostedSecs(new_trans, gnc_time (NULL));
|
||||||
|
|
||||||
xaccTransSetNum(new_trans,
|
xaccTransSetNum(new_trans,
|
||||||
gnc_ttinfo_get_num(tti));
|
gnc_ttinfo_get_num(tti));
|
||||||
|
@ -1576,7 +1576,7 @@ xaccSplitSetReconcile (Split *split, char recn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccSplitSetDateReconciledSecs (Split *split, time_t secs)
|
xaccSplitSetDateReconciledSecs (Split *split, time64 secs)
|
||||||
{
|
{
|
||||||
if (!split) return;
|
if (!split) return;
|
||||||
xaccTransBeginEdit (split->parent);
|
xaccTransBeginEdit (split->parent);
|
||||||
|
@ -179,8 +179,8 @@ void xaccSplitSetReconcile (Split *split, char reconciled_flag);
|
|||||||
char xaccSplitGetReconcile (const Split *split);
|
char xaccSplitGetReconcile (const Split *split);
|
||||||
|
|
||||||
/** Set the date on which this split was reconciled by specifying the
|
/** Set the date on which this split was reconciled by specifying the
|
||||||
* time as time_t. */
|
* time as time64. */
|
||||||
void xaccSplitSetDateReconciledSecs (Split *split, time_t time);
|
void xaccSplitSetDateReconciledSecs (Split *split, time64 time);
|
||||||
/** Set the date on which this split was reconciled by specifying the
|
/** Set the date on which this split was reconciled by specifying the
|
||||||
* time as Timespec. Caller still owns *ts! */
|
* time as Timespec. Caller still owns *ts! */
|
||||||
void xaccSplitSetDateReconciledTS (Split *split, Timespec *ts);
|
void xaccSplitSetDateReconciledTS (Split *split, Timespec *ts);
|
||||||
|
@ -224,13 +224,13 @@ xaccTransWriteLog (Transaction *trans, char flag)
|
|||||||
if (!gen_logs) return;
|
if (!gen_logs) return;
|
||||||
if (!trans_log) return;
|
if (!trans_log) return;
|
||||||
|
|
||||||
timespecFromTime_t(&ts, time(NULL));
|
timespecFromTime64(&ts, gnc_time (NULL));
|
||||||
gnc_timespec_to_iso8601_buff (ts, dnow);
|
gnc_timespec_to_iso8601_buff (ts, dnow);
|
||||||
|
|
||||||
timespecFromTime_t(&ts, trans->date_entered.tv_sec);
|
timespecFromTime64(&ts, trans->date_entered.tv_sec);
|
||||||
gnc_timespec_to_iso8601_buff (ts, dent);
|
gnc_timespec_to_iso8601_buff (ts, dent);
|
||||||
|
|
||||||
timespecFromTime_t(&ts, trans->date_posted.tv_sec);
|
timespecFromTime64(&ts, trans->date_posted.tv_sec);
|
||||||
gnc_timespec_to_iso8601_buff (ts, dpost);
|
gnc_timespec_to_iso8601_buff (ts, dpost);
|
||||||
|
|
||||||
guid_to_string_buff (xaccTransGetGUID(trans), trans_guid_str);
|
guid_to_string_buff (xaccTransGetGUID(trans), trans_guid_str);
|
||||||
@ -255,7 +255,7 @@ xaccTransWriteLog (Transaction *trans, char flag)
|
|||||||
acc_guid_str[0] = '\0';
|
acc_guid_str[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
timespecFromTime_t(&ts, split->date_reconciled.tv_sec);
|
timespecFromTime64(&ts, split->date_reconciled.tv_sec);
|
||||||
gnc_timespec_to_iso8601_buff (ts, drecn);
|
gnc_timespec_to_iso8601_buff (ts, drecn);
|
||||||
|
|
||||||
guid_to_string_buff (xaccSplitGetGUID(split), split_guid_str);
|
guid_to_string_buff (xaccSplitGetGUID(split), split_guid_str);
|
||||||
|
@ -57,6 +57,7 @@ struct timeval
|
|||||||
#include "gnc-engine.h"
|
#include "gnc-engine.h"
|
||||||
#include "gnc-lot.h"
|
#include "gnc-lot.h"
|
||||||
#include "gnc-event.h"
|
#include "gnc-event.h"
|
||||||
|
#include <gnc-gdate-utils.h>
|
||||||
|
|
||||||
#include "qofbackend-p.h"
|
#include "qofbackend-p.h"
|
||||||
|
|
||||||
@ -1632,8 +1633,8 @@ xaccTransSetDateInternal(Transaction *trans, Timespec *dadate, Timespec val)
|
|||||||
xaccTransBeginEdit(trans);
|
xaccTransBeginEdit(trans);
|
||||||
|
|
||||||
{
|
{
|
||||||
time_t secs = (time_t) val.tv_sec;
|
time64 secs = (time64) val.tv_sec;
|
||||||
gchar *tstr = ctime(&secs);
|
gchar *tstr = gnc_ctime (&secs);
|
||||||
PINFO ("addr=%p set date to %" G_GUINT64_FORMAT ".%09ld %s",
|
PINFO ("addr=%p set date to %" G_GUINT64_FORMAT ".%09ld %s",
|
||||||
trans, val.tv_sec, val.tv_nsec, tstr ? tstr : "(null)");
|
trans, val.tv_sec, val.tv_nsec, tstr ? tstr : "(null)");
|
||||||
}
|
}
|
||||||
@ -1659,7 +1660,7 @@ set_gains_date_dirty (Transaction *trans)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccTransSetDatePostedSecs (Transaction *trans, time_t secs)
|
xaccTransSetDatePostedSecs (Transaction *trans, time64 secs)
|
||||||
{
|
{
|
||||||
Timespec ts = {secs, 0};
|
Timespec ts = {secs, 0};
|
||||||
if (!trans) return;
|
if (!trans) return;
|
||||||
@ -1690,7 +1691,7 @@ xaccTransSetDatePostedGDate (Transaction *trans, GDate date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccTransSetDateEnteredSecs (Transaction *trans, time_t secs)
|
xaccTransSetDateEnteredSecs (Transaction *trans, time64 secs)
|
||||||
{
|
{
|
||||||
Timespec ts = {secs, 0};
|
Timespec ts = {secs, 0};
|
||||||
if (!trans) return;
|
if (!trans) return;
|
||||||
@ -1935,7 +1936,7 @@ xaccTransGetIsClosingTxn (const Transaction *trans)
|
|||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
time_t
|
time64
|
||||||
xaccTransGetDate (const Transaction *trans)
|
xaccTransGetDate (const Transaction *trans)
|
||||||
{
|
{
|
||||||
return trans ? trans->date_posted.tv_sec : 0;
|
return trans ? trans->date_posted.tv_sec : 0;
|
||||||
@ -2081,7 +2082,7 @@ gboolean xaccTransInFutureByPostedDate (const Transaction *trans)
|
|||||||
|
|
||||||
trans_date = xaccTransGetDatePostedGDate (trans);
|
trans_date = xaccTransGetDatePostedGDate (trans);
|
||||||
|
|
||||||
g_date_set_time_t (&date_now, time(NULL));
|
gnc_gdate_set_time64 (&date_now, gnc_time (NULL));
|
||||||
|
|
||||||
if (g_date_compare (&trans_date, &date_now) > 0)
|
if (g_date_compare (&trans_date, &date_now) > 0)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
@ -2203,7 +2204,7 @@ xaccTransVoid(Transaction *trans, const char *reason)
|
|||||||
kvp_frame_set_string(frame, trans_notes_str, _("Voided transaction"));
|
kvp_frame_set_string(frame, trans_notes_str, _("Voided transaction"));
|
||||||
kvp_frame_set_string(frame, void_reason_str, reason);
|
kvp_frame_set_string(frame, void_reason_str, reason);
|
||||||
|
|
||||||
now.tv_sec = time(NULL);
|
now.tv_sec = gnc_time (NULL);
|
||||||
now.tv_nsec = 0;
|
now.tv_nsec = 0;
|
||||||
gnc_timespec_to_iso8601_buff(now, iso8601_str);
|
gnc_timespec_to_iso8601_buff(now, iso8601_str);
|
||||||
kvp_frame_set_string(frame, void_time_str, iso8601_str);
|
kvp_frame_set_string(frame, void_time_str, iso8601_str);
|
||||||
|
@ -487,10 +487,10 @@ void xaccTransSetDate (Transaction *trans,
|
|||||||
void xaccTransSetDatePostedGDate (Transaction *trans, GDate date);
|
void xaccTransSetDatePostedGDate (Transaction *trans, GDate date);
|
||||||
|
|
||||||
/** The xaccTransSetDatePostedSecs() method will modify the <i>posted</i>
|
/** The xaccTransSetDatePostedSecs() method will modify the <i>posted</i>
|
||||||
date of the transaction, specified by a time_t (see ctime(3)). The
|
date of the transaction, specified by a time64 (see ctime(3)). The
|
||||||
posted date is the date when this transaction was posted at the
|
posted date is the date when this transaction was posted at the
|
||||||
bank. */
|
bank. */
|
||||||
void xaccTransSetDatePostedSecs (Transaction *trans, time_t time);
|
void xaccTransSetDatePostedSecs (Transaction *trans, time64 time);
|
||||||
|
|
||||||
/** The xaccTransSetDatePostedTS() method does the same thing as
|
/** The xaccTransSetDatePostedTS() method does the same thing as
|
||||||
xaccTransSetDatePostedSecs(), but takes a struct timespec64. */
|
xaccTransSetDatePostedSecs(), but takes a struct timespec64. */
|
||||||
@ -499,7 +499,7 @@ void xaccTransSetDatePostedTS (Transaction *trans,
|
|||||||
|
|
||||||
/** Modify the date of when the transaction was entered. The entered
|
/** Modify the date of when the transaction was entered. The entered
|
||||||
* date is the date when the register entry was made. */
|
* date is the date when the register entry was made. */
|
||||||
void xaccTransSetDateEnteredSecs (Transaction *trans, time_t time);
|
void xaccTransSetDateEnteredSecs (Transaction *trans, time64 time);
|
||||||
/** Modify the date of when the transaction was entered. The entered
|
/** Modify the date of when the transaction was entered. The entered
|
||||||
* date is the date when the register entry was made. */
|
* date is the date when the register entry was made. */
|
||||||
void xaccTransSetDateEnteredTS (Transaction *trans,
|
void xaccTransSetDateEnteredTS (Transaction *trans,
|
||||||
@ -512,7 +512,7 @@ void xaccTransSetDateDueTS (Transaction *trans, const Timespec *ts);
|
|||||||
the date when this transaction was posted at the bank. (Although
|
the date when this transaction was posted at the bank. (Although
|
||||||
having different function names, GetDate and GetDatePosted refer
|
having different function names, GetDate and GetDatePosted refer
|
||||||
to the same single date.)*/
|
to the same single date.)*/
|
||||||
time_t xaccTransGetDate (const Transaction *trans);
|
time64 xaccTransGetDate (const Transaction *trans);
|
||||||
/** Retrieve the posted date of the transaction. The posted date is
|
/** Retrieve the posted date of the transaction. The posted date is
|
||||||
the date when this transaction was posted at the bank. (Although
|
the date when this transaction was posted at the bank. (Although
|
||||||
having different function names, GetDate and GetDatePosted refer
|
having different function names, GetDate and GetDatePosted refer
|
||||||
|
@ -464,7 +464,7 @@ xaccSplitAssignToLot (Split *split, GNCLot *lot)
|
|||||||
/* If we are here, then (cmp == +1 iff (amt > baln)) and we need
|
/* If we are here, then (cmp == +1 iff (amt > baln)) and we need
|
||||||
* to split up the split into pieces. Do it. */
|
* to split up the split into pieces. Do it. */
|
||||||
{
|
{
|
||||||
time_t now = time(0);
|
time64 now = gnc_time (NULL);
|
||||||
Split * new_split;
|
Split * new_split;
|
||||||
gnc_numeric amt_a, amt_b, amt_tot;
|
gnc_numeric amt_a, amt_b, amt_tot;
|
||||||
gnc_numeric val_a, val_b, val_tot;
|
gnc_numeric val_a, val_b, val_tot;
|
||||||
@ -1015,7 +1015,7 @@ xaccSplitComputeCapGains(Split *split, Account *gain_acc)
|
|||||||
/* Common to both */
|
/* Common to both */
|
||||||
ts = xaccTransRetDatePostedTS (split->parent);
|
ts = xaccTransRetDatePostedTS (split->parent);
|
||||||
xaccTransSetDatePostedTS (trans, &ts);
|
xaccTransSetDatePostedTS (trans, &ts);
|
||||||
xaccTransSetDateEnteredSecs (trans, time(0));
|
xaccTransSetDateEnteredSecs (trans, gnc_time (NULL));
|
||||||
|
|
||||||
xaccSplitSetAmount (lot_split, zero);
|
xaccSplitSetAmount (lot_split, zero);
|
||||||
xaccSplitSetValue (lot_split, value);
|
xaccSplitSetValue (lot_split, value);
|
||||||
|
@ -94,7 +94,7 @@ gnc_budget_init(GncBudget* budget)
|
|||||||
priv->description = CACHE_INSERT("");
|
priv->description = CACHE_INSERT("");
|
||||||
|
|
||||||
priv->num_periods = 12;
|
priv->num_periods = 12;
|
||||||
g_date_set_time_t(&date, time(NULL));
|
gnc_gdate_set_today (&date);
|
||||||
g_date_subtract_days(&date, g_date_get_day(&date) - 1);
|
g_date_subtract_days(&date, g_date_get_day(&date) - 1);
|
||||||
recurrenceSet(&priv->recurrence, 1, PERIOD_MONTH, &date, WEEKEND_ADJ_NONE);
|
recurrenceSet(&priv->recurrence, 1, PERIOD_MONTH, &date, WEEKEND_ADJ_NONE);
|
||||||
}
|
}
|
||||||
@ -571,8 +571,9 @@ Timespec
|
|||||||
gnc_budget_get_period_start_date(const GncBudget *budget, guint period_num)
|
gnc_budget_get_period_start_date(const GncBudget *budget, guint period_num)
|
||||||
{
|
{
|
||||||
Timespec ts;
|
Timespec ts;
|
||||||
timespecFromTime_t(
|
timespecFromTime64(
|
||||||
&ts, recurrenceGetPeriodTime(&GET_PRIVATE(budget)->recurrence, period_num, FALSE));
|
&ts, recurrenceGetPeriodTime(&GET_PRIVATE(budget)->recurrence,
|
||||||
|
period_num, FALSE));
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +581,7 @@ Timespec
|
|||||||
gnc_budget_get_period_end_date(const GncBudget *budget, guint period_num)
|
gnc_budget_get_period_end_date(const GncBudget *budget, guint period_num)
|
||||||
{
|
{
|
||||||
Timespec ts;
|
Timespec ts;
|
||||||
timespecFromTime_t(
|
timespecFromTime64(
|
||||||
&ts, recurrenceGetPeriodTime(&GET_PRIVATE(budget)->recurrence, period_num, TRUE));
|
&ts, recurrenceGetPeriodTime(&GET_PRIVATE(budget)->recurrence, period_num, TRUE));
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
@ -1304,7 +1304,7 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
|
|||||||
xaccTransSetCurrency (txn, invoice->currency);
|
xaccTransSetCurrency (txn, invoice->currency);
|
||||||
|
|
||||||
/* Entered and Posted at date */
|
/* Entered and Posted at date */
|
||||||
xaccTransSetDateEnteredSecs (txn, time(NULL));
|
xaccTransSetDateEnteredSecs (txn, gnc_time (NULL));
|
||||||
if (post_date)
|
if (post_date)
|
||||||
{
|
{
|
||||||
xaccTransSetDatePostedTS (txn, post_date);
|
xaccTransSetDatePostedTS (txn, post_date);
|
||||||
|
@ -782,7 +782,7 @@ gncOwnerCreatePaymentLot (const GncOwner *owner, Transaction *txn,
|
|||||||
xaccTransSetDescription (txn, name ? name : "");
|
xaccTransSetDescription (txn, name ? name : "");
|
||||||
xaccTransSetNum (txn, num);
|
xaccTransSetNum (txn, num);
|
||||||
xaccTransSetCurrency (txn, commodity);
|
xaccTransSetCurrency (txn, commodity);
|
||||||
xaccTransSetDateEnteredSecs (txn, time(NULL));
|
xaccTransSetDateEnteredSecs (txn, gnc_time (NULL));
|
||||||
xaccTransSetDatePostedTS (txn, &date);
|
xaccTransSetDatePostedTS (txn, &date);
|
||||||
xaccTransSetTxnType (txn, TXN_TYPE_PAYMENT);
|
xaccTransSetTxnType (txn, TXN_TYPE_PAYMENT);
|
||||||
|
|
||||||
@ -952,7 +952,7 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots)
|
|||||||
|
|
||||||
xaccTransSetDescription (txn, name ? name : "");
|
xaccTransSetDescription (txn, name ? name : "");
|
||||||
xaccTransSetCurrency (txn, xaccAccountGetCommodity(acct));
|
xaccTransSetCurrency (txn, xaccAccountGetCommodity(acct));
|
||||||
xaccTransSetDateEnteredSecs (txn, time(NULL));
|
xaccTransSetDateEnteredSecs (txn, gnc_time (NULL));
|
||||||
xaccTransSetDatePostedTS (txn, &ts);
|
xaccTransSetDatePostedTS (txn, &ts);
|
||||||
xaccTransSetTxnType (txn, TXN_TYPE_LINK);
|
xaccTransSetTxnType (txn, TXN_TYPE_LINK);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ maybe_resort_list (GncTaxTable *table)
|
|||||||
static inline void
|
static inline void
|
||||||
mod_table (GncTaxTable *table)
|
mod_table (GncTaxTable *table)
|
||||||
{
|
{
|
||||||
timespecFromTime_t (&table->modtime, time(NULL));
|
timespecFromTime64 (&table->modtime, gnc_time (NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void addObj (GncTaxTable *table)
|
static inline void addObj (GncTaxTable *table)
|
||||||
|
@ -57,7 +57,7 @@ run_test (void)
|
|||||||
gnc_numeric old_amt, new_amt, old_val, new_val;
|
gnc_numeric old_amt, new_amt, old_val, new_val;
|
||||||
QofBook *book;
|
QofBook *book;
|
||||||
Timespec ts;
|
Timespec ts;
|
||||||
time_t now;
|
time64 now;
|
||||||
|
|
||||||
char *reason = "because I can";
|
char *reason = "because I can";
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ run_test (void)
|
|||||||
old_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
|
old_amt = xaccSplitGetAmount(xaccTransGetSplit(transaction, 0));
|
||||||
old_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
|
old_val = xaccSplitGetValue(xaccTransGetSplit(transaction, 1));
|
||||||
|
|
||||||
now = time (NULL);
|
now = gnc_time (NULL);
|
||||||
|
|
||||||
xaccTransVoid(transaction, reason);
|
xaccTransVoid(transaction, reason);
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <unittest-support.h>
|
#include <unittest-support.h>
|
||||||
#include <gnc-event.h>
|
#include <gnc-event.h>
|
||||||
|
#include <gnc-gdate-utils.h>
|
||||||
/* Add specific headers for this class */
|
/* Add specific headers for this class */
|
||||||
#include "../Account.h"
|
#include "../Account.h"
|
||||||
#include "../AccountP.h"
|
#include "../AccountP.h"
|
||||||
@ -344,7 +345,7 @@ setup (Fixture *fixture, gconstpointer pData)
|
|||||||
Transaction *txn = xaccMallocTransaction (book);
|
Transaction *txn = xaccMallocTransaction (book);
|
||||||
TxnParms p = t_arr[ind];
|
TxnParms p = t_arr[ind];
|
||||||
GDate *date = g_date_new ();
|
GDate *date = g_date_new ();
|
||||||
g_date_set_time_t (date, time (0));
|
gnc_gdate_set_time64 (date, gnc_time (NULL));
|
||||||
xaccTransBeginEdit (txn);
|
xaccTransBeginEdit (txn);
|
||||||
if (p.desc)
|
if (p.desc)
|
||||||
xaccTransSetDescription (txn, p.desc);
|
xaccTransSetDescription (txn, p.desc);
|
||||||
@ -1872,7 +1873,7 @@ test_xaccAccountGetProjectedMinimumBalance (Fixture *fixture, gconstpointer pDat
|
|||||||
}
|
}
|
||||||
/* xaccAccountGetBalanceAsOfDate
|
/* xaccAccountGetBalanceAsOfDate
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccAccountGetBalanceAsOfDate (Account *acc, time_t date)// C: 12 in 7 SCM: 4 in 4*/
|
xaccAccountGetBalanceAsOfDate (Account *acc, time64 date)// C: 12 in 7 SCM: 4 in 4*/
|
||||||
static void
|
static void
|
||||||
test_xaccAccountGetBalanceAsOfDate (Fixture *fixture, gconstpointer pData)
|
test_xaccAccountGetBalanceAsOfDate (Fixture *fixture, gconstpointer pData)
|
||||||
{
|
{
|
||||||
@ -1893,7 +1894,8 @@ test_xaccAccountGetBalanceAsOfDate (Fixture *fixture, gconstpointer pData)
|
|||||||
}
|
}
|
||||||
dbal = gnc_numeric_to_double (bal);
|
dbal = gnc_numeric_to_double (bal);
|
||||||
xaccAccountRecomputeBalance (fixture->acct);
|
xaccAccountRecomputeBalance (fixture->acct);
|
||||||
val = xaccAccountGetBalanceAsOfDate (fixture->acct, (time (0) - offset));
|
val = xaccAccountGetBalanceAsOfDate (fixture->acct,
|
||||||
|
(gnc_time (NULL) - offset));
|
||||||
dval = gnc_numeric_to_double (val);
|
dval = gnc_numeric_to_double (val);
|
||||||
g_assert_cmpfloat (dval, == , dbal);
|
g_assert_cmpfloat (dval, == , dbal);
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ setup (Fixture *fixture, gconstpointer pData)
|
|||||||
Transaction *txn = xaccMallocTransaction (book);
|
Transaction *txn = xaccMallocTransaction (book);
|
||||||
TxnParms p = t_arr[ind];
|
TxnParms p = t_arr[ind];
|
||||||
GDate *date = g_date_new ();
|
GDate *date = g_date_new ();
|
||||||
g_date_set_time_t (date, time (0));
|
gnc_gdate_set_time64 (date, gnc_time (NULL));
|
||||||
xaccTransBeginEdit (txn);
|
xaccTransBeginEdit (txn);
|
||||||
if (p.desc)
|
if (p.desc)
|
||||||
xaccTransSetDescription (txn, p.desc);
|
xaccTransSetDescription (txn, p.desc);
|
||||||
@ -1868,7 +1868,7 @@ test_xaccAccountGetProjectedMinimumBalance (Fixture *fixture, gconstpointer pDat
|
|||||||
}
|
}
|
||||||
/* xaccAccountGetBalanceAsOfDate
|
/* xaccAccountGetBalanceAsOfDate
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccAccountGetBalanceAsOfDate (Account *acc, time_t date)// C: 12 in 7 SCM: 4 in 4*/
|
xaccAccountGetBalanceAsOfDate (Account *acc, time64 date)// C: 12 in 7 SCM: 4 in 4*/
|
||||||
static void
|
static void
|
||||||
test_xaccAccountGetBalanceAsOfDate (Fixture *fixture, gconstpointer pData)
|
test_xaccAccountGetBalanceAsOfDate (Fixture *fixture, gconstpointer pData)
|
||||||
{
|
{
|
||||||
@ -1889,7 +1889,8 @@ test_xaccAccountGetBalanceAsOfDate (Fixture *fixture, gconstpointer pData)
|
|||||||
}
|
}
|
||||||
dbal = gnc_numeric_to_double (bal);
|
dbal = gnc_numeric_to_double (bal);
|
||||||
xaccAccountRecomputeBalance (fixture->acct);
|
xaccAccountRecomputeBalance (fixture->acct);
|
||||||
val = xaccAccountGetBalanceAsOfDate (fixture->acct, (time (0) - offset));
|
val = xaccAccountGetBalanceAsOfDate (fixture->acct,
|
||||||
|
(gnc_time (NULL) - offset));
|
||||||
dval = gnc_numeric_to_double (val);
|
dval = gnc_numeric_to_double (val);
|
||||||
g_assert_cmpfloat (dval, == , dbal);
|
g_assert_cmpfloat (dval, == , dbal);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user