@@ -184,6 +184,73 @@ public void testWertpapierKauf03WithSecurityInEUR()
184184 }))));
185185 }
186186
187+ @ Test
188+ public void testWertpapierKauf04 ()
189+ {
190+ GenoBrokerPDFExtractor extractor = new GenoBrokerPDFExtractor (new Client ());
191+
192+ List <Exception > errors = new ArrayList <>();
193+
194+ List <Item > results = extractor .extract (PDFInputFile .loadTestCase (getClass (), "Kauf04.txt" ), errors );
195+
196+ assertThat (errors , empty ());
197+ assertThat (countSecurities (results ), is (1L ));
198+ assertThat (countBuySell (results ), is (1L ));
199+ assertThat (countAccountTransactions (results ), is (0L ));
200+ assertThat (results .size (), is (2 ));
201+ new AssertImportActions ().check (results , CurrencyUnit .EUR );
202+
203+ // check security
204+ assertThat (results , hasItem (security ( //
205+ hasIsin ("US75062E1064" ), hasWkn ("A2JDMF" ), hasTicker (null ), //
206+ hasName ("RAFAEL HOLDINGS INC. REGISTERED SH. CLASS B DL -,01" ), //
207+ hasCurrencyCode ("USD" ))));
208+
209+ // check buy sell transaction
210+ assertThat (results , hasItem (purchase ( //
211+ hasDate ("2025-06-10T15:33" ), hasShares (2000 ), //
212+ hasSource ("Kauf04.txt" ), //
213+ hasNote ("Auftragsnummer: 625571/30.00 | Limit billigst" ), //
214+ hasAmount ("EUR" , 4222.17 ), hasGrossValue ("EUR" , 4156.80 ), //
215+ hasForexGrossValue ("USD" , 4740.00 ), //
216+ hasTaxes ("EUR" , 0.00 ), hasFees ("EUR" , 9.95 + 21.65 + 8.77 + 25.00 ))));
217+ }
218+
219+ @ Test
220+ public void testWertpapierKauf04WithSecurityInEUR ()
221+ {
222+ Security security = new Security ("Rafael Holdings Inc" , CurrencyUnit .EUR );
223+ security .setIsin ("US75062E1064" );
224+
225+ Client client = new Client ();
226+ client .addSecurity (security );
227+
228+ GenoBrokerPDFExtractor extractor = new GenoBrokerPDFExtractor (client );
229+
230+ List <Exception > errors = new ArrayList <>();
231+
232+ List <Item > results = extractor .extract (PDFInputFile .loadTestCase (getClass (), "Kauf04.txt" ), errors );
233+
234+ assertThat (errors , empty ());
235+ assertThat (countSecurities (results ), is (0L ));
236+ assertThat (countBuySell (results ), is (1L ));
237+ assertThat (countAccountTransactions (results ), is (0L ));
238+ assertThat (results .size (), is (1 ));
239+ new AssertImportActions ().check (results , CurrencyUnit .EUR );
240+
241+ // check buy sell transaction
242+ assertThat (results , hasItem (purchase ( //
243+ hasDate ("2025-06-10T15:33" ), hasShares (2000 ), //
244+ hasSource ("Kauf04.txt" ), //
245+ hasNote ("Auftragsnummer: 625571/30.00 | Limit billigst" ), //
246+ hasAmount ("EUR" , 4222.17 ), hasGrossValue ("EUR" , 4156.80 ), //
247+ hasTaxes ("EUR" , 0.00 ), hasFees ("EUR" , 9.95 + 21.65 + 8.77 + 25.00 ), check (tx -> {
248+ CheckCurrenciesAction c = new CheckCurrenciesAction ();
249+ Status s = c .process ((PortfolioTransaction ) tx , new Portfolio ());
250+ assertThat (s , is (Status .OK_STATUS ));
251+ }))));
252+ }
253+
187254 @ Test
188255 public void testWertpapierVerkauf01 ()
189256 {
0 commit comments