Package org.fenixedu.academic.domain.accounting

Examples of org.fenixedu.academic.domain.accounting.ResidenceEvent


    @Atomic
    public static void run(List<ResidenceEventBean> beans, ResidenceMonth month) {
        for (ResidenceEventBean bean : beans) {
            if (!month.isEventPresent(bean.getStudent().getPerson())) {
                new ResidenceEvent(month, bean.getStudent().getPerson(), bean.getRoomValue(), bean.getRoom());
            }
        }
    }
View Full Code Here


    public boolean hasAnyResidencePaymentsInDebtForPreviousYear() {
        final int previousYear = new LocalDate().minusYears(1).getYear();

        for (final Event event : getResidencePaymentEvents()) {
            final ResidenceEvent residenceEvent = (ResidenceEvent) event;
            if (residenceEvent.isFor(previousYear) && !residenceEvent.isCancelled() && !residenceEvent.isPayed()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public ActionForward showEventDetails(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        String eventOID = request.getParameter("event");
        ResidenceEvent residenceEvent = FenixFramework.getDomainObject(eventOID);

        request.setAttribute("person", getLoggedPerson(request));
        request.setAttribute("event", residenceEvent);
        request.setAttribute("entryDTOs", residenceEvent.calculateEntries());
        request.setAttribute("accountingEventPaymentCodes", residenceEvent.getNonProcessedPaymentCodes());

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

        return mapping.findForward("viewPersonResidenceEvents");
    }

    public ActionForward cancelResidenceEvent(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {
        ResidenceEvent residenceEvent = FenixFramework.getDomainObject(request.getParameter("event"));

        try {
            CancelResidenceEvent.run(residenceEvent, AccessControl.getPerson());
        } catch (DomainException e) {
            addErrorMessage(request, e.getMessage(), e.getMessage());
View Full Code Here

    }

    public ActionForward preparePayResidenceEvent(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        ResidenceEvent residenceEvent = FenixFramework.getDomainObject(request.getParameter("event"));
        VariantBean bean = new VariantBean();
        bean.setYearMonthDay(new YearMonthDay());
        ResidenceMonth month = getResidenceMonth(request);

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

    }

    public ActionForward payResidenceEvent(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        ResidenceEvent residenceEvent = (ResidenceEvent) FenixFramework.getDomainObject(request.getParameter("event"));
        YearMonthDay date = getRenderedObject("date");

        try {
            PayResidenceEvent.run(getLoggedPerson(request).getUser(), residenceEvent, date);
        } catch (DomainException e) {
View Full Code Here

                amounToPay, event.getDescriptionForEntryType(getEntryType()), amounToPay));
    }

    @Override
    protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
        ResidenceEvent residenceEvent = (ResidenceEvent) event;
        Money baseValue = residenceEvent.getRoomValue();
        if (residenceEvent.getPaymentLimitDate().isAfter(when)) {
            return baseValue;
        }
        return baseValue.add(getPenaltyPerDay().multiply(
                BigDecimal.valueOf(Days.daysBetween(residenceEvent.getPaymentLimitDate(), when).getDays())));
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.accounting.ResidenceEvent

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.