mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Almost completely remove Timespec from import-export.
KvpValue doesn't have a time64 type so aqb-kvp still needs to use Timespec internally.
This commit is contained in:
parent
1131aa6fc4
commit
9993e0ce29
@ -51,10 +51,10 @@ struct _DaterangeInfo
|
||||
gboolean
|
||||
gnc_ab_enter_daterange(GtkWidget *parent,
|
||||
const char *heading,
|
||||
Timespec *from_date,
|
||||
time64 *from_date,
|
||||
gboolean *last_retv_date,
|
||||
gboolean *first_possible_date,
|
||||
Timespec *to_date,
|
||||
time64 *to_date,
|
||||
gboolean *to_now)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
@ -86,12 +86,12 @@ gnc_ab_enter_daterange(GtkWidget *parent,
|
||||
now_button = GTK_WIDGET(gtk_builder_get_object (builder, "now_button"));
|
||||
info.enter_to_button = GTK_WIDGET(gtk_builder_get_object (builder, "enter_to_button"));
|
||||
|
||||
info.from_dateedit = gnc_date_edit_new_ts(*from_date, FALSE, FALSE);
|
||||
info.from_dateedit = gnc_date_edit_new (*from_date, FALSE, FALSE);
|
||||
gtk_container_add(GTK_CONTAINER(gtk_builder_get_object (builder, "enter_from_box")),
|
||||
info.from_dateedit);
|
||||
gtk_widget_show(info.from_dateedit);
|
||||
|
||||
info.to_dateedit = gnc_date_edit_new_ts(*to_date, FALSE, FALSE);
|
||||
info.to_dateedit = gnc_date_edit_new (*to_date, FALSE, FALSE);
|
||||
gtk_container_add(GTK_CONTAINER(gtk_builder_get_object (builder, "enter_to_box")),
|
||||
info.to_dateedit);
|
||||
gtk_widget_show(info.to_dateedit);
|
||||
@ -122,14 +122,12 @@ gnc_ab_enter_daterange(GtkWidget *parent,
|
||||
|
||||
if (result == GTK_RESPONSE_OK)
|
||||
{
|
||||
*from_date = gnc_date_edit_get_date_ts(
|
||||
GNC_DATE_EDIT(info.from_dateedit));
|
||||
*from_date = gnc_date_edit_get_date(GNC_DATE_EDIT(info.from_dateedit));
|
||||
*last_retv_date = gtk_toggle_button_get_active(
|
||||
GTK_TOGGLE_BUTTON(last_retrieval_button));
|
||||
*first_possible_date = gtk_toggle_button_get_active(
|
||||
GTK_TOGGLE_BUTTON(first_button));
|
||||
*to_date = gnc_date_edit_get_date_ts(
|
||||
GNC_DATE_EDIT(info.to_dateedit));
|
||||
*to_date = gnc_date_edit_get_date (GNC_DATE_EDIT(info.to_dateedit));
|
||||
*to_now = gtk_toggle_button_get_active(
|
||||
GTK_TOGGLE_BUTTON(now_button));
|
||||
}
|
||||
|
@ -56,10 +56,10 @@ G_BEGIN_DECLS
|
||||
*/
|
||||
gboolean gnc_ab_enter_daterange(GtkWidget *parent,
|
||||
const char *heading,
|
||||
Timespec *from_date,
|
||||
time64 *from_date,
|
||||
gboolean *last_retv_date,
|
||||
gboolean *first_possible_date,
|
||||
Timespec *to_date,
|
||||
time64 *to_date,
|
||||
gboolean *to_now);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -50,8 +50,7 @@ static gboolean
|
||||
gettrans_dates(GtkWidget *parent, Account *gnc_acc,
|
||||
GWEN_TIME **from_date, GWEN_TIME **to_date)
|
||||
{
|
||||
Timespec last_timespec, until_timespec;
|
||||
time64 now = gnc_time (NULL);
|
||||
time64 last, until;
|
||||
gboolean use_last_date = TRUE;
|
||||
gboolean use_earliest_date = TRUE;
|
||||
gboolean use_until_now = TRUE;
|
||||
@ -59,19 +58,19 @@ gettrans_dates(GtkWidget *parent, Account *gnc_acc,
|
||||
g_return_val_if_fail(from_date && to_date, FALSE);
|
||||
|
||||
/* Get time of last retrieval */
|
||||
last_timespec = gnc_ab_get_account_trans_retrieval(gnc_acc);
|
||||
if (last_timespec.tv_sec == 0)
|
||||
last = gnc_ab_get_account_trans_retrieval(gnc_acc);
|
||||
if (last == 0)
|
||||
{
|
||||
use_last_date = FALSE;
|
||||
timespecFromTime64 (&last_timespec, now);
|
||||
last = gnc_time (NULL);
|
||||
}
|
||||
timespecFromTime64 (&until_timespec, now);
|
||||
until = gnc_time (NULL);
|
||||
|
||||
/* Let the user choose the date range of retrieval */
|
||||
if (!gnc_ab_enter_daterange(parent, NULL,
|
||||
&last_timespec,
|
||||
&last,
|
||||
&use_last_date, &use_earliest_date,
|
||||
&until_timespec, &use_until_now))
|
||||
&until, &use_until_now))
|
||||
return FALSE;
|
||||
|
||||
/* Now calculate from date */
|
||||
@ -82,14 +81,14 @@ gettrans_dates(GtkWidget *parent, Account *gnc_acc,
|
||||
else
|
||||
{
|
||||
if (use_last_date)
|
||||
last_timespec = gnc_ab_get_account_trans_retrieval(gnc_acc);
|
||||
*from_date = GWEN_Time_fromSeconds(timespecToTime64(last_timespec));
|
||||
last = gnc_ab_get_account_trans_retrieval(gnc_acc);
|
||||
*from_date = GWEN_Time_fromSeconds(last);
|
||||
}
|
||||
|
||||
/* Now calculate to date */
|
||||
if (use_until_now)
|
||||
timespecFromTime64(&until_timespec, now);
|
||||
*to_date = GWEN_Time_fromSeconds(timespecToTime64(until_timespec));
|
||||
until = gnc_time (NULL);
|
||||
*to_date = GWEN_Time_fromSeconds(until);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -101,7 +100,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
|
||||
gboolean online = FALSE;
|
||||
AB_ACCOUNT *ab_acc;
|
||||
GWEN_TIME *from_date = NULL, *to_date = NULL;
|
||||
Timespec until_timespec;
|
||||
time64 until;
|
||||
AB_JOB *job = NULL;
|
||||
AB_JOB_LIST2 *job_list = NULL;
|
||||
GncGWENGui *gui = NULL;
|
||||
@ -145,7 +144,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
|
||||
goto cleanup;
|
||||
}
|
||||
/* Use this as a local storage for the until_time below. */
|
||||
timespecFromTime64(&until_timespec, GWEN_Time_toTime_t(to_date));
|
||||
until = GWEN_Time_toTime_t(to_date);
|
||||
|
||||
/* Get a GetTransactions job and enqueue it */
|
||||
job = AB_JobGetTransactions_new(ab_acc);
|
||||
@ -217,7 +216,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
|
||||
}
|
||||
|
||||
/* Store the date of this retrieval */
|
||||
gnc_ab_set_account_trans_retrieval(gnc_acc, until_timespec);
|
||||
gnc_ab_set_account_trans_retrieval(gnc_acc, until);
|
||||
|
||||
cleanup:
|
||||
if (ieci)
|
||||
|
@ -95,22 +95,23 @@ gnc_ab_set_account_uid(Account *a, guint32 uid)
|
||||
xaccAccountCommitEdit(a);
|
||||
}
|
||||
|
||||
Timespec
|
||||
time64
|
||||
gnc_ab_get_account_trans_retrieval(const Account *a)
|
||||
{
|
||||
Timespec *t = NULL;
|
||||
qof_instance_get (QOF_INSTANCE (a),
|
||||
"ab-trans-retrieval", &t,
|
||||
NULL);
|
||||
return t ? *t : (Timespec){0, 0};
|
||||
return t ? t->tv_sec : 0;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_ab_set_account_trans_retrieval(Account *a, Timespec time)
|
||||
gnc_ab_set_account_trans_retrieval(Account *a, time64 time)
|
||||
{
|
||||
xaccAccountBeginEdit(a);
|
||||
Timespec ts = {time, 0};
|
||||
qof_instance_set (QOF_INSTANCE (a),
|
||||
"ab-trans-retrieval", &time,
|
||||
"ab-trans-retrieval", &ts,
|
||||
NULL);
|
||||
xaccAccountCommitEdit(a);
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ void gnc_ab_set_account_uid(Account *a, guint32 uid);
|
||||
* @param a Account
|
||||
* @return Retrieval time
|
||||
*/
|
||||
Timespec gnc_ab_get_account_trans_retrieval(const Account *a);
|
||||
time64 gnc_ab_get_account_trans_retrieval(const Account *a);
|
||||
|
||||
/**
|
||||
* Set the time of last online transaction retrieval for Account @a a. The
|
||||
@ -108,7 +108,7 @@ Timespec gnc_ab_get_account_trans_retrieval(const Account *a);
|
||||
* @param a Account
|
||||
* @param time Retrieval time
|
||||
*/
|
||||
void gnc_ab_set_account_trans_retrieval(Account *a, Timespec time);
|
||||
void gnc_ab_set_account_trans_retrieval(Account *a, time64 time);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
@ -150,7 +150,6 @@ test_qofsession_aqb_kvp( void )
|
||||
QofBook *book = qof_session_get_book(new_session);
|
||||
Account* account = gnc_book_get_root_account(book);
|
||||
struct tm *retrieved_date, *original_date;
|
||||
gchar buff[MAX_DATE_LENGTH];
|
||||
|
||||
g_assert(account);
|
||||
|
||||
@ -158,10 +157,13 @@ test_qofsession_aqb_kvp( void )
|
||||
// from the xml file?
|
||||
if (1)
|
||||
{
|
||||
Timespec retrieved_ts = gnc_ab_get_account_trans_retrieval(account);
|
||||
g_test_message("retrieved_ts=%s\n", gnc_print_date(retrieved_ts));
|
||||
time64 retrieved = gnc_ab_get_account_trans_retrieval(account);
|
||||
char date_buf [MAX_DATE_LENGTH + 1];
|
||||
memset (date_buf, 0, sizeof(date_buf));
|
||||
qof_print_date_buff (date_buf, sizeof(date_buf), retrieved);
|
||||
g_test_message("retrieved=%s\n", date_buf);
|
||||
|
||||
retrieved_date = gnc_gmtime (&retrieved_ts.tv_sec);
|
||||
retrieved_date = gnc_gmtime (&retrieved);
|
||||
g_assert_cmpint (retrieved_date->tm_year, ==, 114);
|
||||
g_assert_cmpint (retrieved_date->tm_mon, ==, 7);
|
||||
g_assert_cmpint (retrieved_date->tm_mday, ==, 29);
|
||||
@ -172,17 +174,23 @@ test_qofsession_aqb_kvp( void )
|
||||
// Account, just a general Account object.
|
||||
if (1)
|
||||
{
|
||||
Timespec original_ts = timespec_now(), retrieved_ts;
|
||||
time64 original = gnc_time (NULL), retrieved;
|
||||
char date_buf_1 [MAX_DATE_LENGTH + 1];
|
||||
char date_buf_2 [MAX_DATE_LENGTH + 1];
|
||||
memset (date_buf_1, 0, sizeof(date_buf_1));
|
||||
memset (date_buf_2, 0, sizeof(date_buf_2));
|
||||
|
||||
// Check whether the "ab-trans-retrieval" property of Account
|
||||
// is written and read again correctly.
|
||||
gnc_ab_set_account_trans_retrieval(account, original_ts);
|
||||
retrieved_ts = gnc_ab_get_account_trans_retrieval(account);
|
||||
g_test_message("original_ts=%s\n", gnc_print_date(original_ts));
|
||||
g_test_message("retrieved_ts=%s\n", gnc_print_date(retrieved_ts));
|
||||
gnc_ab_set_account_trans_retrieval(account, original);
|
||||
retrieved = gnc_ab_get_account_trans_retrieval(account);
|
||||
qof_print_date_buff(date_buf_1, sizeof(date_buf_1), original);
|
||||
qof_print_date_buff(date_buf_2, sizeof(date_buf_2), retrieved);
|
||||
g_test_message("original_ts=%s\n", date_buf_1);
|
||||
g_test_message("retrieved_ts=%s\n", date_buf_2);
|
||||
|
||||
original_date = gnc_gmtime (&original_ts.tv_sec);
|
||||
retrieved_date = gnc_gmtime (&retrieved_ts.tv_sec);
|
||||
original_date = gnc_gmtime (&original);
|
||||
retrieved_date = gnc_gmtime (&retrieved);
|
||||
|
||||
g_assert_cmpint (retrieved_date->tm_year, ==, original_date->tm_year);
|
||||
g_assert_cmpint (retrieved_date->tm_mon, ==, original_date->tm_mon);
|
||||
|
@ -148,10 +148,10 @@ add_reconcile_date (gchar *so_far, Split *split, CsvExportInfo *info)
|
||||
|
||||
if (xaccSplitGetReconcile (split) == YREC)
|
||||
{
|
||||
Timespec ts = {0,0};
|
||||
const gchar *str_rec_date;
|
||||
xaccSplitGetDateReconciledTS (split, &ts);
|
||||
str_rec_date = gnc_print_date (ts);
|
||||
char str_rec_date[MAX_DATE_LENGTH + 1];
|
||||
memset (str_rec_date, 0, sizeof(str_rec_date));
|
||||
time64 t = xaccSplitGetDateReconciled (split);
|
||||
qof_print_date_buff (str_rec_date, sizeof(str_rec_date), t);
|
||||
result = g_strconcat (so_far, str_rec_date, info->mid_sep, NULL);
|
||||
}
|
||||
else
|
||||
|
@ -251,15 +251,14 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
Timespec date;
|
||||
timespecFromTime64 (&date, static_cast<time64>(GncDateTime(*m_date, DayPart::neutral)));
|
||||
date.tv_nsec = 0;
|
||||
auto date = static_cast<time64>(GncDateTime(*m_date, DayPart::neutral));
|
||||
|
||||
bool rev = false;
|
||||
auto amount = *m_amount;
|
||||
Result ret_val = ADDED;
|
||||
|
||||
GNCPrice *old_price = gnc_pricedb_lookup_day (pdb, *m_from_commodity, *m_to_currency, date);
|
||||
GNCPrice *old_price = gnc_pricedb_lookup_day_t64 (pdb, *m_from_commodity,
|
||||
*m_to_currency, date);
|
||||
|
||||
// Should old price be over writen
|
||||
if ((old_price != nullptr) && (over == true))
|
||||
@ -287,10 +286,14 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
|
||||
rev = true;
|
||||
|
||||
}
|
||||
DEBUG("Date is %s, Rev is %d, Commodity from is '%s', Currency is '%s', Amount is %s", gnc_print_date (date),
|
||||
rev, gnc_commodity_get_fullname (*m_from_commodity), gnc_commodity_get_fullname (*m_to_currency),
|
||||
amount.to_string().c_str());
|
||||
|
||||
char date_str [MAX_DATE_LENGTH + 1];
|
||||
memset (date_str, 0, sizeof(date_str));
|
||||
qof_print_date_buff (date_str, sizeof(date_str), date);
|
||||
DEBUG("Date is %s, Rev is %d, Commodity from is '%s', Currency is '%s', "
|
||||
"Amount is %s", date_str, rev,
|
||||
gnc_commodity_get_fullname (*m_from_commodity),
|
||||
gnc_commodity_get_fullname (*m_to_currency),
|
||||
amount.to_string().c_str());
|
||||
// Create the new price
|
||||
if (old_price == nullptr)
|
||||
{
|
||||
@ -311,7 +314,7 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
|
||||
auto amount_conv = amount.convert<RoundType::half_up>(CURRENCY_DENOM);
|
||||
gnc_price_set_value (price, static_cast<gnc_numeric>(amount_conv));
|
||||
|
||||
gnc_price_set_time (price, date);
|
||||
gnc_price_set_time64 (price, date);
|
||||
gnc_price_set_source (price, PRICE_SOURCE_USER_PRICE);
|
||||
//FIXME Not sure which one gnc_price_set_source (price, PRICE_SOURCE_FQ);
|
||||
gnc_price_set_typestr (price, PRICE_TYPE_LAST);
|
||||
|
@ -556,10 +556,11 @@ static void trans_add_split (Transaction* trans, Account* account, GncNumeric am
|
||||
value = amount * *price;
|
||||
else
|
||||
{
|
||||
Timespec ts = {xaccTransRetDatePosted (trans), 0};
|
||||
auto time = xaccTransRetDatePosted (trans);
|
||||
/* Import data didn't specify price, let's lookup the nearest in time */
|
||||
auto nprice = gnc_pricedb_lookup_nearest_in_time(gnc_pricedb_get_db(book),
|
||||
acct_comm, trans_curr, ts);
|
||||
auto nprice =
|
||||
gnc_pricedb_lookup_nearest_in_time64(gnc_pricedb_get_db(book),
|
||||
acct_comm, trans_curr, time);
|
||||
if (nprice)
|
||||
{
|
||||
/* Found a usable price. Let's check if the conversion direction is right */
|
||||
|
@ -292,7 +292,7 @@ fix_year(int y)
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_import_parse_date(const char *str, GncImportFormat fmt, Timespec *val)
|
||||
gnc_import_parse_date(const char *str, GncImportFormat fmt, time64 *val)
|
||||
{
|
||||
regmatch_t match[5];
|
||||
char temp[9];
|
||||
@ -405,7 +405,7 @@ gnc_import_parse_date(const char *str, GncImportFormat fmt, Timespec *val)
|
||||
return FALSE;
|
||||
|
||||
y = fix_year(y);
|
||||
*val = gnc_dmy2timespec(d, m, y);
|
||||
*val = gnc_dmy2time64(d, m, y);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ GncImportFormat gnc_import_choose_fmt(const char* msg, GncImportFormat fmts,
|
||||
gboolean gnc_import_parse_numeric(const char* str, GncImportFormat fmt,
|
||||
gnc_numeric *val);
|
||||
gboolean gnc_import_parse_date(const char *date, GncImportFormat fmt,
|
||||
Timespec *val);
|
||||
time64 *val);
|
||||
|
||||
/* Set and clear flags in bit-flags */
|
||||
#define import_set_flag(i,f) (i |= f)
|
||||
|
@ -71,11 +71,11 @@ typedef struct _split_record
|
||||
int trans_guid_present;
|
||||
GncGUID split_guid;
|
||||
int split_guid_present;
|
||||
Timespec log_date;
|
||||
time64 log_date;
|
||||
int log_date_present;
|
||||
Timespec date_entered;
|
||||
time64 date_entered;
|
||||
int date_entered_present;
|
||||
Timespec date_posted;
|
||||
time64 date_posted;
|
||||
int date_posted_present;
|
||||
GncGUID acc_guid;
|
||||
int acc_guid_present;
|
||||
@ -97,7 +97,7 @@ typedef struct _split_record
|
||||
int amount_present;
|
||||
gnc_numeric value;
|
||||
int value_present;
|
||||
Timespec date_reconciled;
|
||||
time64 date_reconciled;
|
||||
int date_reconciled_present;
|
||||
} split_record;
|
||||
/********************************************************************\
|
||||
@ -181,20 +181,17 @@ static split_record interpret_split_record( char *record_line)
|
||||
}
|
||||
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
|
||||
{
|
||||
time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.log_date.tv_sec = secs;
|
||||
record.log_date = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.log_date_present = TRUE;
|
||||
}
|
||||
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
|
||||
{
|
||||
time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.date_entered.tv_sec = secs;
|
||||
record.date_entered = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.date_entered_present = TRUE;
|
||||
}
|
||||
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
|
||||
{
|
||||
time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.date_posted.tv_sec = secs;
|
||||
record.date_posted = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.date_posted_present = TRUE;
|
||||
}
|
||||
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
|
||||
@ -249,8 +246,7 @@ static split_record interpret_split_record( char *record_line)
|
||||
}
|
||||
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
|
||||
{
|
||||
time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.date_reconciled.tv_sec = secs;
|
||||
record.date_reconciled = gnc_iso8601_to_time64_gmt(tok_ptr);
|
||||
record.date_reconciled_present = TRUE;
|
||||
}
|
||||
|
||||
@ -298,17 +294,17 @@ static void dump_split_record(split_record record)
|
||||
}
|
||||
if (record.log_date_present)
|
||||
{
|
||||
gnc_timespec_to_iso8601_buff (record.log_date, string_buf);
|
||||
gnc_time64_to_iso8601_buff (record.log_date, string_buf);
|
||||
DEBUG("Log entry date: %s", string_buf);
|
||||
}
|
||||
if (record.date_entered_present)
|
||||
{
|
||||
gnc_timespec_to_iso8601_buff (record.date_entered, string_buf);
|
||||
gnc_time64_to_iso8601_buff (record.date_entered, string_buf);
|
||||
DEBUG("Date entered: %s", string_buf);
|
||||
}
|
||||
if (record.date_posted_present)
|
||||
{
|
||||
gnc_timespec_to_iso8601_buff (record.date_posted, string_buf);
|
||||
gnc_time64_to_iso8601_buff (record.date_posted, string_buf);
|
||||
DEBUG("Date posted: %s", string_buf);
|
||||
}
|
||||
if (record.acc_guid_present)
|
||||
@ -358,7 +354,7 @@ static void dump_split_record(split_record record)
|
||||
}
|
||||
if (record.date_reconciled_present)
|
||||
{
|
||||
gnc_timespec_to_iso8601_buff (record.date_reconciled, string_buf);
|
||||
gnc_time64_to_iso8601_buff (record.date_reconciled, string_buf);
|
||||
DEBUG("Reconciled date: %s", string_buf);
|
||||
}
|
||||
}
|
||||
@ -452,11 +448,11 @@ static void process_trans_record( FILE *log_file)
|
||||
/*Fill the transaction info*/
|
||||
if (record.date_entered_present)
|
||||
{
|
||||
xaccTransSetDateEnteredSecs(trans, record.date_entered.tv_sec);
|
||||
xaccTransSetDateEnteredSecs(trans, record.date_entered);
|
||||
}
|
||||
if (record.date_posted_present)
|
||||
{
|
||||
xaccTransSetDatePostedSecs(trans, record.date_posted.tv_sec);
|
||||
xaccTransSetDatePostedSecs(trans, record.date_posted);
|
||||
}
|
||||
if (record.trans_num_present)
|
||||
{
|
||||
@ -510,7 +506,7 @@ static void process_trans_record( FILE *log_file)
|
||||
}
|
||||
if (record.date_reconciled_present)
|
||||
{
|
||||
xaccSplitSetDateReconciledTS (split, &(record.date_reconciled));
|
||||
xaccSplitSetDateReconciledSecs (split, record.date_reconciled);
|
||||
}
|
||||
if (record.split_reconcile_present)
|
||||
{
|
||||
|
@ -503,9 +503,8 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
|
||||
}
|
||||
if (data.date_funds_available_valid)
|
||||
{
|
||||
Timespec ts;
|
||||
timespecFromTime64(&ts, data.date_funds_available);
|
||||
gnc_timespec_to_iso8601_buff (ts, dest_string);
|
||||
time64 time = data.date_funds_available;
|
||||
gnc_time64_to_iso8601_buff (time, dest_string);
|
||||
tmp = notes;
|
||||
notes = g_strdup_printf("%s%s%s", tmp,
|
||||
"|Date funds available:", dest_string);
|
||||
|
@ -3137,7 +3137,9 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
|
||||
duplicates = wind->match_transactions;
|
||||
while (!scm_is_null(duplicates))
|
||||
{
|
||||
Timespec send_ts = {0,0};
|
||||
time64 send_time = 0;
|
||||
char date_buf[MAX_DATE_LENGTH + 1];
|
||||
memset (date_buf, 0, sizeof(date_buf));
|
||||
current_xtn = SCM_CAAR(duplicates);
|
||||
#define FUNC_NAME "xaccTransCountSplits"
|
||||
gnc_xtn = SWIG_MustGetPtr(current_xtn,
|
||||
@ -3154,12 +3156,13 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
|
||||
(xaccSplitGetAccount(gnc_split), TRUE));
|
||||
}
|
||||
gtk_list_store_append(store, &iter);
|
||||
send_ts.tv_sec = xaccTransRetDatePosted(gnc_xtn);
|
||||
send_time = xaccTransRetDatePosted(gnc_xtn);
|
||||
qof_print_date_buff (date_buf, sizeof(date_buf), send_time);
|
||||
gtk_list_store_set
|
||||
(store, &iter,
|
||||
QIF_TRANS_COL_INDEX, rownum++,
|
||||
QIF_TRANS_COL_DATE,
|
||||
gnc_print_date(send_ts),
|
||||
date_buf,
|
||||
QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
|
||||
QIF_TRANS_COL_AMOUNT, amount_str,
|
||||
-1);
|
||||
|
@ -137,11 +137,11 @@ test_parse_numeric(void)
|
||||
static void
|
||||
test_date(const char* str, GncImportFormat fmt, my_ymd_t date)
|
||||
{
|
||||
Timespec ts, ts2;;
|
||||
time64 t1, t2;
|
||||
|
||||
do_test(gnc_import_parse_date(str, fmt, &ts), "Parsing date");
|
||||
ts2 = gnc_dmy2timespec(date.d, date.m, date.y);
|
||||
do_test(timespec_equal(&ts, &ts2), "Date Equal");
|
||||
do_test(gnc_import_parse_date(str, fmt, &t1), "Parsing date");
|
||||
t2 = gnc_dmy2time64(date.d, date.m, date.y);
|
||||
do_test(t1 == t2, "Date Equal");
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user