Search in sources :

Example 16 with NotNull

use of jgnash.util.NotNull in project jgnash by ccavanaugh.

the class AdjustSharesSlipController method buildTransaction.

@NotNull
@Override
public Transaction buildTransaction() {
    final Transaction transaction;
    if (tranType == TransactionType.ADDSHARE) {
        transaction = TransactionFactory.generateAddXTransaction(accountProperty().get(), securityComboBox.getValue(), priceField.getDecimal(), quantityField.getDecimal(), datePicker.getValue(), memoTextField.getText());
    } else {
        transaction = TransactionFactory.generateRemoveXTransaction(accountProperty().get(), securityComboBox.getValue(), priceField.getDecimal(), quantityField.getDecimal(), datePicker.getValue(), memoTextField.getText());
    }
    transaction.setNumber(numberComboBox.getValue());
    return attachmentPane.buildTransaction(transaction);
}
Also used : Transaction(jgnash.engine.Transaction) InvestmentTransaction(jgnash.engine.InvestmentTransaction) NotNull(jgnash.util.NotNull)

Example 17 with NotNull

use of jgnash.util.NotNull in project jgnash by ccavanaugh.

the class BuyShareSlipController method buildTransaction.

@NotNull
@Override
public Transaction buildTransaction() {
    final BigDecimal exchangeRate = accountExchangePane.getExchangeRate();
    final List<TransactionEntry> fees = feePane.getTransactions();
    final Transaction transaction = TransactionFactory.generateBuyXTransaction(accountExchangePane.getSelectedAccount(), accountProperty().get(), securityComboBox.getValue(), priceField.getDecimal(), quantityField.getDecimal(), exchangeRate, datePicker.getValue(), memoTextField.getText(), fees);
    transaction.setNumber(numberComboBox.getValue());
    return attachmentPane.buildTransaction(transaction);
}
Also used : Transaction(jgnash.engine.Transaction) InvestmentTransaction(jgnash.engine.InvestmentTransaction) BigDecimal(java.math.BigDecimal) TransactionEntry(jgnash.engine.TransactionEntry) AbstractInvestmentTransactionEntry(jgnash.engine.AbstractInvestmentTransactionEntry) NotNull(jgnash.util.NotNull)

Aggregations

NotNull (jgnash.util.NotNull)17 Transaction (jgnash.engine.Transaction)13 BigDecimal (java.math.BigDecimal)10 InvestmentTransaction (jgnash.engine.InvestmentTransaction)9 List (java.util.List)6 AbstractInvestmentTransactionEntry (jgnash.engine.AbstractInvestmentTransactionEntry)6 TransactionEntry (jgnash.engine.TransactionEntry)6 ChangeListener (javafx.beans.value.ChangeListener)4 FXML (javafx.fxml.FXML)4 LocalDate (java.time.LocalDate)3 ArrayList (java.util.ArrayList)3 TransactionFactory (jgnash.engine.TransactionFactory)3 TransactionType (jgnash.engine.TransactionType)3 Collections (java.util.Collections)2 Objects (java.util.Objects)2 ResourceBundle (java.util.ResourceBundle)2 ExecutionException (java.util.concurrent.ExecutionException)2 Logger (java.util.logging.Logger)2 Preferences (java.util.prefs.Preferences)2 Collectors (java.util.stream.Collectors)2