Bug 343484 - Transactions created with no payee/receiver after OFX import when payee has default account
Summary: Transactions created with no payee/receiver after OFX import when payee has d...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.8.0
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-28 22:56 UTC by BobSCA
Modified: 2019-08-29 15:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1,5.0.0


Attachments
OFX test file (1.60 KB, text/plain)
2017-07-31 12:09 UTC, Ralf Habacker
Details
kmymoney test file (4.24 KB, application/x-kmymoney)
2017-07-31 12:09 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BobSCA 2015-01-28 22:56:41 UTC
When an OFX file is imported, if there are transactions which specify an existing payee for which a default account has been assigned, then each of those transactions will appear in 2 registers as expected. In the register of the account for which the import is performed, the payee info appears in both the payee and memo fields (this seems redundant but I assume there is a reason for it).

In the register of the account specified as the default account for the payee, however, the transaction appears with no payee information in either the payee or memo field.

Reproducible: Always

Steps to Reproduce:
1. Assign a default account to a payee (Account1).
2. Import an OFX file containing one or more transactions for that payee into Account2.


Actual Results:  
The imported transactions in the register of Account1 have no payee information in either the payee or the memo fields.

Expected Results:  
The payee field should contain the name of the payee when viewed in the register of Account1 or Account2.

I may have observed a similar problem when the payee default account specifies a category rather than an account, but I have not been able to reproduce that problem.
Comment 1 BobSCA 2015-01-28 22:58:38 UTC
Version 4.7.1
Comment 2 BobSCA 2015-01-29 18:17:47 UTC
I have confirmed that the same problem occurs if the payee's default account specifies a category rather than an account. When viewing the imported transaction in the ledger for the specified category there is no payee information.
Comment 3 BobSCA 2016-09-02 16:54:43 UTC
(In reply to BobSCA from comment #1)
> Version 4.7.1
Still present in 4.8.0.
Comment 4 Ralf Habacker 2017-06-26 15:29:53 UTC
The chance that someone may take a look into this bug will be higher if there would be a testcase with a minimal kmy and ofx file.
Comment 5 Ralf Habacker 2017-07-31 12:09:13 UTC
Created attachment 106981 [details]
OFX test file
Comment 6 Ralf Habacker 2017-07-31 12:09:55 UTC
Created attachment 106982 [details]
kmymoney test file
Comment 7 Ralf Habacker 2017-07-31 12:55:35 UTC
(In reply to BobSCA from comment #0)
> When an OFX file is imported, if there are transactions which specify an
> existing payee for which a default account has been assigned, then each of
> those transactions will appear in 2 registers as expected. 
showed by test case
> In the register of the account for which the import is performed
which is account2 

> the payee info appears in both the payee and memo fields (this seems redundant but I assume there is a
> reason for it).

This is the case if the memo field is not set in the ofx file -> see statement with date '201401312' - not sure if this is a bug or a feature. 

> In the register of the account specified as the default account for the
> payee, however, the transaction appears with no payee information in either
> the payee or memo field.

Could be reproduced with appended test files.

Saving the file as xml file the related accounts looks like 

  <ACCOUNT currency="EUR" description="" parentaccount="AStd::Asset" opened="2014-01-01" number="" lastmodified="2017-07-31" type="1" id="A000001" lastreconciled="" institution="" name="Account2">
  </ACCOUNT>
  <ACCOUNT currency="EUR" description="" parentaccount="AStd::Expense" opened="1900-01-01" number="" lastmodified="2017-07-31" type="13" id="A000002" lastreconciled="" institution="" name="Account1">
  </ACCOUNT>

and the transaction as 

  <TRANSACTION postdate="2014-01-31" commodity="EUR" memo="payee" id="T000000000000000007" entrydate="2017-07-31">
   <SPLITS>
    <SPLIT payee="" reconcileflag="1" shares="-139/100" reconciledate="" action="" bankid="" account="A000002" number="" value="-139/100" memo="" id="S0001"/>
    <SPLIT payee="P000001" reconcileflag="0" shares="139/100" reconciledate="" action="" bankid="ID 201401312" account="A000001" number="" value="139/100" memo="payee" id="S0002"/>
   </SPLITS>
   <KEYVALUEPAIRS>
    <PAIR key="Imported" value="true"/>
   </KEYVALUEPAIRS>
  </TRANSACTION>

The transactions consists of two splits. The one for Account1 does not have the memo or payee set as shown below:

    <SPLIT payee="" reconcileflag="1" shares="-139/100" reconciledate="" action="" bankid="" account="A000002" number="" value="-139/100" memo="" id="S0001"/>

This indicates that the importer does not create them.
Comment 8 Ralf Habacker 2017-08-01 08:45:41 UTC
Git commit 88b4bcf44fd336efa36dbcdd225c84e034928cfd by Ralf Habacker.
Committed on 01/08/2017 at 08:42.
Pushed by habacker into branch '4.8'.

Fix 'Transactions created with no payee/receiver after OFX import when payee has default account'

Importing ofx transactions that matches a payee with assigned default
account creates a kmymoney transaction with two splits.
The split addressing the default account did not have the memo and
payee attribute set from the recent transaction.

FIXED-IN:4.8.1

M  +2    -0    kmymoney/converter/mymoneystatementreader.cpp

https://commits.kde.org/kmymoney/88b4bcf44fd336efa36dbcdd225c84e034928cfd