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