[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kmymoney] kmymoney/plugins/ofx/import: Don't use memo as payee for investment transactions
From:       Thomas Baumgart <null () kde ! org>
Date:       2017-12-31 16:05:43
Message-ID: E1eVg7L-0002C4-Mi () code ! kde ! org
[Download RAW message or body]

Git commit e469782e605a56331ad6a04096d0b7153a9d3a7c by Thomas Baumgart.
Committed on 31/12/2017 at 16:05.
Pushed by tbaumgart into branch 'master'.

Don't use memo as payee for investment transactions

Summary:
During the import of an OFX investment transaction don't use the memo field as payee \
in case the payee information is not present. Use the PAYEEID or NAME field in that \
order only. In other cases leave the payee empty.

Test Plan:
Compile
Run 'make test'
Import OFX download statement for investment account.
Check that payee field remains empty for newly imported transactions.

Reviewers: ostroffjh

Reviewed By: ostroffjh

Differential Revision: https://phabricator.kde.org/D9561

M  +10   -0    kmymoney/plugins/ofx/import/ofximporter.cpp

https://commits.kde.org/kmymoney/e469782e605a56331ad6a04096d0b7153a9d3a7c

diff --git a/kmymoney/plugins/ofx/import/ofximporter.cpp \
b/kmymoney/plugins/ofx/import/ofximporter.cpp index cc734e03..b9255623 100644
--- a/kmymoney/plugins/ofx/import/ofximporter.cpp
+++ b/kmymoney/plugins/ofx/import/ofximporter.cpp
@@ -313,6 +313,16 @@ int OFXImporter::ofxTransactionCallback(struct \
OfxTransactionData data, void * p  break;
   }
 
+  // for investment transactions we don't use the meme as payee
+  if (data.invtransactiontype_valid) {
+    values.clear();
+    validity[0] = data.payee_id_valid;
+    validity[1] = data.name_valid;
+    validity[2] = false;
+    values += QString::fromUtf8(data.payee_id);
+    values += QString::fromUtf8(data.name);
+  }
+
   for (int idx = 0; idx < 3; ++idx) {
     if (validity[idx]) {
       t.m_strPayee = values[idx];


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic