Package org.fenixedu.academic.report.IRSCustomDeclaration

Examples of org.fenixedu.academic.report.IRSCustomDeclaration.IRSDeclarationDTO


        return mapping.findForward("payments.manageIRSDocuments");
    }

    public ActionForward prepareGenerateNewIRSDeclaration(ActionMapping mapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse response) {
        request.setAttribute("declarationDTO", new IRSDeclarationDTO(null, getPerson(request)));
        return showAnnualIRSDocumentsInPayments(mapping, actionForm, request, response);
    }
View Full Code Here


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

        final Person person = getPerson(request);
        final IRSDeclarationDTO declarationDTO = getRenderedObject("declarationDTO");

        try {

            if (declarationDTO.getCivilYear().intValue() >= new LocalDate().getYear()) {
                addActionMessage("error", request, "error.annual.irs.declaration.year.must.be.previous.to.current");

            } else {
                byte[] declaration = buildIRSCustomDeclaration(declarationDTO, person);
                AnnualIRSDeclarationDocument.create(person, getLoggedPerson(request), declaration, declarationDTO.getCivilYear());
                addActionMessage("success", request, "message.new.irs.annual.document.generated.with.success");
            }

        } catch (final DomainException e) {
            addActionMessage("error", request, e.getMessage(), e.getArgs());
View Full Code Here

        try {
            final AnnualIRSDeclarationDocument document = getDomainObject(request, "annualIRSDocumentOid");
            request.setAttribute("personId", document.getAddressee().getExternalId());

            final IRSDeclarationDTO declarationDTO =
                    new IRSDeclarationDTO(document.getYear().intValue(), document.getAddressee());
            byte[] declaration = buildIRSCustomDeclaration(declarationDTO, document.getAddressee());

            document.generateAnotherDeclaration(AccessControl.getPerson(), declaration);
            addActionMessage("success", request, "message.new.irs.annual.document.generated.with.success");
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.report.IRSCustomDeclaration.IRSDeclarationDTO

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.