Skip to content

Commit

Permalink
Fixed a bug that was preventing entry of investment transaction gains
Browse files Browse the repository at this point in the history
or losses without using the detailed entry form and specifying a
gains and loss account.
  • Loading branch information
ccavanaugh committed Jul 5, 2019
1 parent 4e548cb commit 49d64ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* Write and replace for bxds and xml files to protect against corruption if a crash occurs during a save.
== Release 3.2.0
* 07/05/2019 Fixed a bug that was preventing entry of investment transaction gains or losses without using the detailed
entry form and specifying a gains and loss account.
* 07/05/2019 Fixed a bug that was causing backup files and database conversions to save in the wrong location or
fail completely if a period existed within the file name's path other than the file extension.
* 07/05/2019 The style of selected odd rows of TreeTables were not consistent with even rows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
*/
package jgnash.uifx.views.register;

import java.math.BigDecimal;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javafx.beans.property.SimpleObjectProperty;

import jgnash.engine.Account;
import jgnash.engine.TransactionEntry;
import jgnash.engine.TransactionTag;
import jgnash.uifx.control.DetailedDecimalTextField;

import java.math.BigDecimal;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* UI Panel for handling investment transaction fees
* <p>
Expand All @@ -36,7 +37,6 @@
*
* @author Craig Cavanaugh
*/
@SuppressWarnings("WeakerAccess")
public class GainLossPane extends DetailedDecimalTextField {

private final SimpleObjectProperty<Account> account = new SimpleObjectProperty<>(null);
Expand Down Expand Up @@ -72,7 +72,7 @@ public List<TransactionEntry> getTransactions() {
// adjust the cash balance of the investment account
if (feeList.isEmpty() && getDecimal().compareTo(BigDecimal.ZERO) != 0) { // ignore zero balance fees
TransactionEntry fee = new TransactionEntry(accountProperty().get(), getDecimal().abs().negate());
fee.setTransactionTag(TransactionTag.INVESTMENT_FEE);
fee.setTransactionTag(TransactionTag.GAIN_LOSS);

feeList.add(fee);
}
Expand Down

0 comments on commit 49d64ab

Please sign in to comment.