Skip to content

Commit

Permalink
Fix Lime Trading Corp PDF-Importer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored and buchen committed Oct 30, 2023
1 parent e2e3974 commit 6feca21
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package name.abuchen.portfolio.datatransfer.pdf.limetradingcorp;

import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countAccountTransactions;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countBuySell;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countSecurities;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.empty;
import static org.junit.Assert.assertNull;

import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.dividend;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasAmount;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasCurrencyCode;
Expand All @@ -24,7 +15,15 @@
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasTicker;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasWkn;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.security;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.taxes;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.taxRefund;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countAccountTransactions;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countBuySell;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countSecurities;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.empty;
import static org.junit.Assert.assertNull;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -51,20 +50,6 @@
import name.abuchen.portfolio.money.Money;
import name.abuchen.portfolio.money.Values;

/**
* @formatter:off
* @implNote Trading Corp. is a US-based financial services company.
* The currency is US$.
*
* All security currencies are USD.
*
* @implSpec The CUSIP number is the WKN number.
*
* @implSpec Dividend transactions:
* The amount of dividends is reported in gross.
* @formatter:on
*/

@SuppressWarnings("nls")
public class LimeTradingCorpPDFExtractorTest
{
Expand Down Expand Up @@ -368,39 +353,39 @@ public void testAccountStatement02()
hasTaxes("USD", 22.94), hasFees("USD", 0.00))));

// check taxes transaction
assertThat(results, hasItem(taxes( //
assertThat(results, hasItem(taxRefund( //
hasDate("2023-08-31T00:00"), hasShares(0.00), //
hasSource("AccountStatement02.txt"), //
hasNote("Withholding Adjustment"), //
hasAmount("USD", 23.43), hasGrossValue("USD", 23.43), //
hasTaxes("USD", 0.00), hasFees("USD", 0.00))));

// check taxes transaction
assertThat(results, hasItem(taxes( //
assertThat(results, hasItem(taxRefund( //
hasDate("2023-08-31T00:00"), hasShares(0.00), //
hasSource("AccountStatement02.txt"), //
hasNote("Withholding Adjustment"), //
hasAmount("USD", 9.15), hasGrossValue("USD", 9.15), //
hasTaxes("USD", 0.00), hasFees("USD", 0.00))));

// check taxes transaction
assertThat(results, hasItem(taxes( //
assertThat(results, hasItem(taxRefund( //
hasDate("2023-08-31T00:00"), hasShares(0.00), //
hasSource("AccountStatement02.txt"), //
hasNote("Withholding Adjustment"), //
hasAmount("USD", 1.79), hasGrossValue("USD", 1.79), //
hasTaxes("USD", 0.00), hasFees("USD", 0.00))));

// check taxes transaction
assertThat(results, hasItem(taxes( //
assertThat(results, hasItem(taxRefund( //
hasDate("2023-08-31T00:00"), hasShares(0.00), //
hasSource("AccountStatement02.txt"), //
hasNote("Withholding Adjustment"), //
hasAmount("USD", 0.92), hasGrossValue("USD", 0.92), //
hasTaxes("USD", 0.00), hasFees("USD", 0.00))));

// check taxes transaction
assertThat(results, hasItem(taxes( //
assertThat(results, hasItem(taxRefund( //
hasDate("2023-08-31T00:00"), hasShares(0.00), //
hasSource("AccountStatement02.txt"), //
hasNote("Withholding Adjustment"), //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private void addAccountStatementTransaction()

.subject(() -> {
AccountTransaction accountTransaction = new AccountTransaction();
accountTransaction.setType(AccountTransaction.Type.TAXES);
accountTransaction.setType(AccountTransaction.Type.TAX_REFUND);
return accountTransaction;
})

Expand Down

0 comments on commit 6feca21

Please sign in to comment.