mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 797858 - Transaction date is one day too early from...
SWIFT MT940 import. GWEN_Date_ToLocalTime doesn't handle Daylight Savings Time correctly so extract the day, month, and year from the GWEN_DATE and use our own coversion function.
This commit is contained in:
parent
e4e6ef4163
commit
82da49efc2
@ -89,6 +89,14 @@ struct _GncABImExContextImport
|
|||||||
GData *tmp_job_list;
|
GData *tmp_job_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline time64
|
||||||
|
gnc_gwen_date_to_time64 (const GWEN_DATE* date)
|
||||||
|
{
|
||||||
|
return gnc_dmy2time64_neutral(GWEN_Date_GetDay(date),
|
||||||
|
GWEN_Date_GetMonth(date),
|
||||||
|
GWEN_Date_GetYear(date));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gnc_GWEN_Init(void)
|
gnc_GWEN_Init(void)
|
||||||
{
|
{
|
||||||
@ -571,11 +579,7 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
|
|||||||
}
|
}
|
||||||
if (valuta_date)
|
if (valuta_date)
|
||||||
{
|
{
|
||||||
#ifdef AQBANKING6
|
time64 secs = gnc_gwen_date_to_time64(valuta_date);
|
||||||
time64 secs = GWEN_Date_toLocalTime(valuta_date);
|
|
||||||
#else
|
|
||||||
time64 secs = GWEN_Time_toTime_t(valuta_date);
|
|
||||||
#endif
|
|
||||||
xaccTransSetDatePostedSecsNormalized(gnc_trans, secs);
|
xaccTransSetDatePostedSecsNormalized(gnc_trans, secs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1057,12 +1061,7 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
|
|||||||
#endif
|
#endif
|
||||||
if (ti)
|
if (ti)
|
||||||
{
|
{
|
||||||
#ifdef AQBANKING6
|
booked_tt = gnc_gwen_date_to_time64(ti);
|
||||||
time64 secs = GWEN_Date_toLocalTime(ti);
|
|
||||||
#else
|
|
||||||
time64 secs = GWEN_Time_toTime_t(ti);
|
|
||||||
#endif
|
|
||||||
booked_tt = gnc_time64_get_day_neutral(secs);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user