You are on page 1of 20

/*

* To change this template, choose Tools | Templates


* and open the template in the editor.
*/
package com.jilit.irp.bso.report.sfm;
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import

com.adobe.agl.text.SimpleDateFormat;
com.jilit.irp.bso.IService;
com.jilit.irp.Report.ReportManager;
com.jilit.irp.bso.biz.BusinessService;
com.jilit.irp.bso.biz.PrinterRunnable;
com.jilit.irp.bso.biz.UIService;
com.jilit.irp.data.GridData;
com.jilit.irp.persistence.dao.DAOFactory;
com.jilit.irp.persistence.dto.CurrencyMaster;
com.jilit.irp.persistence.dto.InstituteMaster;
com.jilit.irp.persistence.dto.RegistrationMaster;
com.jilit.irp.persistence.dto.StudentMaster;
com.jilit.irp.util.JIRPDateUtil;
com.jilit.irp.util.JIRPSession;
flex.messaging.io.amf.ASObject;
java.math.BigDecimal;
java.text.DecimalFormat;
java.util.ArrayList;
java.util.Date;
java.util.HashMap;
java.util.LinkedHashSet;
javax.servlet.ServletContext;
javax.servlet.ServletOutputStream;
org.springframework.web.context.ServletContextAware;
java.util.List;
java.util.Map;
java.util.Set;
javax.servlet.http.HttpServletRequest;
javax.servlet.http.HttpServletResponse;

