Commit bd3abf88 authored by vvengurlekar's avatar vvengurlekar

changes done in ejb and servlet as currancy and format value scale added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105550 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e37eea9e
...@@ -32,9 +32,10 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -32,9 +32,10 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
String codes[]=new String[20]; String codes[]=new String[20];
String signs[] =new String[20]; String signs[] =new String[20];
DecimalFormat decFormator =new DecimalFormat("#.##"); DecimalFormat decFormator =new DecimalFormat("#.##");
String currancyCode = "";
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject generateReport(String siteCode,String acctPrd, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException public JSONObject generateReport(String siteCode,String acctPrd, String formatCode,String reportType,String dataSourceName, String formatValueScale) throws RemoteException, ITMException
{ {
ResultSet rs=null; ResultSet rs=null;
...@@ -64,6 +65,12 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -64,6 +65,12 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
conn = connDriver.getConnectDB(dataSourceName); conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;
if((formatValueScale == null) || (formatValueScale.length() == 0))
{
formatValueScale = "1";
}
System.out.println("formatValueScale: "+formatValueScale);
sql = "SELECT C.code CUR_CODE, (SELECT D.code FROM acctprd D WHERE C.FR_DATE-1 BETWEEN D.FR_DATE AND D.To_DATE ) AS prv_fin_prd FROM acctprd C WHERE C.code IN ('"+acctPrd+"')"; sql = "SELECT C.code CUR_CODE, (SELECT D.code FROM acctprd D WHERE C.FR_DATE-1 BETWEEN D.FR_DATE AND D.To_DATE ) AS prv_fin_prd FROM acctprd C WHERE C.code IN ('"+acctPrd+"')";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -103,13 +110,14 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -103,13 +110,14 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
pstmt=null; pstmt=null;
sql="select descr from SITE where site_code = ?"; sql="select s.site_code, s.descr, fi.curr_code from finent fi inner join site s on fi.fin_entity=s.fin_entity where s.site_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
siteDescr= checkNull(rs.getString("descr")); siteDescr= checkNull(rs.getString("descr"));
currancyCode= checkNull(rs.getString("curr_code"));
} }
rs.close(); rs.close();
rs=null; rs=null;
...@@ -134,23 +142,23 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -134,23 +142,23 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
prvFinYear= "("+prvFinPeriod+")"; prvFinYear= "("+prvFinPeriod+")";
} }
if(!(rowCount == 0)){ if(!(rowCount == 0)){
rowBuffer = new StringBuffer("<table border='1' width='100%' cellpadding='4' name ='localityDetail' style = 'table-layout: fixed; width: 100%;' id='htmlTable' class = 'mtBackgroundWhite' cellpadding='3' " + rowBuffer = new StringBuffer("<table border='1' width='100%' cellpadding='4' name ='localityDetail' style = 'table-layout: fixed; width: 100%;' id='htmlTable' class = 'mtBackgroundWhite' cellpadding='3' " +
"border='1'><thead><tr><td rowspan='2' align='center' class = 'commonHeaderCardhtml' style='width: 5%;'>Description</td> <td colspan='2' " + "border='1'><thead class='mtBackgroundWhitethead'><tr><td rowspan='2' align='center' class = 'commonHeaderCardhtml' style='width: 5%;'>Description</td> <td colspan='2' " +
"align='center' style='width: 4%;' class = 'commonHeaderCardhtml'>Current financial year (" "align='center' style='width: 4%;' class = 'commonHeaderCardhtml'>Current financial year ("
+acctPrd+")</td> <td colspan='2' align='center' style='width: 4%;' " + +acctPrd+") - "+currancyCode+"</td> <td colspan='2' align='center' style='width: 4%;' " +
"class = 'commonHeaderCardhtml'>Previous financial year "+prvFinYear+ "class = 'commonHeaderCardhtml'>Previous financial year ("+prvFinYear+
"</td></tr><tr><td align='center' style='width: 2%;' class = 'commonHeaderCardhtml'>In</td>" + ") - "+currancyCode+"</td></tr><tr><td align='center' style='width: 2%;' class = 'commonHeaderCardhtml'>In</td>" +
"<td class='commonHeaderCardhtml' align='center' style='width: 2%;'>Out</td>" + "<td class='commonHeaderCardhtml' align='center' style='width: 2%;'>Out</td>" +
"<td class='commonHeaderCardhtml' align='center' style='width: 2%;'>In</td>" + "<td class='commonHeaderCardhtml' align='center' style='width: 2%;'>In</td>" +
"<td align='center' style='width: 2%;' class = 'commonHeaderCardhtml'>Out</td></tr></thead>" + "<td align='center' style='width: 2%;' class = 'commonHeaderCardhtml'>Out</td></tr></thead>" +
"<tbody>"); "<tbody class='mtBackgroundWhitetbody'>");
} }
else{ else{
rowBuffer = new StringBuffer("<table id='htmlTable' cellpadding='2' align='center'><tr><td align = 'center' class='gwt-ScrollTable'>No Data Found</td></tr></table>"); rowBuffer = new StringBuffer("<table id='htmlTable' cellpadding='2' align='center'><tr><td align = 'center' class='gwt-ScrollTable'>No Data Found</td></tr></table>");
noScrollRequired = true; noScrollRequired = true;
} }
while (rs.next()) while (rs.next())
{ {
titleCode = checkNull(rs.getString("TITLE_CODE")); titleCode = checkNull(rs.getString("TITLE_CODE"));
...@@ -189,7 +197,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -189,7 +197,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
if(llCount >0) if(llCount >0)
{ {
if(populateSubGroup(siteCode,siteDescr,titleCode,curGroupTotal,preGroupTotal, printLevel,acctPrd,curFinPrdFrom,curFinPrdTo,prvFinPeriod, if(populateSubGroup(siteCode,siteDescr,titleCode,curGroupTotal,preGroupTotal, printLevel,acctPrd,curFinPrdFrom,curFinPrdTo,prvFinPeriod,
prvFinPrdFrom,prvFinPrdTo,formatCode,reportType,factor,rawDataJson,dataSourceName,titleCodeParent,conn,rowBuffer)) prvFinPrdFrom,prvFinPrdTo,formatCode,reportType,factor,rawDataJson,dataSourceName,titleCodeParent,conn,rowBuffer,formatValueScale))
{ {
} }
...@@ -627,15 +635,16 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -627,15 +635,16 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
rowData.put("curr_in_val", 0); rowData.put("curr_in_val", 0);
rowData.put("prev_in_val", 0); rowData.put("prev_in_val", 0);
rawDataJson.put(count, rowData);*/ rawDataJson.put(count, rowData);*/
rowBuffer.append("<tr><td class= 'cardHtmlTableBodyAlignLft' style='width: 5%; overflow: hidden;'>"+titleDescr+"</td>"); rowBuffer.append("<tr class='mtBackgroundWhitetbodytr'><td class= 'cardHtmlTableBodyAlignLft' style='width: 5%; overflow: hidden;'>"+titleDescr+"</td>");
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>0.0</td>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>0.0</td>");
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(curGroupTotal)+"</td>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(curGroupTotal/Integer.parseInt(formatValueScale))+"</td>");
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>0.0</td>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>0.0</td>");
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(preGroupTotal)+"</td></tr>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(preGroupTotal/Integer.parseInt(formatValueScale))+"</td></tr>");
System.out.println("In generatereport() count:"+count+" titleDescr: "+titleDescr+"curr_in_val: 0.0 ,prev_in_val:0.0, curr_out_val: "+curGroupTotal+"prev_out_val: "+preGroupTotal); System.out.println("In generatereport() count:"+count+" titleDescr: "+titleDescr+"curr_in_val: 0.0 ,prev_in_val:0.0, curr_out_val: "+curGroupTotal+"prev_out_val: "+preGroupTotal);
count++; count++;
} // end of else of llCount >0 } // end of else of llCount >0
}// end of while }// end of while
rowBuffer.append("</tbody></table>"); rowBuffer.append("</tbody></table>");
System.out.println("rowBuffer"+rowBuffer); System.out.println("rowBuffer"+rowBuffer);
rowData = new JSONObject(); rowData = new JSONObject();
...@@ -684,7 +693,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -684,7 +693,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public boolean populateSubGroup(String siteCode,String siteDescr,String titleCode,double curGroupTotal,double preGroupTotal, public boolean populateSubGroup(String siteCode,String siteDescr,String titleCode,double curGroupTotal,double preGroupTotal,
int printLevel,String acctPrd,String curFinPrdFrom,String curFinPrdTo,String prvFinPeriod, int printLevel,String acctPrd,String curFinPrdFrom,String curFinPrdTo,String prvFinPeriod,
String prvFinPrdFrom,String prvFinPrdTo,String formatCode,String reportType,String factor,JSONObject rawDataJson,String dataSourceName,String titleCodeParent, Connection conn,StringBuffer rowBuffer) throws RemoteException, ITMException String prvFinPrdFrom,String prvFinPrdTo,String formatCode,String reportType,String factor,JSONObject rawDataJson,String dataSourceName,String titleCodeParent, Connection conn,StringBuffer rowBuffer, String formatValueScale) throws RemoteException, ITMException
{ {
ResultSet rs=null; ResultSet rs=null;
ResultSet rs1 = null; ResultSet rs1 = null;
...@@ -776,7 +785,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -776,7 +785,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
{ {
if(populateSubGroup(siteCode,siteDescrSGrp,titleCodeLocal,curGroupTotalSGrp,preGroupTotalSGrp, if(populateSubGroup(siteCode,siteDescrSGrp,titleCodeLocal,curGroupTotalSGrp,preGroupTotalSGrp,
printLevel,acctPrd,curFinPrdFrom,curFinPrdTo,prvFinPeriod,prvFinPrdFrom,prvFinPrdTo,formatCode, printLevel,acctPrd,curFinPrdFrom,curFinPrdTo,prvFinPeriod,prvFinPrdFrom,prvFinPrdTo,formatCode,
reportType,factorSGrp,rawDataJson,dataSourceName,titleCodeParent,conn,rowBuffer)) reportType,factorSGrp,rawDataJson,dataSourceName,titleCodeParent,conn,rowBuffer, formatValueScale))
{ {
totalCurr[printLevel] = 0; totalCurr[printLevel] = 0;
totalPrev[printLevel]= 0; totalPrev[printLevel]= 0;
...@@ -803,36 +812,36 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -803,36 +812,36 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
// start of current year // start of current year
if(balType.trim().equals("C")) if(balType.trim().equals("C"))
{ {
sql="SELECT sum(case when accounts.typ_bal = 'D' then acctbal.dr_amt__base - acctbal.cr_amt__base else acctbal.cr_amt__base - acctbal.dr_amt__base end) as total " sql="SELECT sum(case when accounts.typ_bal = 'D' then acctbal.dr_amt__base - acctbal.cr_amt__base else acctbal.cr_amt__base - acctbal.dr_amt__base end) as total, Acctbal.curr_code__ac "
+" FROM acctbal, accounts, acctsgrp " +" FROM acctbal, accounts, acctsgrp "
+" WHERE site_code IN ('"+siteCode+"') AND " +" WHERE site_code IN ('"+siteCode+"') AND "
+" ( acctbal.acct_code = accounts.acct_code ) and " +" ( acctbal.acct_code = accounts.acct_code ) and "
+" ( acctsgrp.sgroup_code = accounts.sgroup_code ) and " +" ( acctsgrp.sgroup_code = accounts.sgroup_code ) and "
+" ( acctbal.acct_prd = '"+acctPrd+"' ) and " +" ( acctbal.acct_prd = '"+acctPrd+"' ) and "
+" ( (acctbal.prd_code between '000000' and '"+curFinPrdTo+"' ) AND " +" ( (acctbal.prd_code between '000000' and '"+curFinPrdTo+"' ) AND "
+" ( acctsgrp.group_code = '"+tempGroupCode+"' ) )"; +" ( acctsgrp.group_code = '"+tempGroupCode+"' ) ) group by Acctbal.curr_code__ac";
} }
else if(balType.trim().equals("O")) else if(balType.trim().equals("O"))
{ {
sql="SELECT sum(case when accounts.typ_bal = 'D' then acctbal.dr_amt__base - acctbal.cr_amt__base else acctbal.cr_amt__base - acctbal.dr_amt__base end) as total " sql="SELECT sum(case when accounts.typ_bal = 'D' then acctbal.dr_amt__base - acctbal.cr_amt__base else acctbal.cr_amt__base - acctbal.dr_amt__base end) as total, Acctbal.curr_code__ac "
+" FROM acctbal, accounts, acctsgrp " +" FROM acctbal, accounts, acctsgrp "
+" WHERE site_code IN ('"+siteCode+"') AND " +" WHERE site_code IN ('"+siteCode+"') AND "
+" ( acctbal.acct_code = accounts.acct_code ) and " +" ( acctbal.acct_code = accounts.acct_code ) and "
+" ( acctsgrp.sgroup_code = accounts.sgroup_code ) and " +" ( acctsgrp.sgroup_code = accounts.sgroup_code ) and "
+" ( acctbal.acct_prd = '"+acctPrd+"' ) and " +" ( acctbal.acct_prd = '"+acctPrd+"' ) and "
+" ( (acctbal.prd_code >= '000000' and acctbal.prd_code < '"+curFinPrdFrom+"' ) " +" ( (acctbal.prd_code >= '000000' and acctbal.prd_code < '"+curFinPrdFrom+"' ) "
+" AND ( acctsgrp.group_code = '"+tempGroupCode+"' ))"; +" AND ( acctsgrp.group_code = '"+tempGroupCode+"' )) group by Acctbal.curr_code__ac";
} }
else else
{ {
sql="SELECT sum(case when accounts.typ_bal = 'D' then acctbal.dr_amt__base - acctbal.cr_amt__base else acctbal.cr_amt__base - acctbal.dr_amt__base end) as total " sql="SELECT sum(case when accounts.typ_bal = 'D' then acctbal.dr_amt__base - acctbal.cr_amt__base else acctbal.cr_amt__base - acctbal.dr_amt__base end) as total, Acctbal.curr_code__ac "
+" FROM acctbal, accounts,acctsgrp " +" FROM acctbal, accounts,acctsgrp "
+" WHERE site_code IN ('"+siteCode+"') AND " +" WHERE site_code IN ('"+siteCode+"') AND "
+" ( acctbal.acct_code = accounts.acct_code ) and " +" ( acctbal.acct_code = accounts.acct_code ) and "
+" ( acctsgrp.sgroup_code = accounts.sgroup_code ) and " +" ( acctsgrp.sgroup_code = accounts.sgroup_code ) and "
+" ( acctbal.acct_prd = '"+acctPrd+"' ) and " +" ( acctbal.acct_prd = '"+acctPrd+"' ) and "
+" ( (acctbal.prd_code between '"+curFinPrdFrom+"' and '"+curFinPrdTo+"' ) " +" ( (acctbal.prd_code between '"+curFinPrdFrom+"' and '"+curFinPrdTo+"' ) "
+" AND ( acctsgrp.group_code = '"+tempGroupCode+"' ))"; +" AND ( acctsgrp.group_code = '"+tempGroupCode+"' )) group by Acctbal.curr_code__ac";
} }
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
...@@ -1223,13 +1232,13 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -1223,13 +1232,13 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
rawDataJson.put(count, rowData);*/ rawDataJson.put(count, rowData);*/
//System.out.println("totalCurr: "+totalCurr.toString()+" totalCurr length : "+totalCurr.length+" totalPrev: "+totalPrev.toString()+" totalPrev length : "+totalPrev.length); //System.out.println("totalCurr: "+totalCurr.toString()+" totalCurr length : "+totalCurr.length+" totalPrev: "+totalPrev.toString()+" totalPrev length : "+totalPrev.length);
System.out.println("totalCurr: "+Arrays.toString(totalCurr)+" totalPrev: "+Arrays.toString(totalPrev)); System.out.println("totalCurr: "+Arrays.toString(totalCurr)+" totalPrev: "+Arrays.toString(totalPrev));
rowBuffer.append("<tr><td class= 'cardHtmlTableBodyAlignLft' style='width: 5%; overflow: hidden;'>"+titleDescr+"</td>"); rowBuffer.append("<tr class='mtBackgroundWhitetbodytr'><td class= 'cardHtmlTableBodyAlignLft' style='width: 5%; overflow: hidden;'>"+titleDescr+"</td>");
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(curGroupTotalSGrp)+"</td>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(curGroupTotalSGrp/Integer.parseInt(formatValueScale))+"</td>");
System.out.println("totalCurr[printlevel]: "+totalCurr[printLevel]); System.out.println("totalCurr[printlevel]: "+totalCurr[printLevel]);
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(totalCurr[printLevel])+"</td>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(totalCurr[printLevel]/Integer.parseInt(formatValueScale))+"</td>");
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(preGroupTotalSGrp)+"</td>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(preGroupTotalSGrp/Integer.parseInt(formatValueScale))+"</td>");
System.out.println("totalPrev[printlevel]: "+totalPrev[printLevel]); System.out.println("totalPrev[printlevel]: "+totalPrev[printLevel]);
rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(totalPrev[printLevel])+"</td></tr>"); rowBuffer.append("<td class= 'cardHtmlTableBodyAlignRgt' style='width: 2%; overflow: hidden;'>"+decFormator.format(totalPrev[printLevel]/Integer.parseInt(formatValueScale))+"</td></tr>");
System.out.println("In populate() count:"+count+" titleDescr: "+titleDescr+"curr_in_val: "+curGroupTotalSGrp+"prev_in_val: "+preGroupTotalSGrp+"curr_out_val: "+totalCurr[printLevel]+"prev_out_val: "+totalPrev[printLevel]); System.out.println("In populate() count:"+count+" titleDescr: "+titleDescr+"curr_in_val: "+curGroupTotalSGrp+"prev_in_val: "+preGroupTotalSGrp+"curr_out_val: "+totalCurr[printLevel]+"prev_out_val: "+totalPrev[printLevel]);
//System.out.println("printlevel: "+printlevel); //System.out.println("printlevel: "+printlevel);
count++; count++;
...@@ -1275,7 +1284,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -1275,7 +1284,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
return true; return true;
} }
public JSONObject getProfitBalanceSheetDetails(String sitecode, String acctPrd,String formatcode,String reporttype,String dataSourceName) throws RemoteException, ITMException public JSONObject getProfitBalanceSheetDetails(String sitecode, String acctPrd,String formatcode,String reporttype,String dataSourceName, String formatValueScale) throws RemoteException, ITMException
{ {
JSONObject rawDataMnthDivWiseSalesJson = new JSONObject(); JSONObject rawDataMnthDivWiseSalesJson = new JSONObject();
...@@ -1292,7 +1301,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm ...@@ -1292,7 +1301,7 @@ public class ProfitNLossSummary extends ValidatorEJB implements ProfitNLossSumm
} }
System.out.println("Current Financial year"+acctPrd); System.out.println("Current Financial year"+acctPrd);
} }
rawDataMnthDivWiseSalesJson = generateReport(sitecode,acctPrd,formatcode,reporttype,dataSourceName); rawDataMnthDivWiseSalesJson = generateReport(sitecode,acctPrd,formatcode,reporttype,dataSourceName,formatValueScale);
System.out.println("getProfitBalanceSheetDetails data :"+rawDataMnthDivWiseSalesJson); System.out.println("getProfitBalanceSheetDetails data :"+rawDataMnthDivWiseSalesJson);
} }
catch (Exception e) catch (Exception e)
......
...@@ -14,9 +14,9 @@ import org.json.simple.JSONObject; ...@@ -14,9 +14,9 @@ import org.json.simple.JSONObject;
public interface ProfitNLossSummaryLocal extends ValidatorLocal { public interface ProfitNLossSummaryLocal extends ValidatorLocal {
public JSONObject getProfitBalanceSheetDetails(String sitecode, String acctprd,String formatcode,String reporttype,String dataSourceName) throws RemoteException, ITMException; public JSONObject getProfitBalanceSheetDetails(String sitecode, String acctprd,String formatcode,String reporttype,String dataSourceName, String formatValueScale) throws RemoteException, ITMException;
public JSONObject generateReport(String siteCode,String acctPrd, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException; public JSONObject generateReport(String siteCode,String acctPrd, String formatCode,String reportType,String dataSourceName, String formatValueScale) throws RemoteException, ITMException;
public boolean populateSubGroup(String siteCode,String siteDescr,String titleCode,double curGroupTotal,double preGroupTotal, public boolean populateSubGroup(String siteCode,String siteDescr,String titleCode,double curGroupTotal,double preGroupTotal,
int printLevel,String acctPrd,String prdFrom,String prdTo,String prevPrd,String prevPrdCodeFrom,String prevPrdCodeTo,String formatCode, int printLevel,String acctPrd,String prdFrom,String prdTo,String prevPrd,String prevPrdCodeFrom,String prevPrdCodeTo,String formatCode,
String reportType,String factor,JSONObject rawDataJson,String dataSourceName,String titleCodeParent,Connection conn,StringBuffer rowBuffer) throws RemoteException, ITMException; String reportType,String factor,JSONObject rawDataJson,String dataSourceName,String titleCodeParent,Connection conn,StringBuffer rowBuffer, String formatValueScale) throws RemoteException, ITMException;
} }
...@@ -14,10 +14,10 @@ import org.json.simple.JSONObject; ...@@ -14,10 +14,10 @@ import org.json.simple.JSONObject;
public interface ProfitNLossSummaryRemote extends ValidatorRemote{ public interface ProfitNLossSummaryRemote extends ValidatorRemote{
//public JSONObject getProfitBalanceSheetDetails(String sitecode, String prdfrom,String prdto,String acctprd,String formatcode,String reporttype,String dataSourceName) throws RemoteException, ITMException; //public JSONObject getProfitBalanceSheetDetails(String sitecode, String prdfrom,String prdto,String acctprd,String formatcode,String reporttype,String dataSourceName) throws RemoteException, ITMException;
public JSONObject getProfitBalanceSheetDetails(String sitecode, String acctprd,String formatcode,String reporttype,String dataSourceName) throws RemoteException, ITMException; public JSONObject getProfitBalanceSheetDetails(String sitecode, String acctprd,String formatcode,String reporttype,String dataSourceName, String formatValueScale) throws RemoteException, ITMException;
//public JSONObject generateReport(String siteCode,String acctPrd,String prdFrom,String prdTo, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException; //public JSONObject generateReport(String siteCode,String acctPrd,String prdFrom,String prdTo, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException;
public JSONObject generateReport(String siteCode,String acctPrd, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException; public JSONObject generateReport(String siteCode,String acctPrd, String formatCode,String reportType,String dataSourceName, String formatValueScale) throws RemoteException, ITMException;
public boolean populateSubGroup(String siteCode,String siteDescr,String titleCode,double curGroupTotal,double preGroupTotal, public boolean populateSubGroup(String siteCode,String siteDescr,String titleCode,double curGroupTotal,double preGroupTotal,
int printLevel,String acctPrd,String prdFrom,String prdTo,String prevPrd,String prevPrdCodeFrom,String prevPrdCodeTo,String formatCode, int printLevel,String acctPrd,String prdFrom,String prdTo,String prevPrd,String prevPrdCodeFrom,String prevPrdCodeTo,String formatCode,
String reportType,String factor,JSONObject rawDataJson,String dataSourceName,String titleCodeParent,Connection conn,StringBuffer rowBuffer) throws RemoteException, ITMException; String reportType,String factor,JSONObject rawDataJson,String dataSourceName,String titleCodeParent,Connection conn,StringBuffer rowBuffer, String formatValueScale) throws RemoteException, ITMException;
} }
...@@ -32,7 +32,7 @@ public class ProfitNLossSummaryServlet extends HttpServlet ...@@ -32,7 +32,7 @@ public class ProfitNLossSummaryServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String prdfrom = "", acctprd = "",sitecode="",prdto="",formatcode="",reporttype=""; String prdfrom = "", acctprd = "",sitecode="",prdto="",formatcode="",reporttype="", formatValueScale="";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
...@@ -44,7 +44,8 @@ public class ProfitNLossSummaryServlet extends HttpServlet ...@@ -44,7 +44,8 @@ public class ProfitNLossSummaryServlet extends HttpServlet
acctprd = request.getParameter("acctprd"); acctprd = request.getParameter("acctprd");
formatcode = request.getParameter("formatcode"); formatcode = request.getParameter("formatcode");
reporttype = request.getParameter("reporttype"); reporttype = request.getParameter("reporttype");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
formatValueScale = request.getParameter("formatValueScale");
System.out.println("in doPost" ); System.out.println("in doPost" );
System.out.println("days is =" + sitecode ); System.out.println("days is =" + sitecode );
System.out.println("days is =" + prdfrom ); System.out.println("days is =" + prdfrom );
...@@ -55,7 +56,7 @@ public class ProfitNLossSummaryServlet extends HttpServlet ...@@ -55,7 +56,7 @@ public class ProfitNLossSummaryServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
profitLossBalSheetRemote = (ProfitNLossSummaryRemote) context.lookup("ibase/ProfitNLossSummary/remote"); profitLossBalSheetRemote = (ProfitNLossSummaryRemote) context.lookup("ibase/ProfitNLossSummary/remote");
JSONObject jsonObjData = (JSONObject)profitLossBalSheetRemote.getProfitBalanceSheetDetails(sitecode,acctprd,formatcode,reporttype,dataSourceName); JSONObject jsonObjData = (JSONObject)profitLossBalSheetRemote.getProfitBalanceSheetDetails(sitecode,acctprd,formatcode,reporttype,dataSourceName,formatValueScale);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment