Package org.fenixedu.academic.dto.accounting

Examples of org.fenixedu.academic.dto.accounting.CreateReceiptBean


    @SuppressWarnings("unchecked")
    public ActionForward showPaymentsWithoutReceipt(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        final Person person = getPerson(request);
        final CreateReceiptBean receiptBean = new CreateReceiptBean();
        IViewState viewState = RenderUtils.getViewState("entriesToSelect");
        final Collection<Entry> entriesToSelect =
                (Collection<Entry>) ((viewState != null) ? viewState.getMetaObject().getObject() : null);

        receiptBean.setPerson(person);
        receiptBean.setEntries(getSelectableEntryBeans(
                person.getPaymentsWithoutReceiptByAdministrativeOffices(getAdministrativeOffices()),
                (entriesToSelect != null) ? entriesToSelect : new HashSet<Entry>()));

        request.setAttribute("createReceiptBean", receiptBean);
View Full Code Here


    }

    public ActionForward confirmCreateReceipt(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final CreateReceiptBean createReceiptBean =
                (CreateReceiptBean) RenderUtils.getViewState("createReceiptBean").getMetaObject().getObject();

        if (createReceiptBean.getSelectedEntries().isEmpty()) {
            addActionMessage("context", request, "error.payments.receipt.entries.selection.is.required");

            request.setAttribute("personId", createReceiptBean.getPerson().getExternalId());
            return showPaymentsWithoutReceipt(mapping, actionForm, request, response);
        }

        request.setAttribute("createReceiptBean", createReceiptBean);
        return mapping.findForward("confirmCreateReceipt");
View Full Code Here

    }

    public ActionForward createReceipt(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        final CreateReceiptBean createReceiptBean =
                (CreateReceiptBean) RenderUtils.getViewState("createReceiptBeanConfirm").getMetaObject().getObject();

        //This is here to force the load of the relation to debug a possible bug in FenixFramework
        createReceiptBean.getPerson().getReceiptsSet().size();
        try {
            final Receipt receipt =
                    CreateReceipt.run(getUserView(request).getPerson(), createReceiptBean.getPerson(),
                            createReceiptBean.getContributorName(), createReceiptBean.getContributorNumber(),
                            createReceiptBean.getContributorAddress(), createReceiptBean.getYear(),
                            createReceiptBean.getSelectedEntries());

            request.setAttribute("personId", receipt.getPerson().getExternalId());
            request.setAttribute("receiptID", receipt.getExternalId());

            return prepareShowReceipt(mapping, form, request, response);
View Full Code Here

    }

    public ActionForward createUsingContributorPartyPostback(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        final CreateReceiptBean createReceiptBean = (CreateReceiptBean) getObjectFromViewState("createReceiptBean");

        RenderUtils.invalidateViewState("createReceiptBean");

        createReceiptBean.setContributorParty(null);
        createReceiptBean.setContributorNumber(null);
        createReceiptBean.setContributorName(null);

        request.setAttribute("createReceiptBean", createReceiptBean);

        return mapping.findForward("showPaymentsWithoutReceipt");
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.accounting.CreateReceiptBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.