Skip to content

Parse MT535 acquisition price when line 1 of field 70E has more subfields - #605

Open
fds2610 wants to merge 1 commit into
nemiah:masterfrom
fds2610:mt535-acquisition-price
Open

fds2610 wants to merge 1 commit into
nemiah:masterfrom
fds2610:mt535-acquisition-price

Conversation

@fds2610

@fds2610 fds2610 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #464

Field 70E HOLD consists of numbered lines; the acquisition price and its currency start line 2. The parser joins continuation lines and expected the "2" of line 2 directly after STK. As soon as a bank fills further subfields in line 1, the acquisition price is dropped. DKB (HKWPD v6) sends e.g.

:70E::HOLD//1STK++++20250825
2224,5983333+EUR

and the example in the specification (FinTS 3.0 Finanzdatenformate, B.4) looks the same way (1STK+805+00028+LU+20240822+ / 22,5624+EUR+). #464 was closed, but the fix never made it into the code.

Changes:

  • Line 2 of 70E is read from the block with its original line breaks (\r\n or @@); the previous pattern stays as a fallback.
  • The cast (float) $a.'.'.$b passed a string to setAcquisitionPrice(); fixed, so the phpstan baseline entry for it is removed. No new phpstan errors.
  • New Tests/Unit/MT535/MT535AcquisitionPriceTest.php: DKB format, specification example, old format, @@ divider, no 70E.

Verified with a real DKB statement of holdings (8 positions, all with acquisition price now).

This is (partly) generated code and I as human vouch for it's correctness.
I am using this code in my own repo. If something breaks, i'll fix it. Greets, Felix

…elds

Field 70E HOLD consists of numbered lines; the acquisition price and its
currency start line 2. DKB fills further subfields in line 1, e.g. the date
of the last movement:

    :70E::HOLD//1STK++++20250825
    2224,5983333+EUR

The parser joins continuation lines and expected "2" directly after "STK",
so the acquisition price was dropped for all holdings. Line 2 is now read
from the block with its original line breaks; the previous pattern stays as
fallback. This also fixes the string/float concatenation in the cast, so
the corresponding phpstan baseline entry is removed.

Fixes nemiah#464
@fds2610
fds2610 force-pushed the mt535-acquisition-price branch from d10ed7e to a09e0f0 Compare November 2, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DEPOT - AquisitionPreis funktioniert für einige Banken nicht + FIX

1 participant