Commit 0c6c18df authored by caluka's avatar caluka

receipt amount set string format on reference no item change


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97559 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e72192bf
......@@ -17,7 +17,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import ibase.utility.E12GenericUtility;
import java.text.DecimalFormat;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......@@ -477,8 +477,8 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
Document dom2 = null;
String valueXmlString = "";
System.out.println("xmlString............."+xmlString);
System.out.println("xmlString1............"+xmlString);
System.out.println("xmlString2............"+xmlString);
System.out.println("xmlString1............"+xmlString1);
System.out.println("xmlString2............"+xmlString2);
try
{
if(xmlString != null && xmlString.trim().length() > 0)
......@@ -690,7 +690,7 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
refNo = checkNull(genericUtility.getColumnValue("ref_no",dom));
refSer = checkNull(genericUtility.getColumnValue("ref_ser",dom));
custCode = this.genericUtility.getColumnValue("cust_code", dom1);
System.out.println("custCode>>>>>>>>"+custCode);
sql = "SELECT (TOT_AMT - ADJ_AMT) AS AMT FROM RECEIVABLES WHERE TRAN_SER = ? AND REF_NO = ? and cust_code= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer);
......@@ -706,7 +706,8 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<rcp_amt><![CDATA[").append( rcpAmt1 ).append("]]></rcp_amt>\r\n");
System.out.println("receipt amount["+getRequiredDecimal(rcpAmt1,2)+"]");
valueXmlString.append("<rcp_amt><![CDATA[").append( getRequiredDecimal(rcpAmt1,2) ).append("]]></rcp_amt>\r\n");
}
valueXmlString.append("</Detail2>");
......@@ -757,6 +758,16 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
}
return input;
}
public String getRequiredDecimal(double actVal, int prec)
{
String fmtStr = "############0";
if (prec > 0)
{
fmtStr = fmtStr + "." + "000000000".substring(0, prec);
}
DecimalFormat decFormat = new DecimalFormat(fmtStr);
return decFormat.format(actVal);
}
public static java.util.Date relativeDate(java.util.Date date, int days)
{
java.util.Date calculatedDate = null;
......
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