use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class GLCodeEntity method toDto.
public GLCodeDto toDto() {
GLCodeDto glCodeDto = new GLCodeDto();
glCodeDto.setGlcode(this.glcode);
glCodeDto.setGlcodeId(this.glcodeId);
glCodeDto.setGlname(this.associatedCOA.getAccountName());
return glCodeDto;
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class SavingsProductPreviewController method populateModelAndViewForPreview.
private void populateModelAndViewForPreview(SavingsProductFormBean savingsProduct, ModelAndView modelAndView) {
GeneralProductBean bean = savingsProduct.getGeneralDetails();
configurationDto = this.configurationServiceFacade.getAccountingConfiguration();
modelAndView.addObject("GLCodeMode", configurationDto.getGlCodeMode());
new ProductModelAndViewPopulator().populateProductDetails(bean, modelAndView);
String depositType = savingsProduct.getDepositTypeOptions().get(savingsProduct.getSelectedDepositType());
String appliesTo = "";
if (StringUtils.isNotBlank(savingsProduct.getSelectedGroupSavingsApproach())) {
appliesTo = savingsProduct.getGroupSavingsApproachOptions().get(savingsProduct.getSelectedGroupSavingsApproach());
}
String interestCalculationUsed = savingsProduct.getInterestCaluclationOptions().get(savingsProduct.getSelectedInterestCalculation());
String interestCalculationTimePeriod = savingsProduct.getFrequencyPeriodOptions().get(savingsProduct.getSelectedFequencyPeriod());
GLCodeDto depositGlCode = savingsProduct.getPrincipalGeneralLedgerOptions().get(savingsProduct.getSelectedPrincipalGlCode());
GLCodeDto interestGlCode = savingsProduct.getInterestGeneralLedgerOptions().get(savingsProduct.getSelectedInterestGlCode());
modelAndView.addObject("depositType", depositType);
modelAndView.addObject("appliesTo", appliesTo);
modelAndView.addObject("interestCalculationUsed", interestCalculationUsed);
modelAndView.addObject("interestCalculationTimePeriod", interestCalculationTimePeriod);
modelAndView.addObject("depositGlCode", depositGlCode);
modelAndView.addObject("interestGlCode", interestGlCode);
Double zero = Double.valueOf("0");
if (savingsProduct.getAmountForDeposit() == null) {
savingsProduct.setAmountForDeposit(zero);
}
if (savingsProduct.getMaxWithdrawalAmount() == null) {
savingsProduct.setMaxWithdrawalAmount(zero);
}
if (savingsProduct.isInterestRateZero()) {
savingsProduct.setDefaultInterestRateDetails();
}
if (savingsProduct.getMinBalanceRequiredForInterestCalculation() == null) {
savingsProduct.setMinBalanceRequiredForInterestCalculation(zero.toString());
}
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class SavingsProductFormBeanAssembler method populatePrincipalGlCodesDropdown.
private void populatePrincipalGlCodesDropdown(SavingsProductFormDto referenceData, SavingsProductFormBean formBean) {
Map<String, GLCodeDto> principalGeneralLedgerOptions = new LinkedHashMap<String, GLCodeDto>();
for (ListElement glCode : referenceData.getPrincipalGlCodes()) {
GLCodeDto codeDto = new GLCodeDto();
codeDto.setGlcode(glCode.getName());
codeDto.setGlname(glCode.getGlname());
principalGeneralLedgerOptions.put(glCode.getId().toString(), codeDto);
}
formBean.setPrincipalGeneralLedgerOptions(principalGeneralLedgerOptions);
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class SavingsProductFormBeanAssembler method populateInterestGlCodesDropdown.
private void populateInterestGlCodesDropdown(SavingsProductFormDto referenceData, SavingsProductFormBean formBean) {
Map<String, GLCodeDto> interestGeneralLedgerOptions = new LinkedHashMap<String, GLCodeDto>();
for (ListElement glCode : referenceData.getInterestGlCodes()) {
GLCodeDto codeDto = new GLCodeDto();
codeDto.setGlcode(glCode.getName());
codeDto.setGlname(glCode.getGlname());
interestGeneralLedgerOptions.put(glCode.getId().toString(), codeDto);
}
formBean.setInterestGeneralLedgerOptions(interestGeneralLedgerOptions);
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class CoaBranchMappingAction method submit.
public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CoaBranchMappingActionForm coaBranchMappingActionForm = (CoaBranchMappingActionForm) form;
List<GLCodeDto> glcodelist = new ArrayList<GLCodeDto>();
List<GLCodeDto> accountingglnames = accountingServiceFacade.coaBranchAccountHead();
int accinggl = accountingServiceFacade.deleteGlobalNumRelatedCoaNames(coaBranchMappingActionForm.getBranchoffice());
List<OfficeGlobalDto> officeDetailsDtos = null;
short branches = 5;
officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(branches);
List<Integer> glcodeint = new ArrayList<Integer>();
CoaBranchBO coabranchbo = null;
if (coaBranchMappingActionForm.getBranchoffice().equalsIgnoreCase("All")) {
for (String glname : coaBranchMappingActionForm.getCoaBranchMainHeadglcode()) {
String glcode = glname;
for (GLCodeDto accountinggln : accountingglnames) {
if (accountinggln.getGlcode().equalsIgnoreCase(glcode)) {
for (OfficeGlobalDto officeGlobalDto : officeDetailsDtos) {
coabranchbo = new CoaBranchBO();
coabranchbo.setCoaname(accountinggln.getGlname());
coabranchbo.setGlcode(accountinggln.getGlcode());
coabranchbo.setGlobalofficenum(officeGlobalDto.getGlobalOfficeNum());
accountingServiceFacade.savingCoaBranchTransactions(coabranchbo);
}
}
}
}
} else {
for (String glname : coaBranchMappingActionForm.getCoaBranchMainHeadglcode()) {
String glcode = glname;
for (GLCodeDto accountinggln : accountingglnames) {
if (accountinggln.getGlcode().equalsIgnoreCase(glcode)) {
coabranchbo = new CoaBranchBO();
coabranchbo.setCoaname(accountinggln.getGlname());
coabranchbo.setGlcode(accountinggln.getGlcode());
coabranchbo.setGlobalofficenum(coaBranchMappingActionForm.getBranchoffice());
accountingServiceFacade.savingCoaBranchTransactions(coabranchbo);
}
}
}
}
List<GLCodeDto> coabranchvalues = accountingServiceFacade.loadCoaBranchNames(coaBranchMappingActionForm.getBranchoffice());
List<GLCodeDto> accountingDtos = null;
CoaBranchMappingActionForm acti = (CoaBranchMappingActionForm) form;
accountingDtos = accountingServiceFacade.coaBranchAccountHead();
List<GLCodeDto> emptyaccountingDtos = new ArrayList<GLCodeDto>();
storingSession(request, "CoaNamesList", accountingDtos);
storingSession(request, "emptycoanames", coabranchvalues);
return mapping.findForward(ActionForwards.submit_success.toString());
}
Aggregations