AmountProperty(final Transaction t) {
   if (t instanceof InvestmentTransaction) {
     setValue(((InvestmentTransaction) t).getNetCashValue());
   } else {
     setValue(t.getAmount(accountProperty.get()));
   }
 }
    TransactionTypeWrapper(final Transaction t) {
      super();

      if (t instanceof InvestmentTransaction) {
        setValue(t.getTransactionType().toString());
      } else if (t.getAmount(accountProperty.get()).signum() > 0) {
        setValue(resources.getString("Item.CashDeposit"));
      } else {
        setValue(resources.getString("Item.CashWithdrawal"));
      }
    }
  private void newTransaction(final Transaction t) {
    clearForm();

    amountField.setDecimal(t.getAmount(accountProperty().get()));

    memoTextField.setText(t.getMemo());
    payeeTextField.setText(t.getPayee());
    numberComboBox.setValue(t.getNumber());

    datePicker.setValue(t.getLocalDate());
    setReconciledState(t.getReconciled(accountProperty().get()));
  }
Exemple #4
0
  /**
   * Writes one bank transaction
   *
   * @param transaction <code>Transaction</code> to write
   */
  private void writeBankTransaction(final Transaction transaction) {
    indentedWriter.println(wrapOpen(STMTTRN), indentLevel++);
    indentedWriter.println(
        wrapOpen(TRNTYPE)
            + (transaction.getAmount(account).compareTo(BigDecimal.ZERO) == 1 ? CREDIT : DEBIT),
        indentLevel);

    indentedWriter.println(wrapOpen(DTPOSTED) + encodeDate(transaction.getDate()), indentLevel);
    indentedWriter.println(
        wrapOpen(TRNAMT) + transaction.getAmount(account).toPlainString(), indentLevel);
    indentedWriter.println(wrapOpen(REFNUM) + transaction.getUuid(), indentLevel);
    indentedWriter.println(wrapOpen(NAME) + transaction.getPayee(), indentLevel);
    indentedWriter.println(wrapOpen(MEMO) + transaction.getMemo(), indentLevel);

    // write the check number if applicable
    if (account.getAccountType() == AccountType.CHECKING && !transaction.getNumber().isEmpty()) {
      indentedWriter.println(wrapOpen(CHECKNUM) + transaction.getNumber(), indentLevel);
    }

    // write out the banks transaction id if previously imported
    writeFitID(transaction);

    indentedWriter.println(wrapClose(STMTTRN), --indentLevel);
  }
 @Override
 boolean isShowable(final Transaction t) {
   return t.getAmount(account).signum() >= 0;
 }