Giter VIP home page Giter VIP logo

Comments (11)

keriati avatar keriati commented on May 28, 2024

OFX format is:

<?xml version="1.0" encoding="utf-8" ?><?OFX OFXHEADER="200" VERSION="202" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>

and the amounts look like this:

<TRNAMT>-8.95000</TRNAMT>

I tried to check the unit tests from parseOFX(), however as those are snapshot tests I am not really sure what output I should expect...

from actual.

keriati avatar keriati commented on May 28, 2024

Okay, so I found this here:

// Parsing is currently limited to 2 decimal places.

@youngcw could this be the reason that the OFX import is right now broken?

from actual.

youngcw avatar youngcw commented on May 28, 2024

@keriati Hmm. That change was to fix an issue someone else had where their bank only sometimes included decimal places in a csv. Im actually a little surprised that the ofx parser uses that same amount parsing.

@MatissJanis

from actual.

keriati avatar keriati commented on May 28, 2024

@youngcw maybe it is not, I am trying to make sense of packages/desktop-client/src/components/modals/ImportTransactions.jsx however the number of responsibilities and logic mixed together is crazy 🥲

from actual.

keriati avatar keriati commented on May 28, 2024

@youngcw Okay I managed to track it down, there are a lot of indirections, but it is hitting looselyParseAmount at some point. As the OFX export I have from the bank is giving me all numbers with such format: -8.95000 it is breaking the imports sadly.

Can be reproduced with this data.ofx file from the test mocks (I adjusted the amounts with 3 extra zeros):

OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<DTSERVER>20190124212851.000[0:UTC]
<LANGUAGE>ENG
<DTACCTUP>20190124212851.000[0:UTC]
<FI>
<ORG>Bank of America
<FID>5959
</FI>
<INTU.BID>6526
<INTU.USERID>jlongster03
</SONRS>
</SIGNONMSGSRSV1>
<BANKMSGSRSV1>
<STMTTRNRS>
<TRNUID>0
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<STMTRS>
<CURDEF>USD
<BANKACCTFROM>
<BANKID>012345678
<ACCTID>123456789123
<ACCTTYPE>CHECKING
</BANKACCTFROM>
<BANKTRANLIST>
<DTSTART>20190119120000
<DTEND>20190124120000
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190123120000
<TRNAMT>-30.00000
<FITID>00092990122-30.00019012312798.01
<NAME>PATIENT FIRST TOKEN 01/22 PURCHA
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190123120000
<TRNAMT>-3.77000
<FITID>00092990121-3.77019012312828.01
<NAME>STARBUCKS STORE 07604 01/21 PURC
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190123120000
<TRNAMT>-9.62
<FITID>00092990121-9.62019012312831.78
<NAME>STARBUCKS STORE 07604 01/21 PURC
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-115.99
<FITID>00090231800-115.99019012212841.40
<NAME>VERIZON DES:PAYMENTREC ID:XXXXX3
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-10.34
<FITID>00092990120-10.34019012212957.39
<NAME>URBAN FARMHOUSE NO 2 01/19 PURCH
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-22.53
<FITID>00092990120-22.53019012212967.73
<NAME>URBAN FARMHOUSE NO 2 01/19 PURCH
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-108.71
<FITID>00092990119-108.71019012212990.26
<NAME>TMOBILE*AUTO PAY 01/19 PURCHASE 
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-25.00
<FITID>00092990118-25.00019012213098.97
<NAME>COUNTY WASTE 01/18 PURCHASE 804-
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-32.38
<FITID>00092990118-32.38019012213123.97
<NAME>REGENCY MART CITGO 01/18 PURCHAS
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20190122120000
<TRNAMT>-6.07
<FITID>00092990117-6.07019012213156.35
<NAME>CHICK-FIL-A #01342 01/17 PURCHAS
</STMTTRN>
</BANKTRANLIST>
<LEDGERBAL>
<BALAMT>12798.01
<DTASOF>20190124212851
</LEDGERBAL>
</STMTRS>
</STMTTRNRS>
</BANKMSGSRSV1>
</OFX>

from actual.

keriati avatar keriati commented on May 28, 2024

Well looking at the code, I would suggest to revert this: #2399 as it is breaking now OFX import.

from actual.

youngcw avatar youngcw commented on May 28, 2024

Is OFX NA only? If so it could have its own parser that only allows decimal period where the loose parser is matching both decimal period and comma, that was part of the issue before

from actual.

gschmidl avatar gschmidl commented on May 28, 2024

OFX is not NA only. Here's my bank in Austria doing the same:

<STMTTRN>
  <TRNTYPE>XFER</TRNTYPE>
  <DTPOSTED>...</DTPOSTED>
  <DTUSER>...</DTUSER>
  <DTAVAIL>...</DTAVAIL>
  <TRNAMT>-12.38000</TRNAMT>
  <FITID>...</FITID>
  <REFNUM>...</REFNUM>
  <BANKACCTTO>
    <BANKID>...</BANKID>
    <ACCTID>...</ACCTID>
    <ACCTTYPE>CHECKING</ACCTTYPE>
  </BANKACCTTO>
  <MEMO>...</MEMO>
</STMTTRN>

from actual.

keriati avatar keriati commented on May 28, 2024

Fix is provided in #2421

from actual.

youngcw avatar youngcw commented on May 28, 2024

@gschmidl Can you try out #2421 and see if it fixes your issue?

from actual.

keriati avatar keriati commented on May 28, 2024

Just tested it in 24.4.0 and it works now correctly

from actual.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.