Skip to content
Snippets Groups Projects
Commit 0db5283d authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #113 - preselect date with start dat on edit repeating payment

parent 17bcabee
Branches
Tags
1 merge request!142merge v1_3_0 into master
...@@ -176,8 +176,15 @@ public class NewPaymentController ...@@ -176,8 +176,15 @@ public class NewPaymentController
textArea.setText(payment.getDescription()); textArea.setText(payment.getDescription());
if(payment instanceof RepeatingPaymentEntry) if(payment instanceof RepeatingPaymentEntry)
{
try
{ {
RepeatingPaymentEntry currentPayment = (RepeatingPaymentEntry)payment; RepeatingPaymentEntry currentPayment = (RepeatingPaymentEntry)payment;
ServerConnection connection = new ServerConnection(controller.getSettings());
RepeatingPayment repeatingPayment = connection.getRepeatingPayment(currentPayment.getRepeatingPaymentID());
datePicker.setValue(LocalDate.parse(repeatingPayment.getDate()));
//repeates every x days //repeates every x days
if(currentPayment.getRepeatInterval() != 0) if(currentPayment.getRepeatInterval() != 0)
{ {
...@@ -199,6 +206,12 @@ public class NewPaymentController ...@@ -199,6 +206,12 @@ public class NewPaymentController
datePickerEnddate.setValue(LocalDate.parse(currentPayment.getRepeatEndDate())); datePickerEnddate.setValue(LocalDate.parse(currentPayment.getRepeatEndDate()));
} }
} }
catch(Exception e)
{
Logger.error(e);
controller.showConnectionErrorAlert(ExceptionHandler.getMessageForException(e));
}
}
else else
{ {
checkBoxRepeat.setSelected(false); checkBoxRepeat.setSelected(false);
...@@ -224,9 +237,9 @@ public class NewPaymentController ...@@ -224,9 +237,9 @@ public class NewPaymentController
.withMonth(currentDate.getMonthOfYear()) .withMonth(currentDate.getMonthOfYear())
.withDayOfMonth(currentDate.getDayOfMonth()); .withDayOfMonth(currentDate.getDayOfMonth());
datePicker.setValue(currentLocalDate); datePicker.setValue(currentLocalDate);
datePicker.setEditable(false);
//Platform.runLater(()->{datePicker.getEditor().clear();});
} }
datePicker.setEditable(false);
} }
public void save() public void save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment