This forum has been archived. All content is frozen. Please use KDE Discuss instead.

<TRNTYPE> ignored in OFX files

Tags: None
(comma "," separated)
jklaas
Registered Member
Posts
2
Karma
0

<TRNTYPE> ignored in OFX files

Wed Apr 10, 2019 8:49 pm
I have a knucklehead bank that provides an OFX file where the Charge values are positive and the Payment values are negative.

Kmymoney seems to not use the <TRNTYPE>, but only imports based on the <TRNAMT> of the transaction.

is there a way to force it into the correct column based on <TRNTYPE> rather than <TRNAMT>?

Is there any way to adjust this before the import?

I've emailed the bank complaining, but I don't expect a response.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: <TRNTYPE> ignored in OFX files

Thu Apr 11, 2019 6:20 am
About signs, the OFX spec version 2.2 says the following:
OFX Spec wrote:3.2.9.2 Positive and Negative Signs
Most OFX transaction aggregates describe the flow of funds. Amounts in transactions which clearly
describe the flow of funds should normally be positive. For example, bank transfers (<INTRARQ>), bill
payments (<PMTRQ>) and investment buys/sells (<BUYSTOCK>, <SELLSTOCK>) should all have
positive amounts.

Balances in statement download and closing aggregates will typically be signed based on their effect on
the user’s net worth. For example, a credit card balance is typically negative indicating charges on the
account decreasing their net worth, a checking account is typically positive indicating it has funding and
increases the user’s net worth. An exception to this rule applies to summary information aggregates (such
as <LOANDETAIL>) which contain summary or informational balance information (such as
<LOANINITBAL>, <PRINCIPALBAL>) as well as similar summary fields throughout the specification -
these balance tags should always be signed positive.

An exception to the above rules are signage of the amount in statement download transactions, wrapped
within <STMTTRN></STMTTRN> tags. The amounts in these transactions should be signed on the basis
of how the account is affected, e.g. a <TRNTYPE>DEBIT should have a negative <TRNAMT> value.

and on the TRNTYPE I found:
OFX Spec wrote:Transaction type, see section 11.4.4.3 for possible values. This element does not
change the effect of the transaction upon the balance (increases and decreases
are indicated by the sign of the <TRNAMT>).

Does KMyMoney violate any of this in your case? There's always the possibility to write a little script that reverses the amount of transactions in your file before you import it into KMyMoney, but that is outside of the scope of the application.

Hope that helps/clarifies.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
jklaas
Registered Member
Posts
2
Karma
0

Re: <TRNTYPE> ignored in OFX files

Fri Apr 12, 2019 12:35 pm
ipwizard wrote:About signs, the OFX spec version 2.2 says the following:
...
Does KMyMoney violate any of this in your case?
Hope that helps/clarifies.


Well, so the OFX in question has a <STMTTRN> like this:

Code: Select all
        <STMTTRN>
            <TRNTYPE>Charge
            <DTPOSTED>20190130120000[0:GMT]
            <TRNAMT>15.69
            <FITID>120190130601901301
            <CORRECTFITID>120190130601901301
            <CORRECTACTION>REPLACE
            <NAME>MEIJER # 062
        </STMTTRN>


This has a <TRNTYPE> of Charge (which doesn't seem to exist in the OFX Spec). I have tried changing that to DEBIT, but the <TRNAMT> is positive instead of negative. My experiments in this found that changing the <TRNTYPE> made no difference. I also found another credit card that does this too.

I guess things are clarified in that the only field that matters In this case is <TRNAMT> and not <TRNTYPE>.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: <TRNTYPE> ignored in OFX files

Fri Apr 12, 2019 1:42 pm
The following transaction types are listed in OFX 2.2 (shown on http://www.ofx.net/ as being the current one):
  • CREDIT
  • DEBIT
  • INT
  • DIV
  • FEE
  • SRVCHG
  • DEP
  • ATM
  • POS
  • XFER
  • CHECK
  • PAYMENT
  • CASH
  • DIRECTDEP
  • DIRECTDEBIT
  • REPEATPMT
  • HOLD
  • OTHER


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], q.ignora, watchstar