Esempio n. 1
0
  @Override
  public void modifyTransaction(final Transaction tran) {
    if (!(tran instanceof InvestmentTransaction)) {
      throw new IllegalArgumentException("bad tranType");
    }
    clearForm();

    datePanel.setDate(tran.getDate());

    List<TransactionEntry> entries = tran.getTransactionEntries();

    feePanel.setTransactionEntries(((InvestmentTransaction) tran).getInvestmentFeeEntries());

    gainsPanel.setTransactionEntries(((InvestmentTransaction) tran).getInvestmentGainLossEntries());

    for (TransactionEntry e : entries) {
      if (e instanceof TransactionEntrySellX) {
        AbstractInvestmentTransactionEntry entry = (AbstractInvestmentTransactionEntry) e;

        memoField.setText(e.getMemo());
        priceField.setDecimal(entry.getPrice());
        quantityField.setDecimal(entry.getQuantity());
        securityCombo.setSelectedNode(entry.getSecurityNode());

        accountExchangePanel.setSelectedAccount(entry.getDebitAccount());
        accountExchangePanel.setExchangedAmount(entry.getDebitAmount().abs());
      }
    }

    updateTotalField();

    modTrans = tran;

    reconciledButton.setSelected(tran.getReconciled(getAccount()) == ReconciledState.RECONCILED);
  }
Esempio n. 2
0
  @Override
  public void actionPerformed(final ActionEvent e) {
    if (e.getSource() == feeButton) {
      FeesDialog d = FeesDialog.getFeesDialog(this, account, feeList);
      boolean status = d.showFeesDialog();

      if (status) {
        setTransactionEntries(d.getSplits());
        fireActionPerformed();
      }
    }
  }