Search in sources :

Example 1 with FeeFrequencyDto

use of org.mifos.dto.domain.FeeFrequencyDto in project head by mifos.

the class FeeBO method toDto.

public FeeDto toDto() {
    FeeDto feeDto = new FeeDto();
    feeDto.setId(Short.toString(this.feeId));
    feeDto.setName(this.feeName);
    feeDto.setCategoryType(this.categoryType.getName());
    feeDto.setFeeStatus(this.feeStatus.toDto());
    feeDto.setActive(isActive());
    feeDto.setCustomerDefaultFee(this.isCustomerDefaultFee());
    feeDto.setRateBasedFee(this instanceof RateFeeBO);
    feeDto.setChangeType(this.changeType);
    FeeFrequencyDto feeFrequencyDto = this.feeFrequency.toDto();
    feeDto.setFeeFrequency(feeFrequencyDto);
    GLCodeDto glCodeDto = this.glCode.toDto();
    feeDto.setGlCodeDto(glCodeDto);
    feeDto.setGlCode(glCodeDto.getGlcode());
    feeDto.setOneTime(isOneTime());
    feeDto.setPeriodic(isPeriodic());
    feeDto.setTimeOfDisbursement(isTimeOfDisbursement());
    if (this instanceof AmountFeeBO) {
        Money amount = ((AmountFeeBO) this).getFeeAmount();
        feeDto.setCurrencyId(amount.getCurrency().getCurrencyId().intValue());
        feeDto.setAmount(amount.toString(AccountingRules.getDigitsAfterDecimal()));
        feeDto.setRateBasedFee(false);
    } else {
        RateFeeBO rateFeeBo = (RateFeeBO) this;
        feeDto.setRate(rateFeeBo.getRate());
        feeDto.setFeeFormula(rateFeeBo.getFeeFormula().toDto());
        feeDto.setRateBasedFee(true);
    }
    return feeDto;
}
Also used : FeeFrequencyDto(org.mifos.dto.domain.FeeFrequencyDto) Money(org.mifos.framework.util.helpers.Money) GLCodeDto(org.mifos.dto.domain.GLCodeDto) FeeDto(org.mifos.dto.domain.FeeDto)

Example 2 with FeeFrequencyDto

use of org.mifos.dto.domain.FeeFrequencyDto in project head by mifos.

the class FeeFrequencyEntity method toDto.

public FeeFrequencyDto toDto() {
    FeeFrequencyDto feeFrequencyDto = new FeeFrequencyDto();
    feeFrequencyDto.setType(feeFrequencyType.getName());
    if (this.feeFrequencyType.isOneTime()) {
        feeFrequencyDto.setPayment(feePayment.getName());
        feeFrequencyDto.setOneTime(true);
        feeFrequencyDto.setPaymentId(this.feePayment.getId().intValue());
    } else {
        feeFrequencyDto.setMonthly(this.feeMeetingFrequency.isMonthly());
        feeFrequencyDto.setWeekly(this.feeMeetingFrequency.isWeekly());
        feeFrequencyDto.setRecurAfterPeriod(this.feeMeetingFrequency.getRecurAfter().toString());
    }
    return feeFrequencyDto;
}
Also used : FeeFrequencyDto(org.mifos.dto.domain.FeeFrequencyDto)

Aggregations

FeeFrequencyDto (org.mifos.dto.domain.FeeFrequencyDto)2 FeeDto (org.mifos.dto.domain.FeeDto)1 GLCodeDto (org.mifos.dto.domain.GLCodeDto)1 Money (org.mifos.framework.util.helpers.Money)1