File tree Expand file tree Collapse file tree 5 files changed +5
-14
lines changed
name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/onvista
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/viewers
src/name/abuchen/portfolio Expand file tree Collapse file tree 5 files changed +5
-14
lines changed Original file line number Diff line number Diff line change 3838import static org .hamcrest .CoreMatchers .hasItem ;
3939import static org .hamcrest .CoreMatchers .is ;
4040import static org .hamcrest .MatcherAssert .assertThat ;
41- import static org .hamcrest .Matchers .nullValue ;
4241import static org .hamcrest .collection .IsEmptyCollection .empty ;
4342import static org .junit .Assert .assertNull ;
4443
@@ -3105,7 +3104,7 @@ public void testDividende15()
31053104 assertThat (transaction .getType (), is (AccountTransaction .Type .TAXES ));
31063105
31073106 assertThat (transaction .getDateTime (), is (LocalDateTime .parse ("2017-10-20T00:00" )));
3108- assertThat (transaction .getExDate (), is (nullValue ( )));
3107+ assertThat (transaction .getExDate (), is (LocalDateTime . parse ( "2017-10-06T00:00" )));
31093108 assertThat (transaction .getShares (), is (Values .Share .factorize (0.4512 )));
31103109 assertThat (transaction .getSource (), is ("Dividende15.txt" ));
31113110 assertThat (transaction .getNote (), is ("Abrechnungs-Nr. 12345678 | Ertrag für 2017" ));
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public class ExDateEditingSupport extends ColumnEditingSupport
3131 public boolean canEdit (Object element )
3232 {
3333 var tx = Adaptor .adapt (AccountTransaction .class , element );
34- return tx != null && tx .getType () == AccountTransaction . Type . DIVIDENDS ;
34+ return tx != null && tx .getSecurity () != null ;
3535 }
3636
3737 @ Override
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ name.abuchen.portfolio.checks.impl.FixWrongTransfersCheck
1414name.abuchen.portfolio.checks.impl.FixDepositsWithSecurityCheck
1515name.abuchen.portfolio.checks.impl.NegativeExchangeRateCheck
1616name.abuchen.portfolio.checks.impl.MissingTransactionDateCheck
17- name.abuchen.portfolio.checks.impl.OnlyDividendsCanHaveExDateCheck
17+ name.abuchen.portfolio.checks.impl.OnlyAccountTransactionsWithSecurityCanHaveExDateCheck
Original file line number Diff line number Diff line change 55
66import name .abuchen .portfolio .checks .Check ;
77import name .abuchen .portfolio .checks .Issue ;
8- import name .abuchen .portfolio .model .AccountTransaction ;
98import name .abuchen .portfolio .model .Client ;
109
11- public class OnlyDividendsCanHaveExDateCheck implements Check
10+ public class OnlyAccountTransactionsWithSecurityCanHaveExDateCheck implements Check
1211{
1312 @ Override
1413 public List <Issue > execute (Client client )
@@ -19,7 +18,7 @@ public List<Issue> execute(Client client)
1918 {
2019 for (var tx : account .getTransactions ())
2120 {
22- if (tx .getExDate () != null && tx .getType () != AccountTransaction . Type . DIVIDENDS )
21+ if (tx .getExDate () != null && tx .getSecurity () == null )
2322 {
2423 tx .setExDate (null );
2524 }
Original file line number Diff line number Diff line change @@ -916,13 +916,6 @@ private void addDividendeTransaction()
916916 if (ctx .getString (FAILURE ) != null )
917917 item .setFailureMessage (ctx .getString (FAILURE ));
918918
919- // ex-date is only supported for dividend
920- // transactions. if there is a
921- // 'Ertragsthesaurierung', then we have a tax
922- // transaction without ex-date.
923- if (t .getType () != AccountTransaction .Type .DIVIDENDS && t .getExDate () != null )
924- t .setExDate (null );
925-
926919 return item ;
927920 });
928921
You can’t perform that action at this time.
0 commit comments