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;
}
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;
}
Aggregations