ccavanaugh / jgnash

jGnash Personal Finance
http://ccavanaugh.github.io/jgnash/
Other
139 stars 80 forks source link

Fix issue with modifying a split transaction. #96

Open t-pa opened 3 years ago

t-pa commented 3 years ago

If a split transaction was edited on the split end (i.e., in the register view of the account that is not the common account), the account of the transaction entry was not preserved. This made the transaction entry "jump" erratically to another account. The underlying reason is that the account was not put into the account combo box; although the combo box is disabled, its value is still used to build a modified transaction entry.

t-pa commented 3 years ago

I have added two additional commits related to the Portfolio Report. They fix a condition in which the filter predicate of the account combo box is applied later than some of the other initializations. This caused exceptions like these:

[2021-02-26 22:50:37] [SCHWERWIEGEND] {jgnash.uifx.report.PortfolioReport$PortfolioReportTableModel } null java.lang.IllegalArgumentException: The account is not a valid type at jgnash.engine.InvestmentPerformanceSummary.(InvestmentPerformanceSummary.java:65) at jgnash.uifx.report.PortfolioReport$PortfolioReportTableModel.(PortfolioReport.java:133) at jgnash.uifx.report.PortfolioReport.createReportModel(PortfolioReport.java:98) at jgnash.uifx.report.PortfolioReportController.createReportModel(PortfolioReportController.java:242) at jgnash.uifx.report.PortfolioReportController.addTable(PortfolioReportController.java:226) [...] [2021-02-26 22:50:37] [SCHWERWIEGEND] {jgnash.uifx.StaticUIMethods$ExceptionHandler uncaughtException} null java.lang.NullPointerException at jgnash.uifx.report.PortfolioReport$PortfolioReportTableModel.getRowCount(PortfolioReport.java:168) at jgnash.report.table.AbstractReportTableModel.getColumnPrototypeValueAt(AbstractReportTableModel.java:366) at jgnash.report.pdf.Report.getColumnWidths(Report.java:858) at jgnash.report.pdf.Report.addTable(Report.java:273)

and

[2021-02-26 22:26:08] [SCHWERWIEGEND] {jgnash.uifx.StaticUIMethods$ExceptionHandler uncaughtException} null java.lang.IndexOutOfBoundsException at javafx.base/javafx.collections.transformation.FilteredList.get(FilteredList.java:170) at jgnash.uifx.control.AccountComboBox.lambda$selectDefaultAccount$5(AccountComboBox.java:169) at jgnash.uifx.util.JavaFXUtils.lambda$_runLater$0(JavaFXUtils.java:127)