Search in sources :

Example 1 with MonthlyReminder

use of jgnash.engine.recurring.MonthlyReminder in project jgnash by ccavanaugh.

the class MonthTab method getReminder.

/**
     * @see jgnash.ui.recurring.RecurringTab#getReminder()
     */
@Override
public Reminder getReminder() {
    int inc = ((Number) numberSpinner.getValue()).intValue();
    LocalDate endDate = null;
    if (endButton.isSelected()) {
        endDate = endDateField.getLocalDate();
    }
    reminder.setIncrement(inc);
    reminder.setEndDate(endDate);
    ((MonthlyReminder) reminder).setType(typeComboBox.getSelectedIndex());
    return reminder;
}
Also used : MonthlyReminder(jgnash.engine.recurring.MonthlyReminder) LocalDate(java.time.LocalDate)

Example 2 with MonthlyReminder

use of jgnash.engine.recurring.MonthlyReminder in project jgnash by ccavanaugh.

the class Engine method createDefaultReminder.

/**
     * Creates a default reminder given a transaction and the primary account.  The Reminder will need to persisted.
     *
     * @param transaction Transaction for the reminder.  The transaction wil be cloned
     * @param account     primary account
     * @return new default {@code MonthlyReminder}
     */
public Reminder createDefaultReminder(final Transaction transaction, final Account account) {
    final Reminder reminder = new MonthlyReminder();
    try {
        reminder.setAccount(account);
        reminder.setStartDate(transaction.getLocalDate().plusMonths(1));
        reminder.setTransaction((Transaction) transaction.clone());
        reminder.setDescription(transaction.getPayee());
        reminder.setNotes(transaction.getMemo());
    } catch (final CloneNotSupportedException e) {
        logSevere(e.getLocalizedMessage());
    }
    return reminder;
}
Also used : PendingReminder(jgnash.engine.recurring.PendingReminder) MonthlyReminder(jgnash.engine.recurring.MonthlyReminder) Reminder(jgnash.engine.recurring.Reminder) MonthlyReminder(jgnash.engine.recurring.MonthlyReminder)

Example 3 with MonthlyReminder

use of jgnash.engine.recurring.MonthlyReminder in project jgnash by ccavanaugh.

the class MonthTabController method initialize.

@FXML
void initialize() {
    super.initialize();
    reminder = new MonthlyReminder();
    numberSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 24, 1, 1));
    typeComboBox.getItems().addAll(resources.getString("Column.Date"), resources.getString("Column.Day"));
    typeComboBox.getSelectionModel().select(0);
}
Also used : MonthlyReminder(jgnash.engine.recurring.MonthlyReminder) SpinnerValueFactory(javafx.scene.control.SpinnerValueFactory) FXML(javafx.fxml.FXML)

Aggregations

MonthlyReminder (jgnash.engine.recurring.MonthlyReminder)3 LocalDate (java.time.LocalDate)1 FXML (javafx.fxml.FXML)1 SpinnerValueFactory (javafx.scene.control.SpinnerValueFactory)1 PendingReminder (jgnash.engine.recurring.PendingReminder)1 Reminder (jgnash.engine.recurring.Reminder)1