}
public ActionForward doPayment(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
final PaymentsManagementDTO paymentsManagementDTO =
(PaymentsManagementDTO) RenderUtils.getViewState("paymentsManagementDTO-edit").getMetaObject().getObject();
if (paymentsManagementDTO.getSelectedEntries().isEmpty()) {
addActionMessage("context", request, "error.payments.payment.entries.selection.is.required");
request.setAttribute("paymentsManagementDTO", paymentsManagementDTO);
return mapping.findForward("preparePayment");
}
//This is here to force the load of the relation to debug a possible bug in FenixFramework
paymentsManagementDTO.getPerson().getReceiptsSet().size();
try {
final Receipt receipt =
CreatePaymentsForEvents.run(getUserView(request).getPerson().getUser(),
paymentsManagementDTO.getSelectedEntries(), PaymentMode.CASH,
paymentsManagementDTO.isDifferedPayment(), paymentsManagementDTO.getPaymentDate(),
paymentsManagementDTO.getPerson(), paymentsManagementDTO.getContributorName(),
paymentsManagementDTO.getContributorNumber(), paymentsManagementDTO.getContributorAddress());
request.setAttribute("personId", paymentsManagementDTO.getPerson().getExternalId());
request.setAttribute("receiptID", receipt.getExternalId());
return mapping.findForward("showReceipt");
} catch (DomainExceptionWithLabelFormatter ex) {