Package org.libreplan.business.advance.entities

Examples of org.libreplan.business.advance.entities.DirectAdvanceAssignment


        final AdvanceAssignment advanceAssignment = (AdvanceAssignment) listItem
                .getValue();
        Datebox date = new Datebox();
        date.setDisabled(true);

        DirectAdvanceAssignment directAdvanceAssignment;
        if (advanceAssignment instanceof IndirectAdvanceAssignment) {
            directAdvanceAssignment = manageOrderElementAdvancesModel
                    .calculateFakeDirectAdvanceAssignment((IndirectAdvanceAssignment) advanceAssignment);
        } else {
            directAdvanceAssignment = (DirectAdvanceAssignment) advanceAssignment;
View Full Code Here


        Decimalbox miBox = ((Decimalbox) listCell.getFirstChild());
        Comboitem selectedItem = comboAdvanceTypes.getSelectedItem();
        if(selectedItem != null){
            AdvanceType advanceType = ((AdvanceType) selectedItem.getValue());
            if(advanceType != null){
                DirectAdvanceAssignment advance = (DirectAdvanceAssignment) item
                        .getValue();
                advance.setMaxValue(manageOrderElementAdvancesModel
                        .getMaxValue(advanceType));
                miBox.setValue(manageOrderElementAdvancesModel
                        .getMaxValue(advanceType));
                miBox.invalidate();
            }
View Full Code Here

        return new Constraint() {
            @Override
            public void validate(Component comp, Object value)
                    throws WrongValueException {
                Listitem item = (Listitem) comp.getParent().getParent();
                DirectAdvanceAssignment advance = (DirectAdvanceAssignment) item
                        .getValue();
                if (!manageOrderElementAdvancesModel
                        .hasConsolidatedAdvances(advance)) {
                    if (value == null
                            || (BigDecimal.ZERO.compareTo((BigDecimal) value) >= 0)) {
                        ((Decimalbox) comp).setValue(advance.getAdvanceType()
                                .getDefaultMaxValue());
                        ((Decimalbox) comp).invalidate();
                        throw new WrongValueException(comp,
                                _("The max value must be greater than 0"));
                    }
View Full Code Here

                && (this.indexSelectedItem >= 0)) {
            Listitem selectedItem = editAdvances.getItemAtIndex(indexSelectedItem);
            AdvanceAssignment advanceAssignment = (AdvanceAssignment) selectedItem
                    .getValue();

            DirectAdvanceAssignment directAdvanceAssignment;
            if (advanceAssignment instanceof IndirectAdvanceAssignment) {
                directAdvanceAssignment = manageOrderElementAdvancesModel
                        .calculateFakeDirectAdvanceAssignment((IndirectAdvanceAssignment) advanceAssignment);
            } else {
                directAdvanceAssignment = (DirectAdvanceAssignment) advanceAssignment;
View Full Code Here

      if(this.indexSelectedItem >= 0){
            Listitem selectedItem = editAdvances.getItemAtIndex(indexSelectedItem);
            AdvanceAssignment advanceAssignment = (AdvanceAssignment) selectedItem
                    .getValue();

            DirectAdvanceAssignment directAdvanceAssignment;
            if (advanceAssignment instanceof IndirectAdvanceAssignment) {
                directAdvanceAssignment = manageOrderElementAdvancesModel
                        .calculateFakeDirectAdvanceAssignment((IndirectAdvanceAssignment) advanceAssignment);
            } else {
                directAdvanceAssignment = (DirectAdvanceAssignment) advanceAssignment;
View Full Code Here

         if(this.indexSelectedItem >= 0){
            Listitem selectedItem = editAdvances.getItemAtIndex(indexSelectedItem);
            AdvanceAssignment advanceAssignment = (AdvanceAssignment) selectedItem
                    .getValue();

            DirectAdvanceAssignment directAdvanceAssignment;
            if (advanceAssignment instanceof IndirectAdvanceAssignment) {
                directAdvanceAssignment = manageOrderElementAdvancesModel
                        .calculateFakeDirectAdvanceAssignment((IndirectAdvanceAssignment) advanceAssignment);
            } else {
                directAdvanceAssignment = (DirectAdvanceAssignment) advanceAssignment;
View Full Code Here

                        throw new WrongValueException(
                                getComboboxTypeBy(listItem),
                            _("cannot be empty"));
                    }

                    DirectAdvanceAssignment directAdvanceAssignment;
                    if (advance instanceof IndirectAdvanceAssignment) {
                        directAdvanceAssignment = manageOrderElementAdvancesModel
                            .calculateFakeDirectAdvanceAssignment((IndirectAdvanceAssignment) advance);
                    } else {
                        directAdvanceAssignment = (DirectAdvanceAssignment) advance;
                    }
                    if (directAdvanceAssignment != null
                        && directAdvanceAssignment.getMaxValue() == null) {
                        throw new WrongValueException(
                                getDecimalboxMaxValueBy(listItem),
                                _("cannot be empty"));
                    }
                }
View Full Code Here

    private void addTimesheetsProgress(OrderElement orderElement,
            Date progressDate) {
        AdvanceType timesheetsAdvanceType = getTimesheetsAdvanceType();

        DirectAdvanceAssignment timesheetsAdvanceAssignment = orderElement
                .getDirectAdvanceAssignmentByType(timesheetsAdvanceType);

        if (timesheetsAdvanceAssignment == null) {
            timesheetsAdvanceAssignment = DirectAdvanceAssignment.create(false,
                    timesheetsAdvanceType.getDefaultMaxValue());
            timesheetsAdvanceAssignment.setAdvanceType(timesheetsAdvanceType);
            try {
                orderElement.addAdvanceAssignment(timesheetsAdvanceAssignment);
            } catch (DuplicateValueTrueReportGlobalAdvanceException e) {
                // This shouldn't happen as the new advanceAssignment is not
                // marked as spread yet
                throw new RuntimeException(e);
            } catch (DuplicateAdvanceAssignmentForOrderElementException e) {
                // If the same type already exists in other element we don't do
                // anything
                return;
            }
        }

        DirectAdvanceAssignment spreadAdvanceAssignment = orderElement
                .getReportGlobalAdvanceAssignment();
        if (spreadAdvanceAssignment != null) {
            spreadAdvanceAssignment.setReportGlobalAdvance(false);
        }

        timesheetsAdvanceAssignment.setReportGlobalAdvance(true);
        timesheetsAdvanceAssignment.resetAdvanceMeasurements(AdvanceMeasurement
                .create(LocalDate.fromDateFields(progressDate),
View Full Code Here

    private AdvanceType getTimesheetsAdvanceType() {
        return PredefinedAdvancedTypes.TIMESHEETS.getType();
    }

    private void removeTimesheetsProgressIfAny(OrderElement orderElement) {
        DirectAdvanceAssignment timesheetsAdvanceAssignment = orderElement
                .getDirectAdvanceAssignmentByType(getTimesheetsAdvanceType());
        if (timesheetsAdvanceAssignment != null) {
            orderElement.removeAdvanceAssignment(timesheetsAdvanceAssignment);
        }
    }
View Full Code Here

        }
        for (IndirectAdvanceAssignment advance : orderElement
                .getIndirectAdvanceAssignments()) {
            loadDataAdvance(advance);
            advance.getCalculatedConsolidation().size();
            DirectAdvanceAssignment fakedDirect = orderElement
                    .calculateFakeDirectAdvanceAssignment(advance);
            if (fakedDirect != null) {
                forceLoadAdvanceConsolidatedValues(fakedDirect);
            } else {
                LOG
View Full Code Here

TOP

Related Classes of org.libreplan.business.advance.entities.DirectAdvanceAssignment

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.