Package name.abuchen.portfolio.model

Examples of name.abuchen.portfolio.model.BuySellEntry


    }

    @Test
    public void testThatCorrectBuySellEntriesAreNotReported()
    {
        BuySellEntry entry = new BuySellEntry(portfolio, account);
        entry.setType(PortfolioTransaction.Type.BUY);
        entry.setDate(Dates.today());
        entry.setSecurity(security);
        entry.setShares(1);
        entry.setAmount(100);
        entry.insert();

        assertThat(new CrossEntryCheck().execute(client).size(), is(0));
    }
View Full Code Here


        {
            account = new Account(UUID.randomUUID().toString());
            portfolio.setReferenceAccount(account);
        }

        BuySellEntry entry = new BuySellEntry(portfolio, portfolio.getReferenceAccount());
        entry.setType(type);
        entry.setDate(new DateTime(date).toDate());
        entry.setSecurity(security);
        entry.setShares(shares);
        entry.setAmount(amount);

        entry.insert();

        return this;
    }
View Full Code Here

        }

        @Override
        public void execute()
        {
            BuySellEntry entry = new BuySellEntry(portfolio, account);
            entry.setDate(transaction.getDate());
            entry.setType(transaction.getType());
            entry.setSecurity(transaction.getSecurity());
            entry.setShares(transaction.getShares());
            entry.setFees(transaction.getFees());
            entry.setTaxes(transaction.getTaxes());
            entry.setAmount(transaction.getAmount());
            entry.insert();

            portfolio.getTransactions().remove(transaction);
        }
View Full Code Here

        }

        @Override
        public void execute()
        {
            BuySellEntry entry = new BuySellEntry(portfolio, account);
            entry.setDate(transaction.getDate());
            entry.setType(PortfolioTransaction.Type.valueOf(transaction.getType().name()));
            entry.setSecurity(transaction.getSecurity());
            entry.setShares(1);
            entry.setFees(0);
            entry.setTaxes(0);
            entry.setAmount(transaction.getAmount());
            entry.insert();

            account.getTransactions().remove(transaction);
        }
View Full Code Here

            if (security == null)
                throw new UnsupportedOperationException(Messages.MsgMissingSecurity);
            if (portfolio.getReferenceAccount() == null)
                throw new UnsupportedOperationException(Messages.MsgMissingReferenceAccount);

            BuySellEntry t = new BuySellEntry(portfolio, portfolio.getReferenceAccount());
            t.setDate(date);
            t.setSecurity(security);
            t.setShares(shares);
            t.setFees(fees);
            t.setTaxes(taxes);
            t.setAmount(total);
            t.setType(type);
            t.insert();
        }
View Full Code Here

                    issues.add(new MissingBuySellPortfolioIssue(client, suspect.account, suspect.transaction));
                    iterAccount.remove();
                }
                else
                {
                    BuySellEntry entry = new BuySellEntry(match.portfolio, suspect.account);
                    entry.setType(match.transaction.getType());
                    entry.setDate(match.transaction.getDate());
                    entry.setSecurity(match.transaction.getSecurity());
                    entry.setShares(match.transaction.getShares());
                    entry.setFees(match.transaction.getFees());
                    entry.setTaxes(match.transaction.getTaxes());
                    entry.setAmount(match.transaction.getAmount());
                    entry.insert();

                    match.portfolio.getTransactions().remove(match.transaction);
                    suspect.account.getTransactions().remove(suspect.transaction);

                    portfolioTransactions.remove(match);
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.model.BuySellEntry

Copyright © 2018 www.massapicom. 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.