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; ...@@ -17,7 +17,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import java.text.DecimalFormat;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
...@@ -477,8 +477,8 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E ...@@ -477,8 +477,8 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
Document dom2 = null; Document dom2 = null;
String valueXmlString = ""; String valueXmlString = "";
System.out.println("xmlString............."+xmlString); System.out.println("xmlString............."+xmlString);
System.out.println("xmlString1............"+xmlString); System.out.println("xmlString1............"+xmlString1);
System.out.println("xmlString2............"+xmlString); System.out.println("xmlString2............"+xmlString2);
try try
{ {
if(xmlString != null && xmlString.trim().length() > 0) if(xmlString != null && xmlString.trim().length() > 0)
...@@ -690,7 +690,7 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E ...@@ -690,7 +690,7 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
refNo = checkNull(genericUtility.getColumnValue("ref_no",dom)); refNo = checkNull(genericUtility.getColumnValue("ref_no",dom));
refSer = checkNull(genericUtility.getColumnValue("ref_ser",dom)); refSer = checkNull(genericUtility.getColumnValue("ref_ser",dom));
custCode = this.genericUtility.getColumnValue("cust_code", dom1); 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= ? "; sql = "SELECT (TOT_AMT - ADJ_AMT) AS AMT FROM RECEIVABLES WHERE TRAN_SER = ? AND REF_NO = ? and cust_code= ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer); pstmt.setString(1, refSer);
...@@ -706,7 +706,8 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E ...@@ -706,7 +706,8 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; 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>"); valueXmlString.append("</Detail2>");
...@@ -757,6 +758,16 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E ...@@ -757,6 +758,16 @@ public class EcollectionIC extends ValidatorEJB implements EcollectionICLocal, E
} }
return input; 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) public static java.util.Date relativeDate(java.util.Date date, int days)
{ {
java.util.Date calculatedDate = null; 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