Search in sources :

Example 1 with BulkEntryDisplayHelper

use of org.mifos.application.collectionsheet.struts.uihelpers.BulkEntryDisplayHelper in project head by mifos.

the class BulkEntryTag method generateTagData.

private void generateTagData(final CollectionSheetEntryGridDto bulkEntry, final List<ProductDto> loanProducts, final List<ProductDto> savingsProducts, final List<CustomValueListElementDto> custAttTypes, final String method, final StringBuilder builder) throws SystemException {
    UserContext userContext = (UserContext) pageContext.getSession().getAttribute(Constants.USERCONTEXT);
    BulkEntryDisplayHelper bulkEntryDisplayHelper = new BulkEntryDisplayHelper();
    builder.append(bulkEntryDisplayHelper.buildTableHeadings(loanProducts, savingsProducts, userContext.getPreferredLocale()));
    CollectionSheetEntryDto bulkEntryParentView = bulkEntry.getBulkEntryParent();
    Money[] totals = null;
    boolean centerHierachyExists = ClientRules.getCenterHierarchyExists();
    if (centerHierachyExists) {
        totals = bulkEntryDisplayHelper.buildForCenter(bulkEntryParentView, loanProducts, savingsProducts, custAttTypes, builder, method, userContext);
    } else {
        totals = bulkEntryDisplayHelper.buildForGroup(bulkEntryParentView, loanProducts, savingsProducts, custAttTypes, builder, method, userContext);
    }
    int columnSize = 2 * (loanProducts.size() + savingsProducts.size()) + 7;
    builder.append(bulkEntryDisplayHelper.getEndTable(columnSize));
    builder.append(bulkEntryDisplayHelper.buildTotals(bulkEntryParentView.getCurrency(), totals, loanProducts.size(), savingsProducts.size(), method, userContext));
}
Also used : Money(org.mifos.framework.util.helpers.Money) UserContext(org.mifos.security.util.UserContext) BulkEntryDisplayHelper(org.mifos.application.collectionsheet.struts.uihelpers.BulkEntryDisplayHelper) CollectionSheetEntryDto(org.mifos.application.collectionsheet.business.CollectionSheetEntryDto)

Aggregations

CollectionSheetEntryDto (org.mifos.application.collectionsheet.business.CollectionSheetEntryDto)1 BulkEntryDisplayHelper (org.mifos.application.collectionsheet.struts.uihelpers.BulkEntryDisplayHelper)1 Money (org.mifos.framework.util.helpers.Money)1 UserContext (org.mifos.security.util.UserContext)1