Skip to content

Commit

Permalink
Fixes all issues in Santander Consumer Bank PDF import
Browse files Browse the repository at this point in the history
Fixes all issues from commit f7dc7a0
  • Loading branch information
Nirus2000 authored and buchen committed Jul 26, 2023
1 parent a5237bd commit 7a18f0c
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 127 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package name.abuchen.portfolio.datatransfer.pdf.santanderconsumerbank;

import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.deposit;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasAmount;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasDate;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasNote;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasSource;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.interest;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.taxes;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countAccountTransactions;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countBuySell;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countSecurities;
Expand All @@ -16,6 +9,14 @@
import static org.hamcrest.collection.IsEmptyCollection.empty;
import static org.junit.Assert.assertNull;

import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.deposit;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasAmount;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasDate;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasNote;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasSource;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.interest;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.taxes;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -77,7 +78,7 @@ public void testWertpapierKauf01()
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2021-03-17T16:53:45")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(2)));
assertThat(entry.getPortfolioTransaction().getSource(), is("Kauf01.txt"));
assertThat(entry.getPortfolioTransaction().getNote(), is("Limit billigst"));
assertThat(entry.getPortfolioTransaction().getNote(), is("Auftragsnummer 000000/00.00 | Limit billigst"));

assertThat(entry.getPortfolioTransaction().getMonetaryAmount(),
is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(325.86))));
Expand Down Expand Up @@ -121,7 +122,7 @@ public void testWertpapierKauf02()
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2021-03-17T16:38:35")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(2)));
assertThat(entry.getPortfolioTransaction().getSource(), is("Kauf02.txt"));
assertThat(entry.getPortfolioTransaction().getNote(), is("Limit billigst"));
assertThat(entry.getPortfolioTransaction().getNote(), is("Auftragsnummer 000000/00.00 | Limit billigst"));

assertThat(entry.getPortfolioTransaction().getMonetaryAmount(),
is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(430.80))));
Expand Down Expand Up @@ -164,7 +165,7 @@ public void testDividende01()
assertThat(transaction.getDateTime(), is(LocalDateTime.parse("2021-06-16T00:00")));
assertThat(transaction.getShares(), is(Values.Share.factorize(2)));
assertThat(transaction.getSource(), is("Dividende01.txt"));
assertThat(transaction.getNote(), is("Quartalsdividende"));
assertThat(transaction.getNote(), is("Abrechnungsnr. 00000000000 | Quartalsdividende"));

assertThat(transaction.getMonetaryAmount(),
is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(2.07))));
Expand Down Expand Up @@ -207,7 +208,7 @@ public void testDividende01WithSecurityInEUR()
assertThat(transaction.getDateTime(), is(LocalDateTime.parse("2021-06-16T00:00")));
assertThat(transaction.getShares(), is(Values.Share.factorize(2)));
assertThat(transaction.getSource(), is("Dividende01.txt"));
assertThat(transaction.getNote(), is("Quartalsdividende"));
assertThat(transaction.getNote(), is("Abrechnungsnr. 00000000000 | Quartalsdividende"));

assertThat(transaction.getMonetaryAmount(),
is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(2.07))));
Expand Down Expand Up @@ -256,7 +257,7 @@ public void testDividende02()
assertThat(transaction.getDateTime(), is(LocalDateTime.parse("2021-05-10T00:00")));
assertThat(transaction.getShares(), is(Values.Share.factorize(2)));
assertThat(transaction.getSource(), is("Dividende02.txt"));
assertNull(transaction.getNote());
assertThat(transaction.getNote(), is("Abrechnungsnr. 0000000000"));

assertThat(transaction.getMonetaryAmount(),
is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(19.20))));
Expand All @@ -283,7 +284,7 @@ public void testKontoauszug01()
assertThat(countAccountTransactions(results), is(4L));
assertThat(results.size(), is(4));
new AssertImportActions().check(results, CurrencyUnit.EUR);

// assert transaction
assertThat(results, hasItem(taxes(hasDate("2023-05-31"), hasAmount("EUR", 1.66), //
hasSource("Kontoauszug01.txt"), hasNote(null))));
Expand Down
Loading

0 comments on commit 7a18f0c

Please sign in to comment.