Sondertilgung optional
This commit is contained in:
parent
20641043d3
commit
014c7f4786
@ -165,8 +165,11 @@ class Darlehenberechner {
|
|||||||
}
|
}
|
||||||
System.out.print("Monat erste Rate(z.B. 2007-12): ");
|
System.out.print("Monat erste Rate(z.B. 2007-12): ");
|
||||||
konfig.setAnfangsmonat(YearMonth.parse(dis.readLine()));
|
konfig.setAnfangsmonat(YearMonth.parse(dis.readLine()));
|
||||||
System.out.print("Sondertilgungssatz: ");
|
System.out.print("Sondertilgungssatz(optional): ");
|
||||||
konfig.setSondertilgungProzent((BigDecimal) DECIMAL_FORMAT.parse(dis.readLine()));
|
in = dis.readLine();
|
||||||
|
if (in != null && !in.isBlank()) {
|
||||||
|
konfig.setSondertilgungProzent((BigDecimal) DECIMAL_FORMAT.parse(in));
|
||||||
|
}
|
||||||
new Darlehenberechner(konfig).berechneWerte();
|
new Darlehenberechner(konfig).berechneWerte();
|
||||||
|
|
||||||
/*var konfig = new Konfiguration();
|
/*var konfig = new Konfiguration();
|
||||||
@ -261,7 +264,7 @@ class Darlehenberechner {
|
|||||||
|
|
||||||
|
|
||||||
private void zahleSondertilgung() {
|
private void zahleSondertilgung() {
|
||||||
if (sondertilgung.signum() == 0) {
|
if (sondertilgung == null || sondertilgung.signum() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boolean sondertilgungFaellingErstesJahr = summeMonate < 12 && aktMonat.getMonth() == Month.DECEMBER;
|
boolean sondertilgungFaellingErstesJahr = summeMonate < 12 && aktMonat.getMonth() == Month.DECEMBER;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user