mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 798578 - MT940 imports broken - all transactions have date of...
first transaction It's really the date of the opening balance and it's because AQBanking returns that instead of the value date if a transaction field has no entry date.: https://www.aquamaniac.de/rdm/issues/262
This commit is contained in:
parent
1d5e9d4d97
commit
436110e523
@ -111,7 +111,7 @@ gnc_gwen_date_to_time64 (const GNC_GWEN_DATE* date)
|
|||||||
* that's the case then back up a day to get a real date for
|
* that's the case then back up a day to get a real date for
|
||||||
* posting.
|
* posting.
|
||||||
*/
|
*/
|
||||||
if (month == 2 && day <= 30 && day > (is_leap_year(year) ? 29 : 28))
|
while (month == 2 && day <= 30 && day > (is_leap_year(year) ? 29 : 28))
|
||||||
--day;
|
--day;
|
||||||
return gnc_dmy2time64_neutral(day, month, year);
|
return gnc_dmy2time64_neutral(day, month, year);
|
||||||
#else
|
#else
|
||||||
@ -600,16 +600,16 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
|
|||||||
* German). The value date is the effective date for financial
|
* German). The value date is the effective date for financial
|
||||||
* calculation purposes and is mandatory, the entry date is the
|
* calculation purposes and is mandatory, the entry date is the
|
||||||
* date that the financial institution posted the
|
* date that the financial institution posted the
|
||||||
* transaction. Since the entry date is normally closer to the
|
* transaction. Unfortunately if the transaction field doesn't
|
||||||
* date that the customer's book should recognize the transaction
|
* provide an entry date AQBanking substitutes the date from the
|
||||||
* we prefer that date if present.
|
* last balance instead of using the value date or NULL, making
|
||||||
|
* the field unreliable.
|
||||||
*/
|
*/
|
||||||
post_date = AB_Transaction_GetDate(ab_trans);
|
|
||||||
value_date = AB_Transaction_GetValutaDate(ab_trans);
|
value_date = AB_Transaction_GetValutaDate(ab_trans);
|
||||||
if (post_date)
|
if (value_date)
|
||||||
post_time = gnc_gwen_date_to_time64(post_date);
|
|
||||||
else if (value_date)
|
|
||||||
post_time = gnc_gwen_date_to_time64(value_date);
|
post_time = gnc_gwen_date_to_time64(value_date);
|
||||||
|
else if ((post_date = AB_Transaction_GetDate(ab_trans))) // always true
|
||||||
|
post_time = gnc_gwen_date_to_time64(post_date);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_warning("transaction_cb: Import had no transaction date");
|
g_warning("transaction_cb: Import had no transaction date");
|
||||||
|
Loading…
Reference in New Issue
Block a user