use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class LoanRepaymentTag method createInstallmentRow.
XmlBuilder createInstallmentRow(LoanScheduleEntity installment, boolean isPaymentMade, boolean isNewGropLoan) {
XmlBuilder html = new XmlBuilder();
html.startTag("tr");
html.startTag("td", "width", "6%", "class", "drawtablerow");
html.text(installment.getInstallmentId().toString());
html.endTag("td");
html.startTag("td", "width", "15%", "class", "drawtablerow");
html.text(DateUtils.getDBtoUserFormatString(installment.getActionDate(), locale).toString());
html.endTag("td");
html.startTag("td", "width", "15%", "class", "drawtablerow");
html.text((isPaymentMade && installment.getPaymentDate() != null ? DateUtils.getDBtoUserFormatString(installment.getPaymentDate(), locale) : "-").toString());
html.endTag("td");
html.startTag("td", "width", "12%", "align", "right", "class", "drawtablerow");
if (isNewGropLoan) {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getPrincipalPaid().toString()) : ConversionUtil.formatNumber(installment.getPrincipalDue().toString()) + "(" + ConversionUtil.formatNumber(installment.getPrincipalPaid().toString()) + ")"));
} else {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getPrincipalPaid().toString()) : ConversionUtil.formatNumber(installment.getPrincipalDue().toString())));
}
html.endTag("td");
html.startTag("td", "width", "10%", "align", "right", "class", "drawtablerow");
if (isNewGropLoan) {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getEffectiveInterestPaid().toString()) : ConversionUtil.formatNumber(installment.getEffectiveInterestDue().toString()) + (AccountingRules.isOverdueInterestPaidFirst() ? " (" + ConversionUtil.formatNumber((installment.getInterestPaid().add(installment.getExtraInterestPaid())).toString()) + ")" : "")));
} else {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getEffectiveInterestPaid().toString()) : ConversionUtil.formatNumber(installment.getEffectiveInterestDue().toString()) + (AccountingRules.isOverdueInterestPaidFirst() ? " (" + ConversionUtil.formatNumber((installment.getInterestPaid().add(installment.getExtraInterestPaid())).toString()) + ")" : "")));
}
html.endTag("td");
html.startTag("td", "width", "10%", "align", "right", "class", "drawtablerow");
if (isNewGropLoan) {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getTotalFeeAmountPaidWithMiscFee().toString()) : ConversionUtil.formatNumber(installment.getTotalFeeDueWithMiscFeeDue().toString()) + "(" + ConversionUtil.formatNumber(installment.getTotalFeeAmountPaidWithMiscFee().toString()) + ")"));
} else {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getTotalFeeAmountPaidWithMiscFee().toString()) : ConversionUtil.formatNumber(installment.getTotalFeeDueWithMiscFeeDue().toString())));
}
html.endTag("td");
html.startTag("td", "width", "10%", "align", "right", "class", "drawtablerow");
if (isNewGropLoan) {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getTotalPenaltyPaid().toString()) : ConversionUtil.formatNumber(installment.getPenaltyDue().toString()) + "(" + ConversionUtil.formatNumber(installment.getTotalPenaltyPaid().toString()) + ")"));
} else {
html.text((isPaymentMade ? ConversionUtil.formatNumber(installment.getTotalPenaltyPaid().toString()) : ConversionUtil.formatNumber(installment.getPenaltyDue().toString())));
}
html.endTag("td");
html.startTag("td", "width", "10%", "align", "right", "class", "drawtablerow");
html.text(ConversionUtil.formatNumber(installment.getDaysLate().toString()));
html.endTag("td");
html.startTag("td", "width", "12%", "align", "right", "class", "drawtablerow");
if (isNewGropLoan) {
html.text((isPaymentMade ? ConversionUtil.formatNumber(String.valueOf(installment.getPrincipalPaid().add(installment.getEffectiveInterestPaid()).add(installment.getTotalFeeAmountPaidWithMiscFee()).add(installment.getTotalPenaltyPaid()))) : ConversionUtil.formatNumber(String.valueOf(installment.getPrincipalDue().add(installment.getEffectiveInterestDue()).add(installment.getTotalFeeDueWithMiscFeeDue()).add(installment.getPenaltyDue()))) + "(" + ConversionUtil.formatNumber(String.valueOf(installment.getPrincipalPaid().add(installment.getEffectiveInterestPaid()).add(installment.getTotalFeeAmountPaidWithMiscFee()).add(installment.getTotalPenaltyPaid()))) + ")"));
} else {
html.text((isPaymentMade ? ConversionUtil.formatNumber(String.valueOf(installment.getPrincipalPaid().add(installment.getEffectiveInterestPaid()).add(installment.getTotalFeeAmountPaidWithMiscFee()).add(installment.getTotalPenaltyPaid()))) : ConversionUtil.formatNumber(String.valueOf(installment.getPrincipalDue().add(installment.getEffectiveInterestDue()).add(installment.getTotalFeeDueWithMiscFeeDue()).add(installment.getPenaltyDue())))));
}
html.endTag("td");
html.endTag("tr");
return html;
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class OfficeListTag method processOffice.
private XmlBuilder processOffice(XmlBuilder levelHtml, OfficeBO office, String levelName) {
if (levelHtml == null) {
levelHtml = new XmlBuilder();
levelHtml.singleTag("br");
levelHtml.startTag("table", "width", "95%", "border", "0", "cellspacing", "0", "cellpadding", "0");
levelHtml.startTag("tr");
levelHtml.startTag("td");
levelHtml.startTag("span", "class", "fontnormalBold");
levelHtml.text(levelName);
levelHtml.endTag("span");
levelHtml.endTag("td");
levelHtml.endTag("tr");
levelHtml.endTag("table");
levelHtml.startTag("table", "width", "90%", "border", "0", "cellspacing", "0", "cellpadding", "0");
}
levelHtml.startTag("tr", "class", "fontnormal");
bullet(levelHtml);
levelHtml.startTag("td", "width", "99%");
levelHtml.append(getLink(office.getOfficeId(), office.getOfficeName()));
levelHtml.endTag("td");
levelHtml.endTag("tr");
return levelHtml;
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class OfficeListTagTest method testGetLink.
@Test
public void testGetLink() throws Exception {
OfficeListTag tag = new OfficeListTag("action", "method", "flow");
XmlBuilder link = tag.getLink((short) 234, "My Office");
Assert.assertEquals("<a href=\"action?method=method&" + "office.officeId=234&office.officeName=My+Office&" + "officeId=234&officeName=My+Office&" + "currentFlowKey=flow\">My Office</a>", link.getOutput());
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class DatabaseInitFilter method printErrorPage.
void printErrorPage(PrintWriter out) {
XmlBuilder xml = new XmlBuilder();
xml.startTag("html");
xml.startTag("head");
xml.startTag("title");
xml.text("Mifos Database Error");
xml.text("\n");
xml.endTag("title");
xml.text("\n");
xml.endTag("head");
xml.text("\n");
xml.startTag("body");
xml.startTag("h2");
xml.text("Mifos Database Error");
xml.endTag("h2");
xml.text("\n");
xml.startTag("p");
xml.text("A database error occurred. ");
xml.text("Correct the error and restart the application. ");
xml.text("Details:");
xml.endTag("p");
xml.text("\n");
ApplicationInitializer.printDatabaseError(xml);
xml.endTag("body");
xml.text("\n");
xml.endTag("html");
out.println(xml.getOutput());
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class TableTag method noResults.
XmlBuilder noResults(String officeName, String officeId, String searchString) {
XmlBuilder html = new XmlBuilder();
html.startTag("table", "width", "96%", "border", "0", "cellpadding", "0", "cellspacing", "0");
html.startTag("tr", "class", "fontnormal");
html.startTag("td", "colspan", "2", "valign", "top");
html.singleTag("br");
html.startTag("span", "class", "headingorange");
html.text(MessageLookup.getLocalizedMessage("Customer.noResultsFoundFor") + " ");
html.startTag("span", "class", "heading");
html.text(searchString);
html.text(" ");
html.endTag("span");
String inString = MessageLookup.getLocalizedMessage("Customer.in");
if (officeId.equals(ALL_BRANCHES)) {
renderInClause(html, MessageLookup.getLocalizedMessage("Customer.allBranches"), inString);
} else {
renderInClause(html, officeName, inString);
}
html.endTag("span");
html.endTag("td");
html.endTag("tr");
if (type.equalsIgnoreCase("single")) {
html.startTag("tr");
html.startTag("td", "colspan", "2", "valign", "top", "class", "blueline");
html.singleTag("br");
html.singleTag("img", "src", "pages/framework/images/trans.gif", "width", "5", "height", "3");
html.endTag("td");
html.endTag("tr");
}
html.endTag("table");
return html;
}
Aggregations