Examples of Portfolio


Examples of name.abuchen.portfolio.model.Portfolio

    }

    @Test
    public void testThatNotTheSamePortfolioIsMatched()
    {
        Portfolio second = new Portfolio();
        client.addPortfolio(second);

        portfolio.addTransaction(new PortfolioTransaction(Dates.today(), security, //
                        PortfolioTransaction.Type.TRANSFER_IN, 1, 3, 1, 0));

        PortfolioTransaction umatched = new PortfolioTransaction(Dates.today(), security, //
                        PortfolioTransaction.Type.TRANSFER_OUT, 1, 3, 1, 0);
        portfolio.addTransaction(umatched);

        second.addTransaction(new PortfolioTransaction(Dates.today(), security, //
                        PortfolioTransaction.Type.TRANSFER_OUT, 1, 3, 1, 0));

        List<Issue> issues = new CrossEntryCheck().execute(client);

        assertThat(issues.size(), is(1));
        assertThat(issues.get(0), is(instanceOf(MissingPortfolioTransferIssue.class)));

        assertThat(portfolio.getTransactions(), hasItem(umatched));
        assertThat(second.getTransactions().get(0).getCrossEntry(), notNullValue());
        assertThat(second.getTransactions().get(0).getType(), is(PortfolioTransaction.Type.TRANSFER_OUT));

        applyFixes(client, issues);
    }
View Full Code Here

Examples of name.abuchen.portfolio.model.Portfolio

    }

    @Test
    public void testThatAccountTransactionsWithoutSecurity()
    {
        Portfolio second = new Portfolio();
        client.addPortfolio(second);

        account.addTransaction(new AccountTransaction(Dates.today(), null, //
                        AccountTransaction.Type.BUY, 1));
View Full Code Here

Examples of name.abuchen.portfolio.model.Portfolio

    @Test
    public void testThatPortfolioTransactionIsImported() throws ParseException
    {
        Client client = buildClient();
        Portfolio portfolio = client.getPortfolios().get(0);
        Security security = client.getSecurities().get(0);

        PortfolioTransactionDef def = new PortfolioTransactionDef();

        def.build(client, portfolio, //
                        new String[] { "2013-01-01", security.getIsin(), "", "", "1000,00", "10,00", "11,00", "1,234",
                                        "BUY" }, //
                        buildField2Column(def));

        PortfolioTransaction t = portfolio.getTransactions().get(portfolio.getTransactions().size() - 1);
        assertThat(t.getSecurity(), is(security));
        assertThat(t.getShares(), is((long) (1.234 * Values.Share.factor())));
        assertThat(t.getFees(), is(10L * Values.Amount.factor()));
        assertThat(t.getTaxes(), is(11L * Values.Amount.factor()));
        assertThat(t.getAmount(), is(1000L * Values.Amount.factor()));
 
View Full Code Here

Examples of name.abuchen.portfolio.model.Portfolio

        Account account = new Account();
        account.setName("test");
        client.addAccount(account);

        Portfolio portfolio = new Portfolio();
        portfolio.setName("test");
        portfolio.setReferenceAccount(account);
        client.addPortfolio(portfolio);

        Security security = new Security();
        security.setName("SAP AG");
        security.setIsin("DE0007164600");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.