};
schedulesPanel.setClosed();
schedulesPanel.setHeading(getPaymentScheduleHeading(data.getPaymentSchedules(), schedulesPanel));
gridBuilder.getPanel().add(schedulesPanel);
final GridBuilder innerGridBuilder = schedulesPanel.createGridBuilder();
final DivPanel dp = innerGridBuilder.getPanel();
dp.add(paymentSchedulePanel = new PaymentSchedulePanel(dp.newChildId(), new CompoundPropertyModel<AuftragDO>(data), getUser()));
paymentSchedulePanel.setVisible(data.getPaymentSchedules() != null && data.getPaymentSchedules().isEmpty() == false);
final Button addPositionButton = new Button(SingleButtonPanel.WICKET_ID) {
@Override
public final void onSubmit()
{
data.addPaymentSchedule(new PaymentScheduleDO());
paymentSchedulePanel.rebuildEntries();
paymentSchedulePanel.setVisible(true);
}
};
final SingleButtonPanel addPositionButtonPanel = new SingleButtonPanel(dp.newChildId(), addPositionButton, getString("add"));
addPositionButtonPanel.setTooltip(getString("fibu.auftrag.tooltip.addPosition"));
dp.add(addPositionButtonPanel);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// comment
final FieldsetPanel fs = gridBuilder.newFieldset(getString("comment"));
fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "bemerkung")), true);
}
gridBuilder.newSplitPanel(GridSize.COL50);
{
// status comment
final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.statusBeschreibung"));
fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "statusBeschreibung")), true);
}
// positions
gridBuilder.newGridPanel();
positionsRepeater = gridBuilder.newRepeatingView();
refresh();
if (getBaseDao().hasInsertAccess(getUser()) == true) {
final DivPanel panel = gridBuilder.newGridPanel().getPanel();
final Button addPositionButton = new Button(SingleButtonPanel.WICKET_ID) {
@Override
public final void onSubmit()
{
getData().addPosition(new AuftragsPositionDO());
refresh();
}
};
final SingleButtonPanel addPositionButtonPanel = new SingleButtonPanel(panel.newChildId(), addPositionButton, getString("add"));
addPositionButtonPanel.setTooltip(getString("fibu.auftrag.tooltip.addPosition"));
panel.add(addPositionButtonPanel);
}
{
// email
gridBuilder.newFieldset(getString("email")).addCheckBox(new PropertyModel<Boolean>(this, "sendEMailNotification"), null)
.setTooltip(getString("label.sendEMailNotification"));