/**
*
* @author ibrahimb.shaik
*/
public class FeeReceiptReportService extends ReportManager implements IService,
ServletContextAware {
DAOFactory daoFactory;
private ServletContext context;
BigDecimal amt = null;
BigDecimal feecurrencyamount = null;
String ddno = "";
String dddate = "";
String drawnon = "";
public void setDaoFactory(DAOFactory daoFactory) {
this.daoFactory = daoFactory;
}
public void setServletContext(ServletContext context) {
this.context = context;
}
public List<GridData> getAllRegistrationCode() {

String instituteid = JIRPSession.getLoginInfo().getUserProfile().getSele


ctedinstitutemaster().getInstituteid();
List<GridData> retList = new ArrayList<GridData>();
List<RegistrationMaster> list = (List<RegistrationMaster>) daoFactory.ge
tUtilDAO().findSimpleData("findAllRegistrationCode_SFM", new Object[]{institutei
d});
for (int i = 0; i < list.size(); i++) {
retList.add(new GridData(new RegistrationMaster(list.get(i)), false,
list.get(i).getIdStr()));
}
return retList;
}
public ASObject checkIfRegistrationCodeExist(String instituteid, String regC
ode) {
ASObject retObj = null;
List<RegistrationMaster> list = (List<RegistrationMaster>) daoFactory.ge
tUtilDAO().findSimpleData("checkRegistrationCode_SFM", new Object[]{instituteid,
regCode.toUpperCase()});
if (list.size() == 1) {
retObj = new ASObject();
retObj.put("registrationid", list.get(0).getId().getRegistrationid()
);
retObj.put("registrationcode", list.get(0).getRegistrationcode());
retObj.put("registrationdesc", list.get(0).getRegistrationdesc());
}
return retObj;
}
public List<GridData> getAllEnrollmentNo(String regid) {
String instituteid = JIRPSession.getLoginInfo().getUserProfile().getSele
ctedinstitutemaster().getInstituteid();
List list = (List) daoFactory.getFeeTransactionDAO().getAllEnrollmentNoF
orRegID(instituteid, regid);
List<GridData> retList = new ArrayList<GridData>();
try {
for (int i = 0; i < list.size(); i++) {
Object obj[] = (Object[]) list.get(i);
ASObject addldata = new ASObject();
addldata.put("studentid", obj[0]);
addldata.put("enrollmentno", obj[1]);
addldata.put("name", obj[2]);
addldata.put("programcode", obj[3]);
addldata.put("stynumber", obj[4]);
addldata.put("branchcode", obj[5]);
addldata.put("academicyear", obj[6]);
retList.add(new GridData(new StudentMaster(obj[0].toString(), ob
j[1].toString(), obj[2].toString()), false, obj[0].toString(), addldata));
}
} catch (Exception e) {
e.printStackTrace();
}
return retList;
}
public ASObject checkIfEnrollmentNoExist(String enrollmentno, String regid)
{
String instituteid = JIRPSession.getLoginInfo().getUserProfile().getSele
ctedinstitutemaster().getInstituteid();
List list = (List) daoFactory.getFeeTransactionDAO().checkIfEnrollmentNo

Exist(instituteid, regid, enrollmentno);


ASObject retObj = null;
try {
if (list.size() == 1) {
Object obj[] = (Object[]) list.get(0);
retObj = new ASObject();
retObj.put("studentid", obj[0]);
retObj.put("enrollmentno", obj[1]);
retObj.put("name", obj[2]);
retObj.put("programcode", obj[3]);
retObj.put("stynumber", obj[4]);
retObj.put("branchcode", obj[5]);
}
} catch (Exception e) {
e.printStackTrace();
}
return retObj;
}
@Override
@SuppressWarnings("empty-statement")
public void getReport(HttpServletRequest request, HttpServletResponse respon
se) {
try {
amt = BigDecimal.valueOf(Double.parseDouble("0")).setScale(2);
feecurrencyamount = BigDecimal.valueOf(Double.parseDouble("0"));
BusinessService bs = new BusinessService(context, daoFactory);
String username = request.getParameter("username");
String level = request.getParameter("level");
String instituteid = request.getParameter("instituteid");
String registrationid = request.getParameter("registrationid");
String registrationcode = request.getParameter("registrationcode");
String collectiondate = request.getParameter("collectiondate");
StudentMaster sm = (StudentMaster) daoFactory.getStudentMasterDAO().
findByPrimaryKey(request.getParameter("studentid"));
String enrollmentno =request.getParameter("enrollmentno").equals("")
? (sm==null?"":sm.getEnrollmentno()):request.getParameter("enrollmentno");
String studentid = request.getParameter("studentid").equals("")?"":r
equest.getParameter("studentid");
String exportto = request.getParameter("exportto");
String reportby = request.getParameter("reportby");
String prid = request.getParameter("prid");
String prid1 = request.getParameter("prid1");
String receiptmode = request.getParameter("receiptmode");
String prnofrom = request.getParameter("prnofrom");
String prnoto = request.getParameter("prnoto");
String path = null;
HashMap parameters = null;
List data = null;
parameters = new HashMap();
ASObject aSObject = null;
UIService uiserviceobject = new UIService();
if (prid != null && !"".equals(prid)) {
aSObject = getFeeReceiptReportData2(instituteid, registrationid,
studentid, enrollmentno, reportby, prid, receiptmode);
} else {
aSObject = getFeeReceiptReportData(instituteid, registrationid,
studentid, enrollmentno, prid1, prnofrom, prnoto, reportby);
}
data = (List) aSObject.get("list");

String amountinwords = uiserviceobject.amountToWord(Double.parseDoub


le(amt.toString()), null);
InstituteMaster ims = (InstituteMaster) daoFactory.getInstituteMaste
rDAO().findByPrimaryKey(instituteid);
parameters = new HashMap();
if (ims != null || data != null) {
parameters.put("institutename", ims.getInstitutename());
parameters.put("address1", (ims.getAddress1() == null) ? "" : im
s.getAddress1());
parameters.put("address2", (ims.getAddress2() == null) ? "" : im
s.getAddress2());
parameters.put("address3", (ims.getAddress3() == null) ? "" : im
s.getAddress3());
parameters.put("state", (ims.getState() == null) ? "" : ims.getS
tate());
parameters.put("city", ims.getCity() == null ? "" : ims.getCity(
));
parameters.put("pin", ims.getPin() == null ? "" : ims.getPin());
parameters.put("username", bs.getPropertyValue("reportby", "camp
uslynx.properties") + ": " + username);
parameters.put("image", context.getRealPath(ims.getLogofilename(
)));
parameters.put("imageback", context.getRealPath(ims.getWatermark
filename()));
parameters.put("registrationcode", registrationcode == null ? ""
: registrationcode);
parameters.put("reporttitle", reportby.equals("P") ? "Fee Paymen
t Receipt" : "Fee Collection Receipt");
parameters.put("amountinwords", amountinwords == null ? "" : amo
untinwords);
parameters.put("amt", amt);
parameters.put("feecurrencyamount", feecurrencyamount);
parameters.put("ddno", ddno);
parameters.put("dddate", dddate);
parameters.put("drawnon", drawnon);
} else {
parameters.put("institutename", "");
parameters.put("sessioncode", "");
parameters.put("academicyear", "");
parameters.put("address1", "");
parameters.put("address2", "");
parameters.put("address3", "");
parameters.put("state", "");
parameters.put("city", "");
parameters.put("pin", "");
parameters.put("image", "");
}
//
if (level.equals("one")) {
//
path = request.getRealPath("/jrxml/FeeReceiptReport.jrxml");
//
}
if (exportto.contains("P")) {
// renderReport(PDF, path, data, response, parameters, "Fee Rec
eipt Report");
//
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "inline;filename=" + u
sername);
String realPath = request.getScheme() + "://" + request.getServe
rName() + ":" + request.getServerPort() + request.getContextPath();
request = null;
getFeeReceiptReportData(response.getOutputStream(), realPath, in

stituteid, registrationid, enrollmentno, studentid, prnofrom, prnoto, receiptmod


e, prid, prid1, reportby, collectiondate);
} else if (exportto.contains("H")) {
renderReport(HTML, path, data, response, parameters, "Fee Receip
t Report");
} else if (exportto.contains("W")) {
renderReport(RTF, path, data, response, parameters, "Fee Receipt
Report");
} else if (exportto.contains("E")) {
renderReport(EXCEL, path, data, response, parameters, "Fee Recei
pt Report");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//
JIRPSession.removeAttributeFromSession(request.getSession(), "data
");
}
}
public ASObject getFeeReceiptReportData(String instituteid, String registrat
ionid, String studentid, String enrollmentno, String prid, String prnofrom, Stri
ng prnoto, String reportby) {
List retList = new ArrayList();
String prmode = "";
try {
ddno = "";
dddate = "";
List<Object[]> l = (List<Object[]>) daoFactory.getFeeTransactionDAO(
).getFeeReceiptReportData(instituteid, registrationid, studentid, enrollmentno,
prid, prnofrom, prnoto, reportby);
for (int i = 0; i < l.size(); i++) {
Object[] obj = (Object[]) l.get(i);
ASObject object = new ASObject();
object.put("name", obj[0] == null ? "" : obj[0]);
object.put("enrollmentno", obj[1] == null ? "" : obj[1]);
object.put("semester", obj[2] == null ? (byte) 0 : Byte.valueOf(
obj[2].toString()));
object.put("prno", obj[3] == null ? "" : obj[3]);
object.put("prdate", obj[4] == null ? "" : obj[4]);
object.put("fathersname", obj[5] == null ? " " : obj[5]);
// object.put("amount", obj[6] == null ? "" : obj[6]);
//
amt = amt.add(BigDecimal.valueOf(Double.parseDouble((obj[6]).t
oString())));
//
feecurrencyamount = feecurrencyamount.add(BigDecimal.valueOf(D
ouble.parseDouble((obj[6]).toString())));
if(obj[12].equals("C")){
//
object.put("bankname", "Cash");
object.put("drawnon", "Cash");
object.put("particularsno", "Cash");
object.put("particularsdate", "Cash");
}else
{
object.put("drawnon", obj[14] == null ? "" : obj[14]);
object.put("particularsno", obj[10] == null ? "" : obj[10]);
object.put("particularsdate", obj[11] == null ? "" : obj[11]);
}
object.put("bankname", obj[6] == null ? "" : obj[6]);
// object.put("feedetails", obj[8] == null ? "" : obj[8]);
object.put("program", obj[7] == null ? "" : obj[7]);

//
//

object.put("currencycode", obj[8] == null ? "" : obj[8]);


prmode = obj[9] == null ? "NA" : obj[9].toString();
if (obj[12] != null) {
if (obj[12].equals("C")) {
object.put("receiptmode", "Cash");
} else if (obj[12].equals("B")) {
object.put("receiptmode", "Cheque/DD");
} else {
object.put("receiptmode", "JV");
}
} else {
object.put("receiptmode", "");
}
object.put("particularsno", obj[10] == null ? "" : obj[10]);
object.put("particularsdate", obj[11] == null ? "" : obj[11]);
object.put("accountingcurrency", obj[13] == null ? "" : obj[13])

//

if (prmode.equals("C")) {
object.put("prmode", "Cheque No:");
} else if (prmode.equals("D")) {
object.put("prmode", "DD No:");
} else if (prmode.equals("E")) {
object.put("prmode", "Electronic TrNo:");
} else if (prmode.equals("P")) {
object.put("prmode", "Payment Gateway TrNo:");
}
object.put("drawnon", obj[14] == null ? "" : obj[14]);
object.put("categorycode", obj[15] == null ? "" : obj[15]);
object.put("employeename", obj[16] == null ? "" : obj[16]);
object.put("studentid", obj[17] == null ? "" : obj[17]);
object.put("prid", obj[18] == null ? "" : obj[18]);
object.put("shortname", obj[19] == null ? "" : obj[19]);
object.put("employeename", obj[20] == null ? "" : obj[20]);
if (i == 0) {
ddno = ddno.concat(obj[10] == null ? "" : obj[10].toString()

);
dddate = dddate.concat(obj[11] == null ? "" : JIRPDateUtil.c
onvertDateFormat((Date) obj[11]));
} else {
ddno = ddno.concat(",".concat(obj[10] == null ? "" : obj[10]
.toString()));
dddate = dddate.concat(",".concat(obj[11] == null ? "" : JIR
PDateUtil.convertDateFormat((Date) obj[11])));
}
if (reportby.equals("P")) {
object.put("refundby", "Refunded ");
} else {
object.put("refundby", "with Thanks ");
}
retList.add(object);
}
} catch (Exception e) {
e.printStackTrace();
}
ASObject aSObject = new ASObject();
aSObject.put("list", retList);
return aSObject;
}

public ASObject getFeeReceiptReportData2(String instituteid, String registra


tionid, String studentid, String enrollmentno, String reporttype, String prid, S
tring receiptmode) {
List retList = new ArrayList();
String prmode = "";
try {
ddno = "";
dddate = "";
drawnon = "";
List<Object[]> l = (List<Object[]>) daoFactory.getFeeTransactionDAO(
).getFeeReceiptReportData2(instituteid, registrationid, studentid, reporttype, p
rid);
List<CurrencyMaster> list = (List<CurrencyMaster>) daoFactory.getCur
rencyMasterDAO().getAllCurrencyCode();
String accountingCurrency = "";
for (int i = 0; i < list.size(); i++) {
CurrencyMaster cm = list.get(i);
if ("Y".equals(cm.getAccountingcurrency())) {
accountingCurrency = cm.getCurrencycode();
break;
}
}
for (int i = 0; i < l.size(); i++) {
Object[] obj = (Object[]) l.get(i);
ASObject object = new ASObject();
object.put("accountingcurrency", accountingCurrency);
object.put("name", obj[0] == null ? "" : obj[0]);
object.put("enrollmentno", obj[1] == null ? "" : obj[1]);
object.put("semester", obj[2] == null ? (byte) 0 : obj[2]);
object.put("prno", obj[3] == null ? "" : obj[3]);
object.put("prdate", obj[4] == null ? "" : obj[4]);
object.put("fathersname", obj[5] == null ? " " : obj[5]);
if ("A".equals(obj[12].toString())) {
object.put("amount", obj[11] == null ? "" : obj[11]);
} else {
object.put("amount", obj[6] == null ? "" : obj[6]);
}
feecurrencyamount = feecurrencyamount.add(BigDecimal.valueOf(Dou
ble.parseDouble((obj[6]).toString())));
object.put("feedetails", obj[7] == null ? "" : obj[7]);
object.put("program", obj[8] == null ? "" : obj[8]);
object.put("currencycode", obj[9] == null ? "" : obj[9]);
String slno = obj[10] == null ? "" : obj[10].toString();
object.put("prmode", prmode);
if ("B".equals(receiptmode)) {
object.put("receiptmode", "Bank");
} else if ("C".equals(receiptmode)) {
object.put("receiptmode", "Cash");
} else {
object.put("receiptmode", "JV");
}
List<Object[]> particularsList = (List<Object[]>) daoFactory.get
FeeTransactionDAO().getFeeParticularsReportData(instituteid, prid, slno);
amt = amt.add(BigDecimal.valueOf(Double.parseDouble((obj[11]).to
String())));
if (particularsList != null || particularsList.size() > 0) {
for (int j = 0; j < particularsList.size(); j++) {
Object[] objArr = particularsList.get(j);
prmode = objArr[0] == null ? "NA" : objArr[0].toString()

;
if (prmode.equals("C")) {
object.put("prmode", "Cheque No:");
} else if (prmode.equals("D")) {
object.put("prmode", "DD No:");
} else if (prmode.equals("E")) {
object.put("prmode", "Electronic TrNo:");
} else if (prmode.equals("P")) {
object.put("prmode", "Payment Gateway TrNo:");
}
if (i == 0 && j == 0) {
ddno = ddno.concat(objArr[1] == null ? "" : objArr[1
].toString());
dddate = dddate.concat(objArr[2] == null ? "" : JIRP
DateUtil.convertDateFormat((Date) objArr[2]));
drawnon = drawnon.concat(objArr[3] == null ? "" : ob
jArr[3].toString());
} else {
ddno = ddno.concat(",".concat(objArr[1] == null ? ""
: objArr[1].toString()));
dddate = dddate.concat(",".concat(objArr[2] == null
? "" : JIRPDateUtil.convertDateFormat((Date) objArr[2])));
drawnon = drawnon.concat(",".concat(objArr[3] == nul
l ? "" : objArr[3].toString()));
}
}
}
if (reporttype.equals("P")) {
object.put("refundby", "Refunded ");
} else {
object.put("refundby", "with Thanks ");
}
retList.add(object);
}
} catch (Exception e) {
e.printStackTrace();
}
ASObject aSObject = new ASObject();
aSObject.put("list", retList);
return aSObject;
}
/**
* Desc::Method for DMT Printer.
* @param repObj
*/
public void printFeeReciept(ASObject repObj) {
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
DecimalFormat df1 = new DecimalFormat();
df1.setMaximumFractionDigits(2);
int total = 0;
BigDecimal totalf = new BigDecimal(0.00);
try {
amt = BigDecimal.valueOf(Double.parseDouble("0")).setScale(2);
feecurrencyamount = BigDecimal.valueOf(Double.parseDouble("0"));
String username = repObj.get("username").toString();
String instituteid = repObj.get("instituteid").toString();
String registrationid = repObj.get("registrationid").toString();
String registrationcode = repObj.get("registrationcode") == "" ? ""
: repObj.get("registrationcode").toString();

String enrollmentno = repObj.get("enrollmentno").toString();


String studentid = "";
if (repObj.get("studentid") != null) {
studentid = repObj.get("studentid") == "" ? "" : repObj.get("stu
dentid").toString();
}
String reportby = repObj.get("reportby").toString();
String prid = repObj.get("prid") == null ? "" : repObj.get("prid").t
oString();
String prid1 = repObj.get("prid1") == null ? "" : repObj.get("prid1"
).toString(); //request.getParameter("prid1");
String receiptmode = repObj.get("receiptmode") == null ? "" : repObj
.get("receiptmode").toString();
String prnofrom = repObj.get("prnofrom") == null ? "" : repObj.get("
prnofrom").toString();
String prnoto = repObj.get("prnoto") == null ? "" : repObj.get("prno
to").toString();
List<ASObject> data = null;
ASObject aSObject = null;
UIService uiserviceobject = new UIService();
if (prid != null && !"".equals(prid)) {
aSObject = getFeeReceiptReportData2(instituteid, registrationid,
studentid, enrollmentno, reportby, prid, receiptmode);
} else {
aSObject = getFeeReceiptReportData(instituteid, registrationid,
studentid, enrollmentno, prid1, prnofrom, prnoto, reportby);
}
data = (List) aSObject.get("list");
String amountinwords = "";//uiserviceobject.amountToWord(Double.pars
eDouble(amt.toString()), null);
InstituteMaster ims = (InstituteMaster) daoFactory.getInstituteMaste
rDAO().findByPrimaryKey(instituteid);
StringBuilder sb = new StringBuilder();
Set stdIdSet = new LinkedHashSet();
if (data != null && !data.isEmpty() && data.size() > 0) {
for (int i = 0; i < data.size(); i++) {
sb.append("\n\n\n\n\n\n\n\n\n");
sb.append(filler(data.get(i).get("enrollmentno").toString(),
26, "L", 7) + filler(data.get(i).get("enrollmentno").toString(), 34, "L", 8) +
"\n");
sb.append(filler(data.get(i).get("name").toString(), 24, "L"
, 9) + filler(data.get(i).get("name").toString(), 34, "L", 9) + "\n");
sb.append(filler(data.get(i).get("semester").toString() + "/
" + df.format(new Date()).substring(8, 10), 7, "L", 9) + filler(data.get(i).get(
"prno").toString(), 17, "L", 0) + filler(data.get(i).get("semester").toString()
+ "/" + df.format(new Date()).substring(8, 10), 19, "L", 7) + filler(data.get(i)
.get("prno").toString(), 18, "L", 3) + "\n");
sb.append(filler(data.get(i).get("categorycode").toString(),
10, "L", 9) + filler(df.format(new Date()), 12, "L", 3) + filler(data.get(i).ge
t("categorycode").toString(), 19, "L", 7) + filler(df.format(new Date()), 13, "L
", 8) + "\n");
sb.append(filler(data.get(i).get("program").toString(), 23,
"L", 10) + filler(data.get(i).get("program").toString(), 33, "L", 9) + "\n");
sb.append("\n\n\n");
List<Object[]> feeDetailsAndAmtList = (List<Object[]>) daoFa
ctory.getFeeTransactionDAO().getFeeReceiptReportFeeDetailsAndAmtData(instituteid
, registrationid, data.get(i).get("studentid").toString(), data.get(i).get("enro
llmentno").toString(), data.get(i).get("prid").toString(), prnofrom, prnoto, rep
ortby);

if (feeDetailsAndAmtList != null && feeDetailsAndAmtList.siz


e() > 0 && !feeDetailsAndAmtList.isEmpty()) {
for (int x = 0; x < feeDetailsAndAmtList.size(); x++) {
Object[] obj = (Object[]) feeDetailsAndAmtList.get(x
);
if (feeDetailsAndAmtList.size() > 14) {
sb.append(filler(obj[1].toString(), 22, "L", 0)
+ filler(((BigDecimal) obj[0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString(),
11, "R", 0) + filler(obj[1].toString(), 31, "L", 2) + filler(((BigDecimal) obj[
0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString(), 12, "R", 0) + "\n");
total += Integer.parseInt(obj[0].toString());
totalf = totalf.add(((BigDecimal) obj[0]).setSca
le(2, BigDecimal.ROUND_HALF_UP));
if (feeDetailsAndAmtList.size() == 14) {
for (int j = 0; j < (35); j++) {
sb.append("\n");
}
}
} else {
sb.append(filler(obj[1].toString(), 22, "L", 0)
+ filler(((BigDecimal) obj[0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString(),
11, "R", 0) + filler(obj[1].toString(), 31, "L", 2) + filler(((BigDecimal) obj[
0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString(), 12, "R", 0) + "\n");
total += Integer.parseInt(obj[0].toString());
totalf = totalf.add(((BigDecimal) obj[0]).setSca
le(2, BigDecimal.ROUND_HALF_UP));
}
}
amountinwords = uiserviceobject.amountToWord(Double.pars
eDouble(totalf.toString()), null);
}
if (feeDetailsAndAmtList.size() < 14) {
for (int n = 0; n < (14 - feeDetailsAndAmtList.size());
n++) {
sb.append("\n");
}
} else {
for (int l = 0; l < 14 - (feeDetailsAndAmtList.size() 14); l++) {
sb.append("\n");
}
}
sb.append(filler(String.valueOf(totalf), 15, "R", 18) + fill
er(String.valueOf(totalf).toString(), 14, "R", 31) + "\n");
//
sb.append("\n");
String amountinwords1 = amountinwords;
String amountinwords2 = amountinwords;
String amountinword = amountinwords;
if (amountinwords.length() > 0) {
if (amountinwords.length() < 35) {
for (int a = 0; a < (35 - amountinwords.length()); a
++) {
amountinwords2 = amountinwords2 + " ";
amountinword = amountinword + " ";
}
if (amountinwords.length() < 25) {
for (int b = 0; b < (25 - amountinwords.length()
); b++) {
amountinwords1 = amountinwords1 + " ";

}
}
}
sb.append(filler(amountinwords1.substring(0, 25).toStrin
g(), 30, "L", 3) + filler(amountinwords2.subSequence(0, 35).toString(), 36, "L",
9) + "\n");
sb.append(filler(amountinwords1.substring(25).toString()
, 30, "L", 3) + filler(amountinwords2.substring(35).toString(), 36, "L", 9) + "\
n");
}
//
sb.append("\n");
sb.append(filler(data.get(i).get("drawnon").toString(), 26,
"L", 7) + filler(data.get(i).get("drawnon").toString(), 37, "L", 8) + "\n");
sb.append(filler(data.get(i).get("particularsno").toString()
, 8, "L", 7) + filler(data.get(i).get("particularsdate") == "" ? "" : df.format(
df.parse(data.get(i).get("particularsdate").toString())), 11, "L", 4) + filler(d
ata.get(i).get("particularsno").toString(), 5, "L", 10) + filler(data.get(i).get
("particularsdate") == "" ? "" : df.format(df.parse(data.get(i).get("particulars
date").toString())), 18, "L", 12) + "\n");
sb.append(filler(data.get(i).get("employeename").toString(),
21, "L", 12) + filler(data.get(i).get("employeename").toString(), 33, "L", 12)
+ "\n");
sb.append(filler(ims.getInstitutename().toString(), 25, "L",
8) + filler(ims.getInstitutename().toString(), 37, "L", 8) + "");
for (int s = 0; s < 9; s++) {
sb.append("\n");
}
}
}
Map map = new HashMap();
map.put("printdata", sb.toString());
map.put("noofcopies", 1);
System.out.println("Printing Text" + sb.toString());
new Thread(new PrinterRunnable("10.1.30.9", 7077, map, map), "PrintT
hread").start();
System.out.println("Done");
} catch (Exception e) {
e.printStackTrace();
}
}
private String filler(String s, int size, String alignment, int minGap) {
String finalString = "";
for (int i = 0; i < minGap; i++) {
finalString = finalString + " ";
}
if (alignment.equals("L")) {
if (s.length() == size) {
return (finalString + s);
} else if (s.length() > size) {
//String s3=s.substring(10, s.length()).length()>10?
return (finalString + s.substring(0, size));
} else if (s.length() < size) {
String s1 = "";
for (int i = s.length(); i < size; i++) {
s1 = s1 + " ";
}
return (finalString + s + s1);

}
} else {
if (s.length() == size) {
return (finalString + s);
} else if (s.length() > size) {
//String s3=s.substring(10, s.length()).length()>10?
return (finalString + s.substring(0, size));
} else if (s.length() < size) {
String s1 = "";
for (int i = s.length(); i < size; i++) {
s1 = s1 + " ";
}
return (s1 + (finalString + s));
}
}
return null;
}
public List getPrNoOnPrid(String studentid, String instid) {
List rtnlist = new ArrayList();
ASObject objt = null;
try {
List<Object[]> excntrList = daoFactory.getFeeTransactionDAO().getPrN
oOnPrid(studentid, instid);
if (excntrList != null && excntrList.size() > 0) {
for (int i = 0; i < excntrList.size(); i++) {
objt = new ASObject();
objt.put("data", excntrList.get(i)[0] == null ? "" : excntrL
ist.get(i)[0].toString());
objt.put("label", excntrList.get(i)[1] == null ? "" : excntr
List.get(i)[1].toString());
rtnlist.add(objt);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return rtnlist;
}
public List getPrNoOnPridAll(String instid) {
List rtnlist = new ArrayList();
ASObject objt = null;
try {
List<Object[]> excntrList = daoFactory.getFeeTransactionDAO().getPrN
oOnPridAll(instid);
if (excntrList != null && excntrList.size() > 0) {
for (int i = 0; i < excntrList.size(); i++) {
objt = new ASObject();
objt.put("data", excntrList.get(i)[0] == null ? "" : excntrL
ist.get(i)[0].toString());
objt.put("label", excntrList.get(i)[1] == null ? "" : excntr
List.get(i)[1].toString());
rtnlist.add(objt);
}
}

} catch (Exception e) {
e.printStackTrace();
}
return rtnlist;
}
private void getFeeReceiptReportData(ServletOutputStream outputStream, Strin
g realPath, String instituteid, String registrationid, String enrollmentno, Stri
ng studentid, String prnofrom, String prnoto, String receiptmode, String prid, S
tring prid1, String reportby, String collectiondate) {
List<ASObject> data = null;
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
DecimalFormat df1 = new DecimalFormat();
df1.setMaximumFractionDigits(2);
ASObject aSObject = null;
UIService uiserviceobject = new UIService();
if (prid != null && !"".equals(prid)) {
aSObject = getFeeReceiptReportData2(instituteid, registrationid, stu
dentid, enrollmentno, reportby, prid, receiptmode);
} else {
aSObject = getFeeReceiptReportData(instituteid, registrationid, stud
entid, enrollmentno, prid1, prnofrom, prnoto, reportby);
}
data = (List) aSObject.get("list");
String amountinwords = "";//uiserviceobject.amountToWord(Double.parseDou
ble(amt.toString()), null);
InstituteMaster ims = (InstituteMaster) daoFactory.getInstituteMasterDAO
().findByPrimaryKey(instituteid);
StringBuilder sb = new StringBuilder();
try {
sb.append("<html>");
sb.append("<head>");
sb.append("<title></title>");
sb.append("<head>");
sb.append("<body onload='window.print()'>");
if (data != null && !data.isEmpty() && data.size() > 0) {
for (int i = 0; i < data.size(); i++) {
int total = 0;
int total1 = 0;
BigDecimal totalf = new BigDecimal(0.00);
BigDecimal totalf1 = new BigDecimal(0.00);
sb.append("<table style='width:100%;align:center;border:1px'
>");
sb.append("<tr>");
sb.append("<td>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black'>");
sb.append("<tr border='0'><th><img src='" + realPath + "" +
ims.getLogofilename() + "' style='width:253px;height:111'></th></tr>");
//
sb.append("<tr><th>" + ims.getInstitutename() + "</th></tr
>");
sb.append("<tr><th>FEE RECEIPT</th></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black' cellpadding='2'>");
sb.append("<tr><td style='width:100px'>ROLL NO:</td><td styl
e='text-align:left'>" + data.get(i).get("enrollmentno").toString().toUpperCase()

+ "</td></tr>");
sb.append("<tr><td style='width:100px'>STUD NAME:</td><td st
yle='text-align:left'>" + data.get(i).get("name").toString().toUpperCase() + "</
td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black' cellpadding='2'>");
sb.append("<tr><td style='width:100px'>SEMESTER:</td><td>" +
data.get(i).get("semester").toString() + "/" + df.format(new Date()).substring(
8, 10) + "</td><td>&nbsp;&nbsp;&nbsp;</td><td style='text-align:right'>RECEIPT N
O.:</td><td>" + data.get(i).get("prno").toString().toUpperCase() + "</td></tr>")
;
sb.append("<tr><td style='width:100px'>CATEGORY:</td><td>" +
data.get(i).get("categorycode").toString().toUpperCase() + "</td><td>&nbsp;&nbs
p;&nbsp;</td><td style='text-align:right'>DATE:</td><td>" +(collectiondate==null
?df.format(data.get(i).get("prdate")):collectiondate) + "</td></tr>");
sb.append("<tr><td style='width:100px'>PROGRAME:</td><td>" +
data.get(i).get("program").toString().toUpperCase() + "</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black;font-size:10px'>");
sb.append("<tr><td>Received Fees as Per Following</td></tr>"
);
sb.append("</table>");
List<Object[]> feeDetailsAndAmtList = (List<Object[]>) daoFa
ctory.getFeeTransactionDAO().getFeeReceiptReportFeeDetailsAndAmtData(instituteid
, registrationid, data.get(i).get("studentid").toString(), data.get(i).get("enro
llmentno").toString(), data.get(i).get("prid").toString(), prnofrom, prnoto, rep
ortby);
sb.append("<table border='1' style='width:560px;border-colla
pse:collapse;border:1px' cellpadding='2'>");
sb.append("<tr><th>PARTICULARS</th> <th width='139px'>AMOUNT
</th></tr>");
if (feeDetailsAndAmtList != null && feeDetailsAndAmtList.siz
e() > 0 && !feeDetailsAndAmtList.isEmpty()) {
for (int x = 0; x < feeDetailsAndAmtList.size(); x++) {
Object[] obj = (Object[]) feeDetailsAndAmtList.get(x
);
if (feeDetailsAndAmtList.size() > 14) {
if (obj[1].toString().length() > 50) {
sb.append("<tr style='font-size:11px;'><td>"
+ (obj[1].toString()).substring(0, 50) + "\n" + (obj[1].toString()).substring(5
1) + "</td><td style='text-align:right'>" + ((BigDecimal) obj[0]).setScale(2, Bi
gDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
} else {
sb.append("<tr style='font-size:11px;'><td>"
+ obj[1].toString() + "</td><td style='text-align:right'>" + ((BigDecimal) obj[
0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
}
total += Integer.parseInt(obj[0].toString());
totalf = totalf.add(((BigDecimal) obj[0]).setSca
le(2, BigDecimal.ROUND_HALF_UP));
if (feeDetailsAndAmtList.size() == 14) {
for (int j = 0; j < (25); j++) {
sb.append("<tr><td></td></tr>");
}

}
} else {
if (obj[1].toString().length() > 50) {
sb.append("<tr style='font-size:11px;'><td>"
+ (obj[1].toString()).substring(0, 50) + "\n" + (obj[1].toString()).substring(5
1) + "</td><td style='text-align:right'>" + ((BigDecimal) obj[0]).setScale(2, Bi
gDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
} else {
sb.append("<tr style='font-size:11px;'><td>"
+ obj[1].toString() + "</td><td style='text-align:right'>" + ((BigDecimal) obj[
0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
}
total += Integer.parseInt(obj[0].toString());
totalf = totalf.add(((BigDecimal) obj[0]).setSca
le(2, BigDecimal.ROUND_HALF_UP));
}
}
sb.append("<tr style='text-align:right'><td style='textalign:right'><b>TOTAL</b></td><td><b>" + String.valueOf(totalf) + "</b></td></tr
>");
//
sb.append("</tr>");
sb.append("</table>");
amountinwords = uiserviceobject.amountToWord(Double.pars
eDouble(totalf.toString()), null);
}
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px;border:1px solid black' cellpadding='2'>");
if (feeDetailsAndAmtList.size()< 14) {
for (int j = 0; j < (30); j++) {
sb.append("<tr><td></td></tr>");
}
}
if (feeDetailsAndAmtList.size() < 14) {
for (int n = 0; n < (14 - feeDetailsAndAmtList.size());
n++) {
sb.append("<tr><td></td></tr>");
}
} else {
for (int l = 0; l < 14 - (feeDetailsAndAmtList.size() 14); l++) {
sb.append("<tr><td></td></tr>");
}
}
sb.append("<tr><td style='width:150px'>Amount in Words:</td
><td style='font-size:12px'>" + amountinwords.toUpperCase() + "</td></tr>");
sb.append("<tr><td style='width:150px'>Drawn on:</td><td st
yle='font-size:12px'>" + data.get(i).get("drawnon").toString().toUpperCase() + "
</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:colla
pse;border:1px solid black' cellpadding='2'>");
if(data.get(i).get("particularsdate").equals("Cash"))
{
sb.append("<tr><td style='width:150px'>Cheque No:</td><td st
yle='font-size:12px'>" + data.get(i).get("particularsno").toString().toUpperCase
() + "</td><td>&nbsp;&nbsp;&nbsp</td><td>Date:</td><td>" + (data.get(i).get("par
ticularsdate").equals("Cash") ? (collectiondate==null?df.format(data.get(i).get(
"prdate")):collectiondate): df.format((data.get(i).get("particularsdate")))) + "
</td></tr>");

}else
{
sb.append("<tr><td style='width:150px'>Cheque No:</td><td st
yle='font-size:12px'>" + data.get(i).get("particularsno").toString().toUpperCase
() + "</td><td>&nbsp;&nbsp;&nbsp</td><td>Date:</td><td>" + (data.get(i).get("par
ticularsdate")=="" ? "": df.format((data.get(i).get("particularsdate")))) + "</t
d></tr>");
}
sb.append("<tr><td style='width:150px'>Received By:</td><td
style='font-size:12px'>" + data.get(i).get("employeename").toString().toUpperCas
e() + "</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black'>");
for (int j = 0; j < (40); j++) {
sb.append("<tr><td></td></tr>");
}
sb.append("<tr border='0'><td>Subject to realistation of Che
que</td></tr>");
sb.append("<tr><td>Subject to Ahmedabad Jurisdiction</td><td
>Receiver's Signature</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black'>");
sb.append("<tr style='text-align:center' border='0'><td>Nirm
a University</td></tr>");
sb.append("<tr style='text-align:center'><td>Sarkhej-Gandhin
agar Highway ,Ahmedabad - 382481</td></tr>");
sb.append("</table>");
sb.append("</td>");
sb.append("<td>");
sb.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<
/td>");
sb.append("<td style='border:1px'>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black'>");
sb.append("<tr border='0'><th><img src='" + realPath + "" +
ims.getLogofilename() + "' style='width:253px;height:111'></th></tr>");
//
sb.append("<tr><th>" + ims.getInstitutename() + "</th></tr
>");
sb.append("<tr><th>FEE RECEIPT</th></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black' cellpadding='2'>");
sb.append("<tr><td style='width:100px'>ROLL NO:</td><td styl
e='text-align:left'>" + data.get(i).get("enrollmentno").toString().toUpperCase()
+ "</td></tr>");
sb.append("<tr><td style='width:100px'>STUD NAME:</td><td st
yle='text-align:left'>" + data.get(i).get("name").toString().toUpperCase() + "</
td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps

e;border:1px solid black' cellpadding='2'>");


sb.append("<tr><td style='width:100px'>SEMESTER:</td><td>" +
data.get(i).get("semester").toString() + "/" + df.format(new Date()).substring(
8, 10) + "</td><td>&nbsp;&nbsp;&nbsp;</td><td style='text-align:right'>RECEIPT N
O.:</td><td>" + data.get(i).get("prno").toString().toUpperCase() + "</td></tr>")
;
sb.append("<tr><td style='width:100px'>CATEGORY:</td><td>" +
data.get(i).get("categorycode").toString().toUpperCase() + "</td><td>&nbsp;&nbs
p;&nbsp;</td><td style='text-align:right'>DATE:</td><td>" +(collectiondate==null
?df.format(data.get(i).get("prdate")):collectiondate) + "</td></tr>");
sb.append("<tr><td style='width:100px'>PROGRAME:</td><td>" +
data.get(i).get("program").toString().toUpperCase() + "</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black;font-size:10px'>");
sb.append("<tr><td>Received Fees as Per Following</td></tr>"
);
sb.append("</table>");
List<Object[]> feeDetailsAndAmtList1 = (List<Object[]>) daoF
actory.getFeeTransactionDAO().getFeeReceiptReportFeeDetailsAndAmtData(institutei
d, registrationid, data.get(i).get("studentid").toString(), data.get(i).get("enr
ollmentno").toString(), data.get(i).get("prid").toString(), prnofrom, prnoto, re
portby);
sb.append("<table border='1' style='width:560px;border-colla
pse:collapse;border:1px' cellpadding='2'>");
sb.append("<tr><th>PARTICULARS</th> <th width='139px'>AMOUNT
</th></tr>");
if (feeDetailsAndAmtList1 != null && feeDetailsAndAmtList1.s
ize() > 0 && !feeDetailsAndAmtList1.isEmpty()) {
for (int x = 0; x < feeDetailsAndAmtList1.size(); x++) {
Object[] obj = (Object[]) feeDetailsAndAmtList1.get(
x);
if (feeDetailsAndAmtList1.size() > 14) {
if (obj[1].toString().length() > 50) {
sb.append("<tr style='font-size:11px;'><td>
" + (obj[1].toString()).substring(0, 50) + "\n" + (obj[1].toString()).substring(
51) + "</td><td style='text-align:right'>" + ((BigDecimal) obj[0]).setScale(2, B
igDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
} else {
sb.append("<tr style='font-size:11px;'><td>
" + obj[1].toString() + "</td><td style='text-align:right'>" + ((BigDecimal) obj
[0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
}
total1 += Integer.parseInt(obj[0].toString());
totalf1 = totalf1.add(((BigDecimal) obj[0]).setS
cale(2, BigDecimal.ROUND_HALF_UP));
if (feeDetailsAndAmtList.size() == 14) {
for (int j = 0; j < (25); j++) {
sb.append("<tr><td></td></tr>");
}
}
} else {
if (obj[1].toString().length() > 50) {
sb.append("<tr style='font-size:11px;'><td>
" + (obj[1].toString()).substring(0, 50) + "\n" + (obj[1].toString()).substring(
51) + "</td><td style='text-align:right'>" + ((BigDecimal) obj[0]).setScale(2, B
igDecimal.ROUND_HALF_UP).toString() + "</td></tr>");

} else {
sb.append("<tr style='font-size:11px;'><td>
" + obj[1].toString() + "</td><td style='text-align:right'>" + ((BigDecimal) obj
[0]).setScale(2, BigDecimal.ROUND_HALF_UP).toString() + "</td></tr>");
}
total1 += Integer.parseInt(obj[0].toString());
totalf1 = totalf1.add(((BigDecimal) obj[0]).setS
cale(2, BigDecimal.ROUND_HALF_UP));
}
}
sb.append("<tr style='text-align:right'><td style='textalign:right'><b>TOTAL</b></td><td><b>" + String.valueOf(totalf1) + "</b></td></t
r>");
//
sb.append("</tr>");
sb.append("</table>");
amountinwords = uiserviceobject.amountToWord(Double.pars
eDouble(totalf1.toString()), null);
}
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black' cellpadding='2'>");
if (feeDetailsAndAmtList1.size()< 14) {
for (int j = 0; j < (30); j++) {
sb.append("<tr><td></td></tr>");
}
}
if (feeDetailsAndAmtList.size() < 14) {
for (int n = 0; n < (14 - feeDetailsAndAmtList.size());
n++) {
sb.append("<tr><td></td></tr>");
}
} else {
for (int l = 0; l < 14 - (feeDetailsAndAmtList.size() 14); l++) {
sb.append("<tr><td></td></tr>");
}
}
sb.append("<tr><td style='width:150px'>Amount in Words:</td>
<td style='font-size:12px'>" + amountinwords.toUpperCase() + "</td></tr>");
sb.append("<tr><td style='width:150px'>Drawn on:</td><td st
yle='font-size:12px'>" + data.get(i).get("drawnon").toString().toUpperCase() + "
</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:colla
pse;border:1px solid black' cellpadding='2'>");
if(data.get(i).get("particularsdate").equals("Cash"))
{
sb.append("<tr><td style='width:150px'>Cheque No:</td><td s
tyle='font-size:12px'>" + data.get(i).get("particularsno").toString().toUpperCas
e() + "</td><td>&nbsp;&nbsp;&nbsp</td><td>Date:</td><td>" + (data.get(i).get("pa
rticularsdate").equals("Cash") ? (collectiondate==null?df.format(data.get(i).get
("prdate")):collectiondate): df.format((data.get(i).get("particularsdate")))) +
"</td></tr>");
}else
{
sb.append("<tr><td style='width:150px'>Cheque No:</td><td s
tyle='font-size:12px'>" + data.get(i).get("particularsno").toString().toUpperCas
e() + "</td><td>&nbsp;&nbsp;&nbsp</td><td>Date:</td><td>" + (data.get(i).get("pa

rticularsdate")=="" ? "": df.format((data.get(i).get("particularsdate")))) + "</


td></tr>");
}
sb.append("<tr><td style='width:150px'>Received By:</td><td
style='font-size:12px'>" + data.get(i).get("employeename").toString().toUpperCa
se() + "</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black'>");
for (int j = 0; j < (40); j++) {
sb.append("<tr><td></td></tr>");
}
sb.append("<tr border='0'><td>Subject to realistation of Che
que</td></tr>");
sb.append("<tr><td>Subject to Ahmedabad Jurisdiction</td><td
>Receiver's Signature</td></tr>");
sb.append("</table>");
sb.append("<table style='width:560px;border-collapse:collaps
e;border:1px solid black'>");
sb.append("<tr style='text-align:center' border='0'><td>Nirm
a University</td></tr>");
sb.append("<tr style='text-align:center'><td>Sarkhej-Gandhin
agar Highway ,Ahmedabad - 382481</td></tr>");
sb.append("</table>");
sb.append("</td>");
sb.append("</table>");
}
sb.append("</body>");
sb.append("</html>");
//

System.out.println(sb.toString());
outputStream.print(sb.toString());
} else {
}
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* DESC:: Method for Individual Student Fee Receipt.
* @return
*/
public List getAllEventCodeWithRegistrationCode() {
String instId = JIRPSession.getLoginInfo().getUserProfile().getSelectedi
nstitutemaster().getInstituteid();
ASObject aso = null;
List rtnList = new ArrayList();
List<Object[]> eventList = (List<Object[]>) daoFactory.getFeeCollectionE
ventsDAO().getAllFeeCollectionEventCodeWithRegistrationCode(instId);
if (eventList != null && eventList.size() > 0 && !eventList.isEmpty()) {
for (int i = 0; i < eventList.size(); i++) {
aso = new ASObject();
aso.put("data", eventList.get(i)[0]);
aso.put("label", eventList.get(i)[1]);
aso.put("desc", eventList.get(i)[2]);
aso.put("regid", eventList.get(i)[10]);

rtnList.add(aso);
}
}
return rtnList;
}
public List getAllSTYNoFromStudentRegistration(String studentid, String inst
ituteid) {
List retList = new ArrayList();
ASObject obj = null;
try {
List list = (List) daoFactory.getStudentRegistrationDAO().find("sele
ct distinct sr.stynumber from StudentRegistration sr where sr.id.instituteid = '
" + instituteid + "' and sr.id.studentid = '" + studentid + "' order by sr.stynu
mber asc");
if (list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
obj = new ASObject();
obj.put("label", list.get(i).toString());
obj.put("data", list.get(i).toString());
obj.put("prnoList", getPrNoOnPridWithDate(studentid, institu
teid, obj.get("data").toString()));
retList.add(obj);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return retList;
}
public List getPrNoOnPridWithDate(String studentid, String instituteid, Stri
ng styno) {
List retList = new ArrayList();
ASObject obj = null;
try {
List<Object[]> list = (List<Object[]>) daoFactory.getFeeTransactionD
AO().getPrNoOnPridWithDate(studentid, instituteid, styno);
if (list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
obj = new ASObject();
obj.put("label", list.get(i)[1].toString().concat(" (").conc
at(list.get(i)[2].toString()).concat(")"));
obj.put("data", list.get(i)[0].toString());
retList.add(obj);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return retList;
}
}