Search in sources :

Example 21 with GLCodeDto

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;
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto)

Example 22 with 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());
    }
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto)

Example 23 with GLCodeDto

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);
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) ListElement(org.mifos.dto.screen.ListElement) LinkedHashMap(java.util.LinkedHashMap)

Example 24 with GLCodeDto

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);
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) ListElement(org.mifos.dto.screen.ListElement) LinkedHashMap(java.util.LinkedHashMap)

Example 25 with GLCodeDto

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());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) GLCodeDto(org.mifos.dto.domain.GLCodeDto) CoaBranchBO(org.mifos.application.accounting.business.CoaBranchBO) ArrayList(java.util.ArrayList) CoaBranchMappingActionForm(org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)

Aggregations

GLCodeDto (org.mifos.dto.domain.GLCodeDto)37 ViewStageTransactionActionForm (org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)9 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)9 ArrayList (java.util.ArrayList)7 VoucherBranchMappingActionForm (org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)5 GlDetailDto (org.mifos.dto.domain.GlDetailDto)5 ViewStageTransactionsDto (org.mifos.dto.domain.ViewStageTransactionsDto)5 MultipleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)4 OfficesList (org.mifos.dto.domain.OfficesList)4 BigDecimal (java.math.BigDecimal)3 ParseException (java.text.ParseException)3 Date (java.util.Date)3 CoaBranchMappingActionForm (org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)3 GlDetailBO (org.mifos.application.accounting.business.GlDetailBO)3 UserContext (org.mifos.security.util.UserContext)3 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 InterOfficeTransferActionForm (org.mifos.accounting.struts.actionform.InterOfficeTransferActionForm)2 JournalVoucherActionForm (org.mifos.accounting.struts.actionform.JournalVoucherActionForm)2 SingleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm)2